summaryrefslogtreecommitdiff
path: root/Makefile.am
blob: 8a5cbdb40694ea36da2b63d2829222628c5d6a17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# the api, doc, include subdirs don't need their own Makefile.am
SUBDIRS = _dbus_bindings _dbus_glib_bindings dbus examples test

CLEANFILES =
EXTRA_DIST = API_CHANGES.txt dbus-python.pc.in HACKING.txt \
	     AUTHORS COPYING NEWS ChangeLog TODO \
	     doc/tutorial.txt.in
# miss out the gconf examples for now - they don't work

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = dbus-python.pc

include_HEADERS = include/dbus-python.h

python_PYTHON = dbus_bindings.py

# === Tests ===

cross-test-compile: all
cross-test-server:
	@$(MAKE) -C test cross-test-server
cross-test-client:
	@$(MAKE) -C test cross-test-client

# === Documentation ===

ChangeLog: always-rebuild
	@if test -d $(top_srcdir)/.git; then \
		if git-log --stat > ChangeLog; then \
			: ; \
		else \
			git-log > Changelog || exit 1; \
		fi; \
	fi

TXT_RSTDOCS = doc/tutorial.txt API_CHANGES.txt HACKING.txt
RSTDOCS = README NEWS TODO
dist_doc_DATA = $(TXT_RSTDOCS) $(RSTDOCS)

if ENABLE_DOCS
HTML_TXT_RSTDOCS = doc/tutorial.html API_CHANGES.html HACKING.html
HTML_RSTDOCS = README.html NEWS.html TODO.html
nodist_doc_DATA = $(HTML_TXT_RSTDOCS) $(HTML_RSTDOCS)

CLEANFILES += $(nodist_doc_DATA)

$(HTML_TXT_RSTDOCS) : %.html: %.txt
		$(RST2HTML) $(RST2HTMLFLAGS) $< $@
$(HTML_RSTDOCS) : %.html: %
		$(RST2HTML) $(RST2HTMLFLAGS) $< $@
endif

if ENABLE_API_DOCS
all: api/index.html

clean-local:
	rm -rf api

dbus/.doc-needs-rebuild-stamp:
	$(MAKE) -C dbus
_dbus_bindings/_dbus_bindings.la:
	$(MAKE) -C _dbus_bindings
_dbus_glib_bindings/_dbus_glib_bindings.la:
	$(MAKE) -C _dbus_glib_bindings

PWD = `pwd`
APIDOC_PYTHONPATH = $(PWD)/$(top_srcdir):$(PWD)/_dbus_bindings/.libs:$(PWD)/_dbus_glib_bindings/.libs

api api/index.html: $(python_PYTHON) dbus/.doc-needs-rebuild-stamp \
		    _dbus_bindings/_dbus_bindings.la \
		    _dbus_glib_bindings/_dbus_glib_bindings.la
	rm -rf api
	mkdir api
	PYTHONPATH=$(APIDOC_PYTHONPATH) $(EPYDOC) -o api --html \
		--docformat restructuredtext -v \
		`find dbus -name '*.py' \
			| sed -e 's#/__init__\.py##g' \
				-e 's/\.py\>//g' -e 's#/#.#'g` \
	|| { rm -rf api; exit 1; }
endif

.PHONY: cross-test-compile cross-test-server cross-test-client always-rebuild