release 3.27.1
[pygobject.git] / Makefile.am
blobc097d9d36dd01508866465588320c7f9d81085c5
1 # Limit PyFlakes and PEP8 to these directories.
2 pycheck_dirs = examples gi tests pygtkcompat
4 # Part of the gi subdirectory is handled with non-recursive make to avoid
5 # py-compile getting confused between gi/types.py and Python's standard
6 # types module.
7 SUBDIRS = . $(pycheck_dirs)
9 PLATFORM_VERSION = 3.0
11 CLEANFILES = \
12         `find "$(builddir)" -type f -name "*.pyc" -print`
14 EXTRA_DIST = \
15         autogen.sh \
16         pygobject.doap \
17         pygobject-$(PLATFORM_VERSION).pc.in \
18         PKG-INFO \
19         PKG-INFO.in \
20         tools/pygi-convert.sh \
21         m4/python.m4 \
22         m4/introspection.m4 \
23         setup.py \
24         MANIFEST.in \
25         README.rst \
26         docs
28 MAINTAINERCLEANFILES = \
29         $(srcdir)/aclocal.m4 \
30         $(srcdir)/autoscan.log \
31         $(srcdir)/compile \
32         $(srcdir)/config.guess \
33         $(srcdir)/config.h.in \
34         $(srcdir)/config.sub \
35         $(srcdir)/configure.scan \
36         $(srcdir)/depcomp \
37         $(srcdir)/install-sh \
38         $(srcdir)/ltmain.sh \
39         $(srcdir)/missing \
40         $(srcdir)/mkinstalldirs \
41         $(srcdir)/omf.make \
42         $(srcdir)/xmldocs.make \
43         $(srcdir)/gtk-doc.make \
44         $(srcdir)/ChangeLog \
45         $(srcdir)/py-compile \
46         $(srcdir)/m4/libtool.m4 \
47         $(srcdir)/m4/ltoptions.m4 \
48         $(srcdir)/m4/ltsugar.m4 \
49         $(srcdir)/m4/ltversion.m4 \
50         $(srcdir)/m4/lt~obsolete.m4 \
51         `find "$(srcdir)" -type f -name Makefile.in -print` \
52         `find "$(builddir)" -type f -name "*.pyc" -print`
54 BUILT_EXTRA_DIST =              \
55         ChangeLog
57 nobase_pyexec_PYTHON = \
58         gi/__init__.py \
59         gi/types.py \
60         gi/module.py \
61         gi/importer.py \
62         gi/pygtkcompat.py \
63         gi/docstring.py \
64         gi/_constants.py \
65         gi/_propertyhelper.py \
66         gi/_signalhelper.py \
67         gi/_option.py \
68         gi/_error.py \
69         gi/_ossighelper.py
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
80 all-local: build_pylinks
82 check-local: build_pylinks
84 if WITH_COMMON
85 # pkg-config files
86 pkgconfigdir = $(libdir)/pkgconfig
87 pkgconfig_DATA = pygobject-$(PLATFORM_VERSION).pc
88 endif
90 # python
91 pyexec_LTLIBRARIES =
93 EGG_NAME = $(PACKAGE)-$(PACKAGE_VERSION)-py$(PYTHON_VERSION)
94 install-data-local:
95         $(mkinstalldirs) $(DESTDIR)$(pyexecdir)
96         cp $(top_builddir)/PKG-INFO $(DESTDIR)$(pyexecdir)/$(EGG_NAME).egg-info
97 uninstall-local:
98         rm -f $(DESTDIR)$(pyexecdir)/$(EGG_NAME).egg-info
100 release-news:
101         printf "%-8s%s\n" "$(VERSION)" "`LC_TIME=C date '+%d-%b-%Y'`" > NEWS.tmp
103         @echo -e "\n\n\nFor blogging, you can copy&paste this HTML formatted news:"
104         @echo "-------------- 8< -------------"
105         @last=`head -n1 $(top_srcdir)/NEWS | cut -f1 -d' '`; \
106         echo "<ul>"; \
107         for commit in `git rev-list $$last..`; do \
108            data=`git log --format="format:%s%n%an%n%b" $$commit^..$$commit`; \
109            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"'; \
110            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; \
111         done
112         @echo "</ul>"
113         @echo "-------------- 8< -------------"
115         @echo >> NEWS.tmp
116         @cat $(top_srcdir)/NEWS >> NEWS.tmp
117         @mv NEWS.tmp $(top_srcdir)/NEWS
119 .PHONY: ChangeLog release-news
121 ChangeLog:
122         @echo Creating $@
123         @if test -d "$(srcdir)/.git"; then \
124           (GIT_DIR=$(top_srcdir)/.git $(top_srcdir)/missing --run git log PYGOBJECT_2_17_0^^.. --stat) | fmt --split-only > $@.tmp \
125           && mv -f $@.tmp $@ \
126           || ($(RM) $@.tmp; \
127               echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \
128               (test -f $@ || echo git-log is required to generate this file >> $@)); \
129         else \
130           test -f $@ || \
131           (echo A git checkout and git-log is required to generate ChangeLog >&2 && \
132           echo A git checkout and git-log is required to generate this file >> $@); \
133         fi
136 distclean-local:
137         if test $(srcdir) = .; then :; else \
138             rm -f $(BUILT_EXTRA_DIST); \
139         fi
141 dist-hook: $(BUILT_EXTRA_DIST)
142         files='$(BUILT_EXTRA_DIST)'; \
143         for f in $$files; do \
144           if test -f $$f; then d=.; else d=$(srcdir); fi; \
145           rm -f $(distdir)/$$f && cp $$d/$$f $(distdir) || exit 1; done
146         rm -rf "$(distdir)/docs/_build"
148 # pycheck_subdirs = 
150 check.quality:
151         @echo "  CHECK  Pyflakes" $(pycheck_dirs)
152         @if type pyflakes >/dev/null 2>&1; then \
153                 (cd $(abs_top_srcdir) && PYFLAKES_BUILTINS="basestring,long,unicode" pyflakes $(pycheck_dirs) ); \
154         else echo "skipped, pyflakes not installed"; \
155         fi
156         @echo "  CHECK  PEP8";
157         @if type pep8 >/dev/null 2>&1; then \
158                 (cd $(abs_top_srcdir) && pep8 --ignore=E501,E123,E124,E402,E731,E722 --repeat --show-source $(pycheck_dirs) ); \
159         else echo "skipped, pep8 not installed"; \
160         fi
162 check.gdb:
163         cd tests && $(MAKE) check.gdb
165 check.nemiver:
166         cd tests && $(MAKE) check.nemiver
168 check.valgrind:
169         cd tests && $(MAKE) check.valgrind
171 check.valgrindlog:
172         cd tests && $(MAKE) check.valgrindlog
174 check.valgrindxml:
175         cd tests && $(MAKE) check.valgrindxml
177 @CODE_COVERAGE_RULES@