Imported Upstream version 3.18.1
[platform/upstream/pygobject2.git] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
2 AUTOMAKE_OPTIONS = 1.7
3
4 # Limit PyFlakes and PEP8 to these directories.
5 pycheck_dirs = examples gi tests pygtkcompat
6
7 # Part of the gi subdirectory is handled with non-recursive make to avoid
8 # py-compile getting confused between gi/types.py and Python's standard
9 # types module.
10 SUBDIRS = . $(pycheck_dirs)
11
12 PLATFORM_VERSION = 3.0
13
14 CLEANFILES = \
15         `find "$(builddir)" -type f -name "*.pyc" -print`
16
17 EXTRA_DIST = \
18         autogen.sh \
19         pygobject.doap \
20         pygobject-$(PLATFORM_VERSION).pc.in \
21         PKG-INFO \
22         PKG-INFO.in \
23         pygi-convert.sh \
24         m4/as-ac-expand.m4 \
25         m4/jhflags.m4 \
26         m4/python.m4
27
28 MAINTAINERCLEANFILES = \
29         $(srcdir)/INSTALL \
30         $(srcdir)/aclocal.m4 \
31         $(srcdir)/autoscan.log \
32         $(srcdir)/compile \
33         $(srcdir)/config.guess \
34         $(srcdir)/config.h.in \
35         $(srcdir)/config.sub \
36         $(srcdir)/configure.scan \
37         $(srcdir)/depcomp \
38         $(srcdir)/install-sh \
39         $(srcdir)/ltmain.sh \
40         $(srcdir)/missing \
41         $(srcdir)/mkinstalldirs \
42         $(srcdir)/omf.make \
43         $(srcdir)/xmldocs.make \
44         $(srcdir)/gtk-doc.make \
45         $(srcdir)/ChangeLog \
46         $(srcdir)/py-compile \
47         $(srcdir)/m4/libtool.m4 \
48         $(srcdir)/m4/ltoptions.m4 \
49         $(srcdir)/m4/ltsugar.m4 \
50         $(srcdir)/m4/ltversion.m4 \
51         $(srcdir)/m4/lt~obsolete.m4 \
52         `find "$(srcdir)" -type f -name Makefile.in -print` \
53         `find "$(builddir)" -type f -name "*.pyc" -print`
54
55 BUILT_EXTRA_DIST =              \
56         ChangeLog
57
58 nobase_pyexec_PYTHON = \
59         gi/__init__.py \
60         gi/types.py \
61         gi/module.py \
62         gi/importer.py \
63         gi/pygtkcompat.py \
64         gi/docstring.py \
65         gi/_constants.py \
66         gi/_propertyhelper.py \
67         gi/_signalhelper.py \
68         gi/_option.py \
69         gi/_error.py
70
71 # if we build in a separate tree, we need to symlink the *.py files from the
72 # source tree; Python does not accept the extensions and modules in different
73 # paths
74 build_pylinks:
75         for f in $(nobase_pyexec_PYTHON); do \
76                 [ -e $(builddir)/$$f ] || \
77                         $(LN_S) $(abs_srcdir)/$$f $(builddir)/$$f; \
78         done
79
80 all-local: build_pylinks
81
82 check-local: build_pylinks
83
84 if WITH_COMMON
85 # pkg-config files
86 pkgconfigdir = $(libdir)/pkgconfig
87 pkgconfig_DATA = pygobject-$(PLATFORM_VERSION).pc
88 endif
89
90 # python
91 pyexec_LTLIBRARIES =
92
93 # install pth file.
94
95 EGG_NAME = $(PACKAGE)-$(PACKAGE_VERSION)-py$(PYTHON_VERSION)-$(PLATFORM)
96
97 install-data-local:
98         $(mkinstalldirs) $(DESTDIR)$(pyexecdir)
99         cp $(top_builddir)/PKG-INFO $(DESTDIR)$(pyexecdir)/$(EGG_NAME).egg-info
100 install-exec-local:
101         $(mkinstalldirs) $(DESTDIR)$(pyexecdir)
102 uninstall-local:
103         rm -f $(DESTDIR)$(pyexecdir)/$(EGG_NAME).egg-info
104
105 egg: EGG_TMPDIR:=$(TMPDIR)/$(PACKAGE)-$(PACKAGE_VERSION)
106 egg: $(top_srcdir)/gobject/gobject.la PKG-INFO
107         rm -fr $(EGG_TMPDIR)
108         echo $(EGG_NAME).egg
109         $(MKDIR_P) $(EGG_TMPDIR)
110         $(MKDIR_P) $(EGG_TMPDIR)/EGG-INFO
111         $(MAKE) -C gobject install-pkgpyexecLTLIBRARIES pkgpyexecdir=$(EGG_TMPDIR)
112         rm -fr $(EGG_TMPDIR)/gobject.la
113         $(INSTALL) PKG-INFO $(EGG_TMPDIR)/EGG-INFO
114         echo "gobject.so" >> $(EGG_TMPDIR)/EGG-INFO/native_libs.txt
115         ( echo "gobject" ) >> $(EGG_TMPDIR)/EGG-INFO/top_level.txt
116         cd $(EGG_TMPDIR) && zip -rq $(EGG_NAME).egg .
117         mv $(EGG_TMPDIR)/$(EGG_NAME).egg .
118         rm -fr $(EGG_TMPDIR)
119
120 doc-dist:
121         mkdir pygobject
122         cp -r docs/html/*.html pygobject
123         cp -r docs/html/*.sgml pygobject
124         cp -r docs/html/*.devhelp pygobject
125         cp -r docs/style.css pygobject
126         tar cfz $(PACKAGE)-docs.tar.gz pygobject
127         rm -fr pygobject
128
129 release-news:
130         printf "%-8s%s\n" "$(VERSION)" "`LC_TIME=C date '+%d-%b-%Y'`" > NEWS.tmp
131
132         @echo -e "\n\n\nFor blogging, you can copy&paste this HTML formatted news:"
133         @echo "-------------- 8< -------------"
134         @last=`head -n1 $(top_srcdir)/NEWS | cut -f1 -d' '`; \
135         echo "<ul>"; \
136         for commit in `git rev-list $$last..`; do \
137            data=`git log --format="format:%s%n%an%n%b" $$commit^..$$commit`; \
138            echo "$$data" | perl -e '$$subj = <>; chomp $$subj; $$author = <>; chomp $$author; while (<>) { if (/bugzilla.gnome.org.*id=([0-9]+)/) { $$bug = $$1 }};  print "  <li>$$subj ($$author)"; if ($$bug) { print " (<a href=\"https://bugzilla.gnome.org/show_bug.cgi?id=$$bug\">#$$bug</a>)"; }; print "</li>\n"'; \
139            echo "$$data" | perl -e '$$subj = <>; chomp $$subj; $$author = <>; chomp $$author; while (<>) { if (/bugzilla.gnome.org.*id=([0-9]+)/) { $$bug = $$1 }};  print "        - $$subj ($$author)"; if ($$bug) { print " (#$$bug)"; }; print "\n"' >> NEWS.tmp; \
140         done
141         @echo "</ul>"
142         @echo "-------------- 8< -------------"
143
144         @echo >> NEWS.tmp
145         @cat $(top_srcdir)/NEWS >> NEWS.tmp
146         @mv NEWS.tmp $(top_srcdir)/NEWS
147
148 .PHONY: ChangeLog release-news
149
150 ChangeLog:
151         @echo Creating $@
152         @if test -d "$(srcdir)/.git"; then \
153           (GIT_DIR=$(top_srcdir)/.git $(top_srcdir)/missing --run git log PYGOBJECT_2_17_0^^.. --stat) | fmt --split-only > $@.tmp \
154           && mv -f $@.tmp $@ \
155           || ($(RM) $@.tmp; \
156               echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
157               (test -f $@ || echo git-log is required to generate this file >> $@)); \
158         else \
159           test -f $@ || \
160           (echo A git checkout and git-log is required to generate ChangeLog >&2 && \
161           echo A git checkout and git-log is required to generate this file >> $@); \
162         fi
163
164
165 distclean-local:
166         if test $(srcdir) = .; then :; else \
167             rm -f $(BUILT_EXTRA_DIST); \
168         fi
169
170 dist-hook: $(BUILT_EXTRA_DIST)
171         files='$(BUILT_EXTRA_DIST)'; \
172         for f in $$files; do \
173           if test -f $$f; then d=.; else d=$(srcdir); fi; \
174           rm -f $(distdir)/$$f && cp $$d/$$f $(distdir) || exit 1; done
175
176 # pycheck_subdirs = 
177
178 check-local:
179         @echo "  CHECK  Pyflakes" $(pycheck_dirs)
180         @if type pyflakes >/dev/null 2>&1; then \
181                 (cd $(abs_top_srcdir) && pyflakes $(pycheck_dirs) ); \
182         else echo "skipped, pyflakes not installed"; \
183         fi
184         @if test -z "$$SKIP_PEP8"; then \
185                 echo "  CHECK  PEP8"; \
186                 if type pep8 >/dev/null 2>&1; then \
187                         (cd $(abs_top_srcdir) && pep8 --ignore=E501,E123,E124,E402,E731 --repeat --show-source $(pycheck_dirs) ); \
188                 else echo "skipped, pep8 not installed"; \
189                 fi; \
190         fi
191
192 check.gdb:
193         cd tests && $(MAKE) check.gdb
194
195 check.nemiver:
196         cd tests && $(MAKE) check.nemiver
197
198 check.valgrind:
199         cd tests && $(MAKE) check.valgrind
200
201 check.valgrindlog:
202         cd tests && $(MAKE) check.valgrindlog
203
204 check.valgrindxml:
205         cd tests && $(MAKE) check.valgrindxml
206
207 @GNOME_CODE_COVERAGE_RULES@