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