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