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