740def3e39f8a4edd41ccaa64c47081005ce0a48
[platform/upstream/dbus.git] / dbus / Makefile.am
1
2 configdir=$(sysconfdir)/dbus-1
3
4 INCLUDES=-I$(top_builddir) -I$(top_srcdir) $(DBUS_CLIENT_CFLAGS) @PIC_CFLAGS@ -DDBUS_COMPILATION        \
5         -DDBUS_MACHINE_UUID_FILE=\""$(localstatedir)/lib/dbus/machine-id"\"             \
6         -DDBUS_SYSTEM_CONFIG_FILE=\""$(configdir)/system.conf"\"                        \
7         -DDBUS_SESSION_CONFIG_FILE=\""$(configdir)/session.conf"\"
8
9 dbusincludedir=$(includedir)/dbus-1.0/dbus
10 dbusarchincludedir=$(libdir)/dbus-1.0/include/dbus
11
12 lib_LTLIBRARIES=libdbus-1.la
13
14 #
15 # Deal with W32 .def and version-info.rc stuff
16 #
17 if DBUS_WIN
18
19 SUFFIXES = rc
20
21 .rc.o:
22         $(WINDRES) $< -o $@
23
24 dbus_res = versioninfo.o
25 dbus_res_ldflag = -Wl,$(dbus_res)
26 no_undefined = -no-undefined
27 export_symbols =
28 export_symvols_internal =
29
30 libdbus_1_la_DEPENDENCIES = $(dbus_res)
31 intllibs =
32
33 else
34 dbus_res =
35 dbus_res_ldflag =
36 no_undefined =
37 ## don't export symbols that start with "_" (we use this
38 ## convention for internal symbols)
39 export_symbols = -export-symbols-regex "^[^_].*"
40 export_symbols_internal =
41
42 intllibs = @LTLIBINTL@
43
44 endif
45
46
47 #
48 # Platform-dependent sources:
49 #
50 if DBUS_WIN
51 DBUS_LIB_arch_sources =                         \
52         dbus-server-win.c                       \
53         dbus-server-win.h
54
55 if DBUS_WINCE
56 wince_source = dbus-sysdeps-wince-glue.h dbus-sysdeps-wince-glue.c
57 else
58 wince_source =
59 endif
60
61 DBUS_SHARED_arch_sources =                      \
62         $(wince_source)                         \
63         dbus-file-win.c                         \
64         dbus-pipe-win.c                         \
65         dbus-sockets-win.h                      \
66         dbus-sysdeps-win.c                      \
67         dbus-sysdeps-win.h                      \
68         dbus-sysdeps-thread-win.c               \
69         dbus-transport-win.c                    \
70         dbus-transport-win.h
71
72 DBUS_UTIL_arch_sources =                        \
73         dbus-sysdeps-util-win.c                 \
74         dbus-spawn-win.c
75 else
76
77 if DBUS_ENABLE_LAUNCHD
78 launchd_source = dbus-server-launchd.h dbus-server-launchd.c
79 else
80 launchd_source =
81 endif
82
83 DBUS_LIB_arch_sources =                         \
84         dbus-uuidgen.c                          \
85         dbus-uuidgen.h                          \
86         dbus-server-unix.c                      \
87         dbus-server-unix.h
88
89 DBUS_SHARED_arch_sources =                      \
90         $(launchd_source)                       \
91         dbus-file-unix.c                        \
92         dbus-pipe-unix.c                        \
93         dbus-sysdeps-unix.c                     \
94         dbus-sysdeps-unix.h                     \
95         dbus-sysdeps-pthread.c                  \
96         dbus-transport-unix.c                   \
97         dbus-transport-unix.h                   \
98         dbus-userdb.c                           \
99         dbus-userdb.h                           \
100         sd-daemon.c                             \
101         sd-daemon.h
102
103 DBUS_UTIL_arch_sources =                        \
104         dbus-sysdeps-util-unix.c                \
105         dbus-userdb-util.c                      \
106         dbus-spawn.c
107 endif
108
109 dbusinclude_HEADERS=                            \
110         dbus.h                                  \
111         dbus-address.h                          \
112         dbus-bus.h                              \
113         dbus-connection.h                       \
114         dbus-errors.h                           \
115         dbus-macros.h                           \
116         dbus-memory.h                           \
117         dbus-message.h                          \
118         dbus-misc.h                             \
119         dbus-pending-call.h                     \
120         dbus-protocol.h                         \
121         dbus-server.h                           \
122         dbus-shared.h                           \
123         dbus-signature.h                        \
124         dbus-threads.h                          \
125         dbus-types.h
126
127
128 nodist_dbusarchinclude_HEADERS=                 \
129         dbus-arch-deps.h
130
131 ### source code that goes in the installed client library
132 ### and is specific to library functionality
133 DBUS_LIB_SOURCES=                               \
134         dbus-address.c                          \
135         dbus-auth.c                             \
136         dbus-auth.h                             \
137         dbus-auth-script.c                      \
138         dbus-auth-script.h                      \
139         dbus-bus.c                              \
140         dbus-connection.c                       \
141         dbus-connection-internal.h              \
142         dbus-credentials.c                      \
143         dbus-credentials.h                      \
144         dbus-errors.c                           \
145         dbus-keyring.c                          \
146         dbus-keyring.h                          \
147         dbus-marshal-header.c                   \
148         dbus-marshal-header.h                   \
149         dbus-marshal-byteswap.c                 \
150         dbus-marshal-byteswap.h                 \
151         dbus-marshal-recursive.c                \
152         dbus-marshal-recursive.h                \
153         dbus-marshal-validate.c                 \
154         dbus-marshal-validate.h                 \
155         dbus-message.c                          \
156         dbus-message-internal.h                 \
157         dbus-message-private.h                  \
158         dbus-misc.c                             \
159         dbus-nonce.h                            \
160         dbus-nonce.c                            \
161         dbus-object-tree.c                      \
162         dbus-object-tree.h                      \
163         dbus-pending-call.c                     \
164         dbus-pending-call-internal.h            \
165         dbus-resources.c                        \
166         dbus-resources.h                        \
167         dbus-server.c                           \
168         dbus-server-debug-pipe.c                \
169         dbus-server-debug-pipe.h                \
170         dbus-server-protected.h                 \
171         dbus-server-socket.c                    \
172         dbus-server-socket.h                    \
173         $(DBUS_LIB_arch_sources)                \
174         dbus-sha.c                              \
175         dbus-sha.h                              \
176         dbus-signature.c                        \
177         dbus-timeout.c                          \
178         dbus-timeout.h                          \
179         dbus-threads-internal.h                 \
180         dbus-threads.c                          \
181         dbus-transport.c                        \
182         dbus-transport.h                        \
183         dbus-transport-protected.h              \
184         dbus-transport-socket.c                 \
185         dbus-transport-socket.h                 \
186         dbus-watch.c                            \
187         dbus-watch.h
188
189 ##      dbus-md5.c                              \
190 ##      dbus-md5.h                              \
191
192 ### source code that goes in the installed client library
193 ### AND is generic utility functionality used by the
194 ### daemon or test programs (all symbols in here should
195 ### be underscore-prefixed)
196 DBUS_SHARED_SOURCES=                            \
197         dbus-dataslot.c                         \
198         dbus-dataslot.h                         \
199         dbus-file.c                 \
200         dbus-file.h                 \
201         dbus-hash.c                             \
202         dbus-hash.h                             \
203         dbus-internals.c                        \
204         dbus-internals.h                        \
205         dbus-list.c                             \
206         dbus-list.h                             \
207         dbus-marshal-basic.c                    \
208         dbus-marshal-basic.h                    \
209         dbus-memory.c                           \
210         dbus-mempool.c                          \
211         dbus-mempool.h                          \
212         dbus-pipe.c                 \
213         dbus-pipe.h                 \
214         dbus-string.c                           \
215         dbus-string.h                           \
216         dbus-string-private.h                   \
217         $(DBUS_SHARED_arch_sources)             \
218         dbus-sysdeps.c                          \
219         dbus-sysdeps.h
220
221 ### source code that is generic utility functionality used
222 ### by the bus daemon or test apps, but is NOT included
223 ### in the D-Bus client library (all symbols in here
224 ### should be underscore-prefixed but don't really need
225 ### to be unless they move to DBUS_SHARED_SOURCES later)
226 DBUS_UTIL_SOURCES=                              \
227         dbus-auth-util.c                        \
228         dbus-credentials-util.c                 \
229         dbus-mainloop.c                         \
230         dbus-mainloop.h                         \
231         dbus-marshal-byteswap-util.c            \
232         dbus-marshal-recursive-util.c           \
233         dbus-marshal-validate-util.c            \
234         dbus-message-factory.c                  \
235         dbus-message-factory.h                  \
236         dbus-message-util.c                     \
237         dbus-shell.c                            \
238         dbus-shell.h                            \
239         $(DBUS_UTIL_arch_sources)               \
240         dbus-spawn.h                            \
241         dbus-string-util.c                      \
242         dbus-sysdeps-util.c                     \
243         dbus-test.c                             \
244         dbus-test.h
245
246 libdbus_1_la_SOURCES=                           \
247         $(DBUS_LIB_SOURCES)                     \
248         $(DBUS_SHARED_SOURCES)
249
250 libdbus_internal_la_SOURCES=                    \
251         $(DBUS_LIB_SOURCES)                     \
252         $(DBUS_SHARED_SOURCES)                  \
253         $(DBUS_UTIL_SOURCES)
254
255 BUILT_SOURCES=$(nodist_dbusarchinclude_HEADERS)
256 EXTRA_DIST=dbus-arch-deps.h.in
257
258 ## this library is the same as libdbus, but exports all the symbols
259 ## and is only used for static linking within the dbus package.
260 noinst_LTLIBRARIES=libdbus-internal.la
261
262 libdbus_1_la_CPPFLAGS= -Ddbus_1_EXPORTS
263 libdbus_1_la_LIBADD= $(DBUS_CLIENT_LIBS)
264 libdbus_1_la_LDFLAGS= $(export_symbols) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -no-undefined @R_DYNAMIC_LDFLAG@ @PIC_LDFLAGS@
265
266 libdbus_internal_la_CPPFLAGS = -DDBUS_STATIC_BUILD
267 libdbus_internal_la_LIBADD=$(DBUS_CLIENT_LIBS)
268 libdbus_internal_la_LDFLAGS=$(export_symbols_internal) @R_DYNAMIC_LDFLAG@
269
270 ## note that TESTS has special meaning (stuff to use in make check)
271 ## so if adding tests not to be run in make check, don't add them to
272 ## TESTS
273 if DBUS_BUILD_TESTS
274 TESTS_ENVIRONMENT=DBUS_TEST_DATA=$(top_builddir)/test/data DBUS_TEST_HOMEDIR=$(top_builddir)/dbus
275 TESTS=dbus-test
276 else
277 TESTS=
278 endif
279
280 ## we use noinst_PROGRAMS not check_PROGRAMS so that we build
281 ## even when not doing "make check"
282 noinst_PROGRAMS=$(TESTS)
283
284 dbus_test_SOURCES=                              \
285         dbus-test-main.c
286
287 dbus_test_LDADD=libdbus-internal.la $(DBUS_TEST_LIBS)
288 dbus_test_LDFLAGS=@R_DYNAMIC_LDFLAG@
289
290 ## mop up the gcov files
291 clean-local:
292         /bin/rm *.bb *.bbg *.da *.gcov .libs/*.da .libs/*.bbg || true
293
294 update-systemd:
295         curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c > sd-daemon.c
296         curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h > sd-daemon.h