Makefile.am, test/Makefile.am: Use @abs_top_builddir@, @abs_top_srcdir@
[dbus-python-phuang.git] / Makefile.am
blob56e19d9ba372c9b36ec08f091092ebe8ea867ca9
1 abs_top_srcdir = @abs_top_srcdir@
2 abs_top_builddir = @abs_top_builddir@
4 ACLOCAL_AMFLAGS = -I m4
6 # the api, doc, include subdirs don't need their own Makefile.am
7 SUBDIRS = _dbus_bindings _dbus_glib_bindings dbus examples m4 test tools
9 CLEANFILES =
10 EXTRA_DIST = dbus-python.pc.in AUTHORS COPYING ChangeLog \
11              COPYING.LGPL-2.1 COPYING.GPL-2 COPYING.AFL-2.1
12 # miss out the gconf examples for now - they don't work
14 pkgconfigdir = $(libdir)/pkgconfig
15 pkgconfig_DATA = dbus-python.pc
17 dbusincludedir = $(includedir)/dbus-1.0/dbus
18 dbusinclude_HEADERS = include/dbus-python.h
20 python_PYTHON = dbus_bindings.py
22 # === Tests ===
24 cross-test-compile: all
25 cross-test-server:
26         @$(MAKE) -C test cross-test-server
27 cross-test-client:
28         @$(MAKE) -C test cross-test-client
30 # === Documentation ===
32 dist-hook:
33         chmod u+w $(distdir)/ChangeLog
34         if test -d $(top_srcdir)/.git; then \
35                 if git-log --stat > $(distdir)/ChangeLog; then \
36                         : ; \
37                 else \
38                         git-log > $(distdir)/ChangeLog; \
39                 fi; \
40         fi
42 TXT_RSTDOCS = doc/tutorial.txt doc/API_CHANGES.txt doc/HACKING.txt
43 RSTDOCS = README NEWS TODO
44 dist_doc_DATA = $(TXT_RSTDOCS) $(RSTDOCS)
46 maintainer-update-website: _maintainer-update-apidocs \
47         _maintainer-update-htmldocs
49 if ENABLE_DOCS
50 _maintainer-update-htmldocs: $(HTML_TXT_RSTDOCS) $(HTML_RSTDOCS)
51         rsync -rtvzPp --chmod=Dg+s,ug+rwX,o=rX doc \
52         $(RSTDOCS) $(HTML_RSTDOCS) \
53         dbus.freedesktop.org:/srv/dbus.freedesktop.org/www/doc/dbus-python/
55 HTML_TXT_RSTDOCS = doc/tutorial.html doc/API_CHANGES.html doc/HACKING.html
56 HTML_RSTDOCS = README.html NEWS.html TODO.html
57 nodist_doc_DATA = $(HTML_TXT_RSTDOCS) $(HTML_RSTDOCS)
59 CLEANFILES += $(nodist_doc_DATA)
61 $(HTML_TXT_RSTDOCS) : %.html: %.txt
62         $(INSTALL) -d doc
63         $(RST2HTML) $(RST2HTMLFLAGS) $< $@
64 $(HTML_RSTDOCS) : %.html: %
65         $(RST2HTML) $(RST2HTMLFLAGS) $< $@
66 else
67 _maintainer-update-htmldocs:
68         @echo "*** Not updating the HTML docs on the website - install rst2html"
69         @echo "*** from http://docutils.sourceforge.net/ and configure with "
70         @echo "*** --enable-html-docs"
71 endif
73 if ENABLE_API_DOCS
74 all: api/index.html
76 clean-local:
77         rm -rf api
79 dbus/.doc-needs-rebuild-stamp:
80         $(MAKE) -C dbus
81 _dbus_bindings/_dbus_bindings.la:
82         $(MAKE) -C _dbus_bindings
83 _dbus_glib_bindings/_dbus_glib_bindings.la:
84         $(MAKE) -C _dbus_glib_bindings
86 APIDOC_PYTHONPATH = $(abs_top_srcdir):$(abs_top_builddir)/_dbus_bindings/.libs:$(abs_top_builddir)/_dbus_glib_bindings/.libs
88 api api/index.html: $(python_PYTHON) dbus/.doc-needs-rebuild-stamp \
89                     _dbus_bindings/_dbus_bindings.la \
90                     _dbus_glib_bindings/_dbus_glib_bindings.la
91         rm -rf api
92         mkdir api
93         PYTHONPATH=$(APIDOC_PYTHONPATH) DBUS_PYTHON_NO_DEPRECATED=1 $(PYTHON) -Wignore::DeprecationWarning $(EPYDOC) -o api --html \
94                 --docformat restructuredtext -v \
95                 `find dbus -name '*.py' | grep -v dbus_bindings \
96                         | sed -e 's#/__init__\.py##g' \
97                                 -e 's/\.py\>//g' -e 's#/#.#'g` \
98                 || { rm -rf api; exit 1; }
100 _maintainer-update-apidocs: api
101         rsync -rtvzPp --chmod=Dg+s,ug+rwX,o=rX api/ \
102         dbus.freedesktop.org:/srv/dbus.freedesktop.org/www/doc/dbus-python/api/
103 else
104 _maintainer-update-apidocs:
105         @echo "*** Not updating the API docs on the website - install epydoc 3"
106         @echo "*** alpha (or newer) and configure with --enable-api-docs"
107 endif
109 .PHONY: cross-test-compile cross-test-server cross-test-client \
110         always-rebuild maintainer-update-website \
111         _maintainer-update-apidocs _maintainer-update-htmldocs