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