* Don't let the user call methods on the reserved local path - we'll get
[dbus-python-phuang.git] / Makefile.am
blobf687c84ee23debbf5df18b8b3cbf97215c677ef0
1 # the api, doc, include subdirs don't need their own Makefile.am
2 SUBDIRS = _dbus_bindings _dbus_glib_bindings dbus examples test
4 CLEANFILES =
5 EXTRA_DIST = dbus-python.pc.in AUTHORS COPYING ChangeLog \
6              COPYING.LGPL-2.1 COPYING.GPL-2 COPYING.AFL-2.1
7 # miss out the gconf examples for now - they don't work
9 pkgconfigdir = $(libdir)/pkgconfig
10 pkgconfig_DATA = dbus-python.pc
12 dbusincludedir = $(includedir)/dbus-1.0/dbus
13 dbusinclude_HEADERS = include/dbus-python.h
15 python_PYTHON = dbus_bindings.py
17 # === Tests ===
19 cross-test-compile: all
20 cross-test-server:
21         @$(MAKE) -C test cross-test-server
22 cross-test-client:
23         @$(MAKE) -C test cross-test-client
25 # === Documentation ===
27 ChangeLog: always-rebuild
28         @if test -d $(top_srcdir)/.git; then \
29                 if git-log --stat > ChangeLog; then \
30                         : ; \
31                 else \
32                         git-log > Changelog || exit 1; \
33                 fi; \
34         fi
36 TXT_RSTDOCS = doc/tutorial.txt doc/API_CHANGES.txt doc/HACKING.txt
37 RSTDOCS = README NEWS TODO
38 dist_doc_DATA = $(TXT_RSTDOCS) $(RSTDOCS)
40 maintainer-update-website: _maintainer-update-apidocs \
41         _maintainer-update-htmldocs
43 if ENABLE_DOCS
44 _maintainer-update-htmldocs: $(HTML_TXT_RSTDOCS) $(HTML_RSTDOCS)
45         rsync -rtvzPp --chmod=Dg+s,ug+rwX,o=rX doc \
46         $(RSTDOCS) $(HTML_RSTDOCS) \
47         dbus.freedesktop.org:/srv/dbus.freedesktop.org/www/doc/dbus-python/
49 HTML_TXT_RSTDOCS = doc/tutorial.html doc/API_CHANGES.html doc/HACKING.html
50 HTML_RSTDOCS = README.html NEWS.html TODO.html
51 nodist_doc_DATA = $(HTML_TXT_RSTDOCS) $(HTML_RSTDOCS)
53 CLEANFILES += $(nodist_doc_DATA)
55 $(HTML_TXT_RSTDOCS) : %.html: %.txt
56                 $(RST2HTML) $(RST2HTMLFLAGS) $< $@
57 $(HTML_RSTDOCS) : %.html: %
58                 $(RST2HTML) $(RST2HTMLFLAGS) $< $@
59 else
60 _maintainer-update-htmldocs:
61         @echo "*** Not updating the HTML docs on the website - install rst2html"
62         @echo "*** from http://docutils.sourceforge.net/ and configure with "
63         @echo "*** --enable-html-docs"
64 endif
66 if ENABLE_API_DOCS
67 all: api/index.html
69 clean-local:
70         rm -rf api
72 dbus/.doc-needs-rebuild-stamp:
73         $(MAKE) -C dbus
74 _dbus_bindings/_dbus_bindings.la:
75         $(MAKE) -C _dbus_bindings
76 _dbus_glib_bindings/_dbus_glib_bindings.la:
77         $(MAKE) -C _dbus_glib_bindings
79 PWD = `pwd`
80 APIDOC_PYTHONPATH = $(PWD)/$(top_srcdir):$(PWD)/_dbus_bindings/.libs:$(PWD)/_dbus_glib_bindings/.libs
82 api api/index.html: $(python_PYTHON) dbus/.doc-needs-rebuild-stamp \
83                     _dbus_bindings/_dbus_bindings.la \
84                     _dbus_glib_bindings/_dbus_glib_bindings.la
85         rm -rf api
86         mkdir api
87         PYTHONPATH=$(APIDOC_PYTHONPATH) DBUS_PYTHON_NO_DEPRECATED=1 $(PYTHON) -Wignore::DeprecationWarning $(EPYDOC) -o api --html \
88                 --docformat restructuredtext -v \
89                 `find dbus -name '*.py' | grep -v dbus_bindings \
90                         | sed -e 's#/__init__\.py##g' \
91                                 -e 's/\.py\>//g' -e 's#/#.#'g` \
92                 || { rm -rf api; exit 1; }
94 _maintainer-update-apidocs: api
95         rsync -rtvzPp --chmod=Dg+s,ug+rwX,o=rX api/ \
96         dbus.freedesktop.org:/srv/dbus.freedesktop.org/www/doc/dbus-python/api/
97 else
98 _maintainer-update-apidocs:
99         @echo "*** Not updating the API docs on the website - install epydoc 3"
100         @echo "*** alpha (or newer) and configure with --enable-api-docs"
101 endif
103 .PHONY: cross-test-compile cross-test-server cross-test-client \
104         always-rebuild maintainer-update-website \
105         _maintainer-update-apidocs _maintainer-update-htmldocs