Add Makefile target maintainer-update-website to update d.fd.o/doc/dbus-python
[dbus-python-phuang.git] / Makefile.am
blob8ca34f22e0d0a5ad9b111811d8510b960939879a
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 = API_CHANGES.txt dbus-python.pc.in HACKING.txt \
6              AUTHORS COPYING NEWS ChangeLog TODO \
7              doc/tutorial.txt.in
8 # miss out the gconf examples for now - they don't work
10 pkgconfigdir = $(libdir)/pkgconfig
11 pkgconfig_DATA = dbus-python.pc
13 dbusincludedir = $(includedir)/dbus-1.0/dbus
14 dbusinclude_HEADERS = include/dbus-python.h
16 python_PYTHON = dbus_bindings.py
18 # === Tests ===
20 cross-test-compile: all
21 cross-test-server:
22         @$(MAKE) -C test cross-test-server
23 cross-test-client:
24         @$(MAKE) -C test cross-test-client
26 # === Documentation ===
28 ChangeLog: always-rebuild
29         @if test -d $(top_srcdir)/.git; then \
30                 if git-log --stat > ChangeLog; then \
31                         : ; \
32                 else \
33                         git-log > Changelog || exit 1; \
34                 fi; \
35         fi
37 TXT_RSTDOCS = doc/tutorial.txt doc/API_CHANGES.txt doc/HACKING.txt
38 RSTDOCS = README NEWS TODO
39 dist_doc_DATA = $(TXT_RSTDOCS) $(RSTDOCS)
41 maintainer-update-website: _maintainer-update-apidocs \
42         _maintainer-update-htmldocs
44 if ENABLE_DOCS
45 _maintainer-update-htmldocs: $(HTML_TXT_RSTDOCS) $(HTML_RSTDOCS)
46         rsync -rtvzPp --chmod=Dg+s,ug+rwX,o=rX doc \
47         $(RSTDOCS) $(HTML_RSTDOCS) \
48         dbus.freedesktop.org:/srv/dbus.freedesktop.org/www/doc/dbus-python/
50 HTML_TXT_RSTDOCS = doc/tutorial.html doc/API_CHANGES.html doc/HACKING.html
51 HTML_RSTDOCS = README.html NEWS.html TODO.html
52 nodist_doc_DATA = $(HTML_TXT_RSTDOCS) $(HTML_RSTDOCS)
54 CLEANFILES += $(nodist_doc_DATA)
56 $(HTML_TXT_RSTDOCS) : %.html: %.txt
57                 $(RST2HTML) $(RST2HTMLFLAGS) $< $@
58 $(HTML_RSTDOCS) : %.html: %
59                 $(RST2HTML) $(RST2HTMLFLAGS) $< $@
60 else
61 _maintainer-update-htmldocs:
62         @echo "*** Not updating the HTML docs on the website - install rst2html"
63         @echo "*** from http://docutils.sourceforge.net/ and configure with "
64         @echo "*** --enable-html-docs"
65 endif
67 if ENABLE_API_DOCS
68 all: api/index.html
70 clean-local:
71         rm -rf api
73 dbus/.doc-needs-rebuild-stamp:
74         $(MAKE) -C dbus
75 _dbus_bindings/_dbus_bindings.la:
76         $(MAKE) -C _dbus_bindings
77 _dbus_glib_bindings/_dbus_glib_bindings.la:
78         $(MAKE) -C _dbus_glib_bindings
80 PWD = `pwd`
81 APIDOC_PYTHONPATH = $(PWD)/$(top_srcdir):$(PWD)/_dbus_bindings/.libs:$(PWD)/_dbus_glib_bindings/.libs
83 api api/index.html: $(python_PYTHON) dbus/.doc-needs-rebuild-stamp \
84                     _dbus_bindings/_dbus_bindings.la \
85                     _dbus_glib_bindings/_dbus_glib_bindings.la
86         rm -rf api
87         mkdir api
88         PYTHONPATH=$(APIDOC_PYTHONPATH) DBUS_PYTHON_NO_DEPRECATED=1 $(PYTHON) -Wignore::DeprecationWarning $(EPYDOC) -o api --html \
89                 --docformat restructuredtext -v \
90                 `find dbus -name '*.py' | grep -v dbus_bindings \
91                         | sed -e 's#/__init__\.py##g' \
92                                 -e 's/\.py\>//g' -e 's#/#.#'g` \
93                 || { rm -rf api; exit 1; }
95 _maintainer-update-apidocs: api
96         rsync -rtvzPp --chmod=Dg+s,ug+rwX,o=rX api/ \
97         dbus.freedesktop.org:/srv/dbus.freedesktop.org/www/doc/dbus-python/api/
98 else
99 _maintainer-update-apidocs:
100         @echo "*** Not updating the API docs on the website - install epydoc 3"
101         @echo "*** alpha (or newer) and configure with --enable-api-docs"
102 endif
104 .PHONY: cross-test-compile cross-test-server cross-test-client \
105         always-rebuild maintainer-update-website \
106         _maintainer-update-apidocs _maintainer-update-htmldocs