examples: Don't load a main loop when only making blocking calls
[dbus-python-phuang.git] / Makefile.am
blob6f01a1e7ffca7a36ca17602bcd9d3cf9c31ed092
1 # === Miscellaneous ===
3 CLEANFILES =
4 EXTRA_DIST = API_CHANGES.txt dbus-python.pc.in HACKING.txt \
5              AUTHORS COPYING NEWS ChangeLog TODO \
6              doc/tutorial.txt.in \
7              examples/example-async-client.py \
8              examples/example-client.py \
9              examples/example-service.py \
10              examples/example-signal-emitter.py \
11              examples/example-signal-recipient.py \
12              examples/list-system-services.py \
13              test/cross-test-client.py \
14              test/cross-test-server.py \
15              test/crosstest.py \
16              test/run-test.sh \
17              test/run-with-tmp-session-bus.sh \
18              test/test-client.py \
19              test/test-service.py \
20              test/test-signals.py \
21              test/test-standalone.py \
22              test/TestSuitePythonService.service.in \
23              test/tmp-session-bus.conf.in
24 # miss out the gconf examples for now - they don't work
26 pkgconfigdir = $(libdir)/pkgconfig
27 pkgconfig_DATA = dbus-python.pc
29 include_HEADERS = include/dbus-python.h
31 # === Pure Python ===
33 nobase_python_PYTHON = dbus_bindings.py \
34                        dbus/dbus_bindings.py \
35                        dbus/_dbus.py \
36                        dbus/decorators.py \
37                        dbus/exceptions.py \
38                        dbus/_expat_introspect_parser.py \
39                        dbus/glib.py \
40                        dbus/__init__.py \
41                        dbus/lowlevel.py \
42                        dbus/mainloop/__init__.py \
43                        dbus/mainloop/glib.py \
44                        dbus/proxies.py \
45                        dbus/service.py \
46                        dbus/types.py
48 # === Python C extensions ===
50 pyexec_LTLIBRARIES = _dbus_bindings.la _dbus_glib_bindings.la
51 _dbus_bindings_la_CPPFLAGS = -I$(srcdir)/include \
52                              $(DBUS_CFLAGS) \
53                              $(PYTHON_INCLUDES)
54 _dbus_bindings_la_LDFLAGS = -module -avoid-version \
55                          -export-symbols-regex init_dbus_bindings \
56                          $(DBUS_LIBS)
57 _dbus_bindings_la_SOURCES = \
58                             _dbus_bindings/abstract.c \
59                             _dbus_bindings/bus.c \
60                             _dbus_bindings/bytes.c \
61                             _dbus_bindings/conn.c \
62                             _dbus_bindings/conn-internal.h \
63                             _dbus_bindings/conn-methods.c \
64                             _dbus_bindings/containers.c \
65                             _dbus_bindings/dbus_bindings-internal.h \
66                             _dbus_bindings/debug.c \
67                             _dbus_bindings/exceptions.c \
68                             _dbus_bindings/float.c \
69                             _dbus_bindings/generic.c \
70                             _dbus_bindings/int.c \
71                             _dbus_bindings/mainloop.c \
72                             _dbus_bindings/message-append.c \
73                             _dbus_bindings/message.c \
74                             _dbus_bindings/message-get-args.c \
75                             _dbus_bindings/message-internal.h \
76                             _dbus_bindings/module.c \
77                             _dbus_bindings/pending-call.c \
78                             _dbus_bindings/signature.c \
79                             _dbus_bindings/string.c \
80                             _dbus_bindings/types-internal.h \
81                             _dbus_bindings/validation.c \
82                             include/dbus-python.h
84 _dbus_glib_bindings_la_CPPFLAGS = -I$(top_srcdir)/include \
85                                   $(DBUS_CFLAGS) \
86                                   $(DBUS_GLIB_CFLAGS) \
87                                   $(PYTHON_INCLUDES)
88 _dbus_glib_bindings_la_LDFLAGS = -module -avoid-version \
89                          -export-symbols-regex init_dbus_glib_bindings \
90                          $(DBUS_LIBS) $(DBUS_GLIB_LIBS)
91 _dbus_glib_bindings_la_SOURCES = _dbus_glib_bindings/module.c \
92                                  include/dbus-python.h
94 # === Tests ===
96 PWD = `pwd`
97 TESTS_ENVIRONMENT = DBUS_TOP_SRCDIR="$(PWD)/$(top_srcdir)" \
98                     DBUS_TOP_BUILDDIR="$(PWD)" \
99                     DBUS_PYTHON_VERSION='$(PACKAGE_VERSION)' \
100                     PYTHONPATH="$(PWD)/.libs:$(PWD)/$(top_srcdir):$(PWD)/$(top_srcdir)/test" \
101                     PYTHON='$(PYTHON)'
102 TESTS = test/run-test.sh
104 cross-test-compile: all
105 cross-test-server:
106         $(TESTS_ENVIRONMENT) $(PYTHON) $(top_srcdir)/test/cross-test-server.py
107 cross-test-client:
108         $(TESTS_ENVIRONMENT) $(PYTHON) $(top_srcdir)/test/cross-test-client.py
110 # === Documentation ===
112 ChangeLog: always-rebuild
113         @if test -d $(top_srcdir)/.git; then \
114                 if git-log --stat > ChangeLog; then \
115                         : ; \
116                 else \
117                         git-log > Changelog || exit 1; \
118                 fi; \
119         fi
121 TXT_RSTDOCS = doc/tutorial.txt API_CHANGES.txt HACKING.txt
122 RSTDOCS = README NEWS TODO
123 dist_doc_DATA = $(TXT_RSTDOCS) $(RSTDOCS)
125 if ENABLE_DOCS
126 HTML_TXT_RSTDOCS = doc/tutorial.html API_CHANGES.html HACKING.html
127 HTML_RSTDOCS = README.html NEWS.html TODO.html
128 nodist_doc_DATA = $(HTML_TXT_RSTDOCS) $(HTML_RSTDOCS)
130 CLEANFILES += $(nodist_doc_DATA)
132 RST2HTMLFLAGS = --generator --date --time --exit-status=2 \
133                 --cloak-email-addresses --no-raw --no-file-insertion
135 $(HTML_TXT_RSTDOCS) : %.html: %.txt
136                 $(RST2HTML) $(RST2HTMLFLAGS) $< $@
137 $(HTML_RSTDOCS) : %.html: %
138                 $(RST2HTML) $(RST2HTMLFLAGS) $< $@
139 endif
141 if ENABLE_API_DOCS
142 all: api/index.html
144 clean-local:
145         rm -rf api
147 api api/index.html: $(nobase_python_PYTHON) _dbus_bindings.la _dbus_glib_bindings.la
148         rm -rf api
149         mkdir api
150         $(TESTS_ENVIRONMENT) $(EPYDOC) -o api --html \
151                 --docformat restructuredtext -v \
152                 `echo $(nobase_python_PYTHON) \
153                         | sed -e 's#/__init__\.py##g' \
154                                 -e 's/\.py\>//g' -e 's#/#.#'g` \
155         || { rm -rf api; exit 1; }
156 endif
158 .PHONY: cross-test-compile cross-test-server cross-test-client always-rebuild