Make sure extensions are built before docs; get rid of strange inter-directory dependency
[dbus-python-phuang.git] / Makefile.am
blob1dab1e385611c6189d25b77d18984bea48e19ad0
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 # the dbus subdir is handled with non-recursive make because of #12741
8 SUBDIRS = _dbus_bindings _dbus_glib_bindings examples m4 test tools .
10 CLEANFILES =
11 EXTRA_DIST = \
12         dbus-python.pc.in \
13         AUTHORS \
14         COPYING \
15         ChangeLog \
16         COPYING.GPL-2 \
17         COPYING.AFL-2.1
18 # miss out the gconf examples for now - they don't work
20 # === dbus package ===
22 nobase_python_PYTHON = \
23     dbus_bindings.py \
24     dbus/bus.py \
25     dbus/connection.py \
26     dbus/dbus_bindings.py \
27     dbus/_dbus.py \
28     dbus/_version.py \
29     dbus/decorators.py \
30     dbus/exceptions.py \
31     dbus/_expat_introspect_parser.py \
32     dbus/glib.py \
33     dbus/gobject_service.py \
34     dbus/__init__.py \
35     dbus/lowlevel.py \
36     dbus/mainloop/__init__.py \
37     dbus/mainloop/glib.py \
38     dbus/proxies.py \
39     dbus/service.py \
40     dbus/types.py
42 check_py_sources = $(nobase_python_PYTHON)
43 include $(top_srcdir)/tools/check-coding-style.mk
45 # === Devel stuff ===
47 pkgconfigdir = $(libdir)/pkgconfig
48 pkgconfig_DATA = dbus-python.pc
50 dbusincludedir = $(includedir)/dbus-1.0/dbus
51 dbusinclude_HEADERS = include/dbus-python.h
53 # === Tests ===
55 cross-test-compile: all
56 cross-test-server:
57         @$(MAKE) -C test cross-test-server
58 cross-test-client:
59         @$(MAKE) -C test cross-test-client
61 # === Documentation ===
63 dist-hook:
64         chmod u+w $(distdir)/ChangeLog
65         if test -d $(top_srcdir)/.git; then \
66                 if git-log --stat > $(distdir)/ChangeLog; then \
67                         : ; \
68                 else \
69                         git-log > $(distdir)/ChangeLog; \
70                 fi; \
71         fi
73 TXT_RSTDOCS = doc/tutorial.txt doc/API_CHANGES.txt doc/HACKING.txt
74 RSTDOCS = README NEWS TODO
75 dist_doc_DATA = $(TXT_RSTDOCS) $(RSTDOCS)
77 maintainer-update-website: _maintainer-update-apidocs \
78         _maintainer-update-htmldocs
80 if ENABLE_DOCS
81 _maintainer-update-htmldocs: $(HTML_TXT_RSTDOCS) $(HTML_RSTDOCS)
82         rsync -rtvzPp --chmod=Dg+s,ug+rwX,o=rX doc \
83         $(RSTDOCS) $(HTML_RSTDOCS) \
84         dbus.freedesktop.org:/srv/dbus.freedesktop.org/www/doc/dbus-python/
86 HTML_TXT_RSTDOCS = doc/tutorial.html doc/API_CHANGES.html doc/HACKING.html
87 HTML_RSTDOCS = README.html NEWS.html TODO.html
88 nodist_doc_DATA = $(HTML_TXT_RSTDOCS) $(HTML_RSTDOCS)
90 CLEANFILES += $(nodist_doc_DATA)
92 $(HTML_TXT_RSTDOCS) : %.html: %.txt
93         $(INSTALL) -d doc
94         $(RST2HTML) $(RST2HTMLFLAGS) $< $@
95 $(HTML_RSTDOCS) : %.html: %
96         $(RST2HTML) $(RST2HTMLFLAGS) $< $@
97 else
98 _maintainer-update-htmldocs:
99         @echo "*** Not updating the HTML docs on the website - install rst2html"
100         @echo "*** from http://docutils.sourceforge.net/ and configure with "
101         @echo "*** --enable-html-docs"
102 endif
104 if ENABLE_API_DOCS
105 all: api/index.html
107 clean-local:
108         rm -rf api
110 APIDOC_PYTHONPATH = $(abs_top_srcdir):$(abs_top_builddir)/_dbus_bindings/.libs:$(abs_top_builddir)/_dbus_glib_bindings/.libs
112 api api/index.html: $(nobase_python_PYTHON) \
113                     _dbus_bindings/_dbus_bindings.la \
114                     _dbus_glib_bindings/_dbus_glib_bindings.la
115         rm -rf api
116         mkdir api
117         PYTHONPATH=$(APIDOC_PYTHONPATH) DBUS_PYTHON_NO_DEPRECATED=1 $(PYTHON) -Wignore::DeprecationWarning $(EPYDOC) -o api --html \
118                 --docformat restructuredtext -v \
119                 `find dbus -name '*.py' | grep -v dbus_bindings \
120                         | sed -e 's#/__init__\.py##g' \
121                                 -e 's/\.py\>//g' -e 's#/#.#'g` \
122                 || { rm -rf api; exit 1; }
124 _maintainer-update-apidocs: api
125         rsync -rtvzPp --chmod=Dg+s,ug+rwX,o=rX api/ \
126         dbus.freedesktop.org:/srv/dbus.freedesktop.org/www/doc/dbus-python/api/
127 else
128 _maintainer-update-apidocs:
129         @echo "*** Not updating the API docs on the website - install epydoc 3"
130         @echo "*** alpha (or newer) and configure with --enable-api-docs"
131 endif
133 .PHONY: cross-test-compile cross-test-server cross-test-client \
134         always-rebuild maintainer-update-website \
135         _maintainer-update-apidocs _maintainer-update-htmldocs