client/player: fix printf format string
[platform/upstream/bluez.git] / Makefile.am
1 # SPDX-License-Identifier: GPL-2.0
2 AM_MAKEFLAGS = --no-print-directory
3 AM_CPPFLAGS =
4
5 lib_LTLIBRARIES =
6
7 noinst_LIBRARIES =
8
9 noinst_LTLIBRARIES =
10
11 bin_PROGRAMS =
12
13 noinst_PROGRAMS =
14
15 CLEANFILES =
16
17 EXTRA_DIST =
18
19 libexecdir = @libexecdir@/bluetooth
20 pkglibexecdir = @libexecdir@/bluetooth
21
22 libexec_PROGRAMS =
23
24 pkgincludedir = $(includedir)/bluetooth
25
26 pkginclude_HEADERS =
27
28 AM_CFLAGS = $(MISC_CFLAGS) $(WARNING_CFLAGS) $(UDEV_CFLAGS) $(ell_cflags)
29 AM_LDFLAGS = $(MISC_LDFLAGS)
30
31 confdir = $(sysconfdir)/bluetooth
32 statedir = $(localstatedir)/lib/bluetooth
33
34 if DATAFILES
35 dbusdir = $(DBUS_CONFDIR)/dbus-1/system.d
36 dbus_DATA = src/bluetooth.conf
37
38 conf_DATA =
39 state_DATA =
40 endif
41
42 if SYSTEMD
43 systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
44 systemdsystemunit_DATA = src/bluetooth.service
45
46 dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
47 dbussystembus_DATA = src/org.bluez.service
48 endif
49
50 EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
51
52 plugindir = $(libdir)/bluetooth/plugins
53
54 if MAINTAINER_MODE
55 build_plugindir = $(abs_top_srcdir)/plugins/.libs
56 else
57 build_plugindir = $(plugindir)
58 endif
59
60 if MANPAGES
61 man_MANS =
62 endif
63 manual_pages =
64
65 plugin_LTLIBRARIES =
66
67 lib_sources = lib/bluetooth.c lib/hci.c lib/sdp.c
68 lib_headers = lib/bluetooth.h lib/hci.h lib/hci_lib.h \
69                 lib/sco.h lib/l2cap.h lib/sdp.h lib/sdp_lib.h \
70                 lib/rfcomm.h lib/bnep.h lib/cmtp.h lib/hidp.h
71
72 extra_headers = lib/mgmt.h lib/uuid.h lib/a2mp.h lib/amp.h lib/iso.h
73 extra_sources = lib/uuid.c
74
75 local_headers = $(foreach file,$(lib_headers), lib/bluetooth/$(notdir $(file)))
76
77 BUILT_SOURCES = $(local_headers) $(ell_built_sources) src/builtin.h
78
79 if LIBRARY
80 pkginclude_HEADERS += $(lib_headers)
81
82 lib_LTLIBRARIES += lib/libbluetooth.la
83
84 lib_libbluetooth_la_SOURCES = $(lib_headers) $(lib_sources)
85 lib_libbluetooth_la_LDFLAGS = $(AM_LDFLAGS) -version-info 22:7:19
86 lib_libbluetooth_la_DEPENDENCIES = $(local_headers)
87 endif
88
89 noinst_LTLIBRARIES += lib/libbluetooth-internal.la
90
91 lib_libbluetooth_internal_la_SOURCES = $(lib_headers) $(lib_sources) \
92                                         $(extra_headers) $(extra_sources)
93
94 noinst_LTLIBRARIES += gdbus/libgdbus-internal.la
95
96 gdbus_libgdbus_internal_la_SOURCES = gdbus/gdbus.h \
97                                 gdbus/mainloop.c gdbus/watch.c \
98                                 gdbus/object.c gdbus/client.c gdbus/polkit.c
99
100 if EXTERNAL_ELL
101 ell_cflags = @ELL_CFLAGS@
102 ell_ldadd = @ELL_LIBS@
103 ell_dependencies =
104 ell_built_sources = ell/shared
105 else
106 ell_cflags =
107 ell_ldadd = ell/libell-internal.la
108 ell_dependencies = $(ell_ldadd)
109 ell_built_sources = ell/shared ell/internal ell/ell.h
110
111 noinst_LTLIBRARIES += ell/libell-internal.la
112
113 ell_headers = ell/util.h \
114                         ell/log.h \
115                         ell/queue.h \
116                         ell/hashmap.h \
117                         ell/random.h \
118                         ell/signal.h \
119                         ell/timeout.h \
120                         ell/cipher.h \
121                         ell/checksum.h \
122                         ell/io.h \
123                         ell/idle.h \
124                         ell/main.h \
125                         ell/settings.h \
126                         ell/strv.h \
127                         ell/string.h \
128                         ell/utf8.h \
129                         ell/dbus.h \
130                         ell/dbus-service.h \
131                         ell/dbus-client.h \
132                         ell/key.h \
133                         ell/cert.h \
134                         ell/pem.h \
135                         ell/base64.h \
136                         ell/asn1-private.h \
137                         ell/cert-private.h \
138                         ell/pem-private.h \
139                         ell/uuid.h \
140                         ell/uuid.h \
141                         ell/main-private.h
142
143 ell_sources = ell/private.h ell/missing.h \
144                         ell/util.c \
145                         ell/log.c \
146                         ell/queue.c \
147                         ell/hashmap.c \
148                         ell/random.c \
149                         ell/signal.c \
150                         ell/timeout.c \
151                         ell/io.c \
152                         ell/idle.c \
153                         ell/main.c \
154                         ell/settings.c \
155                         ell/strv.c \
156                         ell/string.c \
157                         ell/cipher.c \
158                         ell/checksum.c \
159                         ell/pem.c \
160                         ell/cert.c \
161                         ell/cert-crypto.c \
162                         ell/key.c \
163                         ell/base64.c \
164                         ell/utf8.c \
165                         ell/dbus-private.h \
166                         ell/dbus.c \
167                         ell/dbus-message.c \
168                         ell/dbus-util.c \
169                         ell/dbus-service.c \
170                         ell/dbus-client.c \
171                         ell/dbus-name-cache.c \
172                         ell/dbus-filter.c \
173                         ell/gvariant-private.h \
174                         ell/gvariant-util.c \
175                         ell/siphash-private.h \
176                         ell/siphash.c \
177                         ell/uuid.c
178
179 ell_shared = ell/useful.h
180
181 ell_libell_internal_la_SOURCES = $(ell_headers) $(ell_sources) $(ell_shared)
182 endif
183
184 CLEANFILES += $(ell_built_sources)
185
186 noinst_LTLIBRARIES += src/libshared-glib.la src/libshared-mainloop.la
187
188 if LIBSHARED_ELL
189 noinst_LTLIBRARIES += src/libshared-ell.la
190 endif
191
192 shared_sources = src/shared/io.h src/shared/timeout.h \
193                         src/shared/queue.h src/shared/queue.c \
194                         src/shared/util.h src/shared/util.c \
195                         src/shared/mgmt.h src/shared/mgmt.c \
196                         src/shared/crypto.h src/shared/crypto.c \
197                         src/shared/ecc.h src/shared/ecc.c \
198                         src/shared/ringbuf.h src/shared/ringbuf.c \
199                         src/shared/tester.h src/shared/tester.c \
200                         src/shared/hci.h src/shared/hci.c \
201                         src/shared/hci-crypto.h src/shared/hci-crypto.c \
202                         src/shared/hfp.h src/shared/hfp.c \
203                         src/shared/uhid.h src/shared/uhid.c \
204                         src/shared/pcap.h src/shared/pcap.c \
205                         src/shared/btsnoop.h src/shared/btsnoop.c \
206                         src/shared/ad.h src/shared/ad.c \
207                         src/shared/att-types.h \
208                         src/shared/att.h src/shared/att.c \
209                         src/shared/gatt-helpers.h src/shared/gatt-helpers.c \
210                         src/shared/gatt-client.h src/shared/gatt-client.c \
211                         src/shared/gatt-server.h src/shared/gatt-server.c \
212                         src/shared/gatt-db.h src/shared/gatt-db.c \
213                         src/shared/gap.h src/shared/gap.c \
214                         src/shared/log.h src/shared/log.c \
215                         src/shared/bap.h src/shared/bap.c src/shared/ascs.h \
216                         src/shared/vcp.c src/shared/vcp.h \
217                         src/shared/lc3.h src/shared/tty.h
218
219 if READLINE
220 shared_sources += src/shared/shell.c src/shared/shell.h
221 endif
222
223 if LIBSHARED_ELL
224 src_libshared_ell_la_SOURCES = $(shared_sources) \
225                                src/shared/io-ell.c \
226                                src/shared/timeout-ell.c \
227                                src/shared/mainloop.h \
228                                src/shared/mainloop-ell.c
229 src_libshared_ell_la_LDFLAGS = $(AM_LDFLAGS)
230 src_libshared_ell_la_CFLAGS = $(AM_CFLAGS)
231 endif
232
233 src_libshared_glib_la_SOURCES = $(shared_sources) \
234                                 src/shared/io-glib.c \
235                                 src/shared/timeout-glib.c \
236                                 src/shared/mainloop-glib.c \
237                                 src/shared/mainloop-notify.h \
238                                 src/shared/mainloop-notify.c
239
240 src_libshared_glib_la_LDFLAGS = $(AM_LDFLAGS)
241 src_libshared_glib_la_CFLAGS = $(AM_CFLAGS)
242
243 src_libshared_mainloop_la_SOURCES = $(shared_sources) \
244                                 src/shared/io-mainloop.c \
245                                 src/shared/timeout-mainloop.c \
246                                 src/shared/mainloop.h src/shared/mainloop.c \
247                                 src/shared/mainloop-notify.h \
248                                 src/shared/mainloop-notify.c
249 src_libshared_mainloop_la_LDFLAGS = $(AM_LDFLAGS)
250 src_libshared_mainloop_la_CFLAGS = $(AM_CFLAGS)
251
252 attrib_sources = attrib/att.h attrib/att-database.h attrib/att.c \
253                 attrib/gatt.h attrib/gatt.c \
254                 attrib/gattrib.h attrib/gattrib.c \
255                 attrib/gatt-service.h attrib/gatt-service.c
256
257 btio_sources = btio/btio.h btio/btio.c
258
259 gobex_sources = gobex/gobex.h gobex/gobex.c \
260                         gobex/gobex-defs.h gobex/gobex-defs.c \
261                         gobex/gobex-packet.c gobex/gobex-packet.h \
262                         gobex/gobex-header.c gobex/gobex-header.h \
263                         gobex/gobex-transfer.c gobex/gobex-debug.h \
264                         gobex/gobex-apparam.c gobex/gobex-apparam.h
265
266 builtin_modules =
267 builtin_sources =
268 builtin_cppflags =
269 builtin_nodist =
270 builtin_ldadd =
271
272 include Makefile.plugins
273
274 if MAINTAINER_MODE
275 plugin_LTLIBRARIES += plugins/external-dummy.la
276 plugins_external_dummy_la_SOURCES = plugins/external-dummy.c
277 plugins_external_dummy_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
278                                     -no-undefined
279 plugins_external_dummy_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden
280 endif
281
282 libexec_PROGRAMS += src/bluetoothd
283
284 src_bluetoothd_SOURCES = $(builtin_sources) \
285                         $(attrib_sources) $(btio_sources) \
286                         src/bluetooth.ver \
287                         src/main.c src/log.h src/log.c src/bluez-log.c \
288                         src/backtrace.h src/backtrace.c \
289                         src/rfkill.c src/btd.h src/sdpd.h \
290                         src/sdpd-server.c src/sdpd-request.c \
291                         src/sdpd-service.c src/sdpd-database.c \
292                         src/attrib-server.h src/attrib-server.c \
293                         src/gatt-database.h src/gatt-database.c \
294                         src/sdp-xml.h src/sdp-xml.c \
295                         src/sdp-client.h src/sdp-client.c \
296                         src/textfile.h src/textfile.c \
297                         src/uuid-helper.h src/uuid-helper.c \
298                         src/plugin.h src/plugin.c \
299                         src/storage.h src/storage.c \
300                         src/advertising.h src/advertising.c \
301                         src/agent.h src/agent.c \
302                         src/error.h src/error.c \
303                         src/adapter.h src/adapter.c \
304                         src/adapter_le_vsc_features.h src/adapter_le_vsc_features.c \
305                         src/profile.h src/profile.c \
306                         src/service.h src/service.c \
307                         src/gatt-client.h src/gatt-client.c \
308                         src/device.h src/device.c \
309                         src/dbus-common.c src/dbus-common.h \
310                         src/eir.h src/eir.c \
311                         src/adv_monitor.h src/adv_monitor.c \
312                         src/battery.h src/battery.c \
313                         src/settings.h src/settings.c
314 src_bluetoothd_LDADD = lib/libbluetooth-internal.la \
315                         gdbus/libgdbus-internal.la \
316                         src/libshared-glib.la \
317                         $(BACKTRACE_LIBS) $(GLIB_LIBS) $(DBUS_LIBS) @LIBXML_LIBS@ @INIPARSER_LIBS@ -ldl -lrt
318                         $(builtin_ldadd)
319 src_bluetoothd_LDFLAGS = $(AM_LDFLAGS) -Wl,--export-dynamic \
320                                 -Wl,--version-script=$(srcdir)/src/bluetooth.ver
321
322 src_bluetoothd_DEPENDENCIES = lib/libbluetooth-internal.la \
323                                 gdbus/libgdbus-internal.la \
324                                 src/libshared-glib.la \
325                                 src/bluetooth.service
326
327 src_bluetoothd_CPPFLAGS = $(AM_CPPFLAGS) -DBLUETOOTH_PLUGIN_BUILTIN \
328                                         -DPLUGINDIR=\""$(build_plugindir)"\" \
329                                         $(BACKTRACE_CFLAGS) $(builtin_cppflags)
330 src_bluetoothd_SHORTNAME = bluetoothd
331
332 builtin_files = src/builtin.h $(builtin_nodist)
333
334 nodist_src_bluetoothd_SOURCES = $(builtin_files)
335
336 CLEANFILES += $(builtin_files) src/bluetooth.service
337
338 if MANPAGES
339 man_MANS += src/bluetoothd.8
340 endif
341 manual_pages += src/bluetoothd.8
342
343 EXTRA_DIST += src/genbuiltin src/bluetooth.conf \
344                         src/main_m.conf src/main_w.conf profiles/network/network.conf \
345                         profiles/input/input.conf profiles/proximity/proximity.conf
346
347 test_scripts =
348 unit_tests =
349
350 include Makefile.tools
351 include Makefile.obexd
352 include android/Makefile.am
353 include Makefile.mesh
354
355 if HID2HCI
356 rulesdir = $(UDEV_DIR)/rules.d
357
358 rules_DATA = tools/97-hid2hci.rules
359
360 CLEANFILES += $(rules_DATA)
361 endif
362
363 EXTRA_DIST += tools/hid2hci.rules
364
365 if TEST
366 testdir = $(pkglibdir)/test
367 test_SCRIPTS = $(test_scripts)
368 endif
369
370 EXTRA_DIST += $(test_scripts)
371
372 EXTRA_DIST += doc/assigned-numbers.txt doc/supported-features.txt \
373                                 doc/test-coverage.txt \
374                                 doc/test-runner.txt \
375                                 doc/settings-storage.txt
376
377 EXTRA_DIST += doc/mgmt-api.txt \
378                 doc/adapter-api.txt doc/device-api.txt \
379                 doc/agent-api.txt doc/profile-api.txt \
380                 doc/network-api.txt doc/media-api.txt \
381                 doc/health-api.txt doc/sap-api.txt \
382                 doc/input-api.txt
383
384 EXTRA_DIST += doc/alert-api.txt \
385                 doc/proximity-api.txt doc/heartrate-api.txt \
386                 doc/thermometer-api.txt doc/cyclingspeed-api.txt \
387                 doc/gatt-api.txt doc/advertising-api.txt
388
389 EXTRA_DIST += doc/obex-api.txt doc/obex-agent-api.txt
390
391 EXTRA_DIST += doc/pics-opp.txt doc/pixit-opp.txt \
392                 doc/pts-opp.txt
393
394 EXTRA_DIST += doc/btsnoop.txt
395
396 EXTRA_DIST += tools/magic.btsnoop
397
398 AM_CFLAGS += @LIBXML_CFLAGS@ @INIPARSER_CFLAGS@
399
400 AM_CPPFLAGS += $(DBUS_CFLAGS) $(GLIB_CFLAGS) -I$(builddir)/lib
401
402 unit_tests += unit/test-tester
403
404 unit_test_tester_SOURCES = unit/test-tester.c
405 unit_test_tester_LDADD = src/libshared-glib.la lib/libbluetooth-internal.la \
406                                                                 $(GLIB_LIBS)
407
408 unit_tests += unit/test-eir
409
410 unit_test_eir_SOURCES = unit/test-eir.c src/eir.c src/uuid-helper.c
411 unit_test_eir_LDADD = src/libshared-glib.la lib/libbluetooth-internal.la \
412                                                                 $(GLIB_LIBS)
413
414 unit_tests += unit/test-uuid
415
416 unit_test_uuid_SOURCES = unit/test-uuid.c
417 unit_test_uuid_LDADD = src/libshared-glib.la lib/libbluetooth-internal.la \
418                                                                 $(GLIB_LIBS)
419
420 unit_tests += unit/test-textfile
421
422 unit_test_textfile_SOURCES = unit/test-textfile.c src/textfile.h src/textfile.c
423 unit_test_textfile_LDADD = src/libshared-glib.la $(GLIB_LIBS)
424
425 unit_tests += unit/test-crc
426
427 unit_test_crc_SOURCES = unit/test-crc.c monitor/crc.h monitor/crc.c
428 unit_test_crc_LDADD = src/libshared-glib.la $(GLIB_LIBS)
429
430 if TIZEN_CRYPTO_TESTS
431 unit_tests += unit/test-crypto
432
433 unit_test_crypto_SOURCES = unit/test-crypto.c
434 unit_test_crypto_LDADD = src/libshared-glib.la @GLIB_LIBS@
435 endif
436
437 unit_tests += unit/test-ecc
438
439 unit_test_ecc_SOURCES = unit/test-ecc.c
440 unit_test_ecc_LDADD = src/libshared-glib.la $(GLIB_LIBS)
441
442 unit_tests += unit/test-ringbuf unit/test-queue
443
444 unit_test_ringbuf_SOURCES = unit/test-ringbuf.c
445 unit_test_ringbuf_LDADD = src/libshared-glib.la $(GLIB_LIBS)
446
447 unit_test_queue_SOURCES = unit/test-queue.c
448 unit_test_queue_LDADD = src/libshared-glib.la $(GLIB_LIBS)
449
450 unit_tests += unit/test-mgmt
451
452 unit_test_mgmt_SOURCES = unit/test-mgmt.c
453 unit_test_mgmt_LDADD = src/libshared-glib.la $(GLIB_LIBS)
454
455 unit_tests += unit/test-uhid
456
457 unit_test_uhid_SOURCES = unit/test-uhid.c
458 unit_test_uhid_LDADD = src/libshared-glib.la $(GLIB_LIBS)
459
460 unit_tests += unit/test-sdp
461
462 unit_test_sdp_SOURCES = unit/test-sdp.c \
463                                 src/sdpd.h src/sdpd-database.c \
464                                 src/log.h src/log.c \
465                                 src/sdpd-service.c src/sdpd-request.c
466 unit_test_sdp_LDADD = lib/libbluetooth-internal.la \
467                                 src/libshared-glib.la $(GLIB_LIBS)
468
469 unit_tests += unit/test-avdtp
470
471 unit_test_avdtp_SOURCES = unit/test-avdtp.c \
472                                 src/log.h src/log.c \
473                                 android/avdtp.c android/avdtp.h
474 unit_test_avdtp_LDADD = src/libshared-glib.la $(GLIB_LIBS)
475
476 unit_tests += unit/test-avctp
477
478 unit_test_avctp_SOURCES = unit/test-avctp.c \
479                                 src/log.h src/log.c \
480                                 android/avctp.c android/avctp.h
481 unit_test_avctp_LDADD = src/libshared-glib.la $(GLIB_LIBS)
482
483 unit_tests += unit/test-avrcp
484
485 unit_test_avrcp_SOURCES = unit/test-avrcp.c \
486                                 src/log.h src/log.c \
487                                 android/avctp.c android/avctp.h \
488                                 android/avrcp-lib.c android/avrcp-lib.h
489 unit_test_avrcp_LDADD = lib/libbluetooth-internal.la \
490                                 src/libshared-glib.la $(GLIB_LIBS)
491
492 unit_tests += unit/test-hfp
493
494 unit_test_hfp_SOURCES = unit/test-hfp.c
495 unit_test_hfp_LDADD = src/libshared-glib.la $(GLIB_LIBS)
496
497 unit_tests += unit/test-gdbus-client
498
499 unit_test_gdbus_client_SOURCES = unit/test-gdbus-client.c
500 unit_test_gdbus_client_LDADD = gdbus/libgdbus-internal.la \
501                                 src/libshared-glib.la $(GLIB_LIBS) $(DBUS_LIBS)
502
503 if OBEX
504 unit_tests += unit/test-gobex-header unit/test-gobex-packet unit/test-gobex \
505                         unit/test-gobex-transfer unit/test-gobex-apparam
506
507 unit_test_gobex_SOURCES = $(gobex_sources) unit/util.c unit/util.h \
508                                                 unit/test-gobex.c
509 unit_test_gobex_LDADD = $(GLIB_LIBS)
510
511 unit_test_gobex_packet_SOURCES = $(gobex_sources) unit/util.c unit/util.h \
512                                                 unit/test-gobex-packet.c
513 unit_test_gobex_packet_LDADD = $(GLIB_LIBS)
514
515 unit_test_gobex_header_SOURCES = $(gobex_sources) unit/util.c unit/util.h \
516                                                 unit/test-gobex-header.c
517 unit_test_gobex_header_LDADD = $(GLIB_LIBS)
518
519 unit_test_gobex_transfer_SOURCES = $(gobex_sources) unit/util.c unit/util.h \
520                                                 unit/test-gobex-transfer.c
521 unit_test_gobex_transfer_LDADD = $(GLIB_LIBS)
522
523 unit_test_gobex_apparam_SOURCES = $(gobex_sources) unit/util.c unit/util.h \
524                                                 unit/test-gobex-apparam.c
525 unit_test_gobex_apparam_LDADD = $(GLIB_LIBS)
526 endif
527
528 unit_tests += unit/test-lib
529
530 unit_test_lib_SOURCES = unit/test-lib.c
531 unit_test_lib_LDADD = src/libshared-glib.la \
532                                 lib/libbluetooth-internal.la $(GLIB_LIBS)
533
534 unit_tests += unit/test-gatt
535
536 unit_test_gatt_SOURCES = unit/test-gatt.c
537 unit_test_gatt_LDADD = src/libshared-glib.la \
538                                 lib/libbluetooth-internal.la $(GLIB_LIBS)
539
540 unit_tests += unit/test-hog
541
542 unit_test_hog_SOURCES = unit/test-hog.c \
543                         $(btio_sources) \
544                         profiles/input/hog-lib.h profiles/input/hog-lib.c \
545                         profiles/scanparam/scpp.h profiles/scanparam/scpp.c \
546                         profiles/battery/bas.h profiles/battery/bas.c \
547                         profiles/deviceinfo/dis.h profiles/deviceinfo/dis.c \
548                         src/log.h src/log.c \
549                         attrib/att.h attrib/att.c \
550                         attrib/gatt.h attrib/gatt.c \
551                         attrib/gattrib.h attrib/gattrib.c
552 unit_test_hog_LDADD = src/libshared-glib.la \
553                                 lib/libbluetooth-internal.la $(GLIB_LIBS)
554
555 unit_tests += unit/test-gattrib
556
557 unit_test_gattrib_SOURCES = unit/test-gattrib.c attrib/gattrib.c \
558                                         $(btio_sources) src/log.h src/log.c src/bluez-log.c
559 unit_test_gattrib_LDADD = lib/libbluetooth-internal.la \
560                         src/libshared-glib.la \
561                         $(GLIB_LIBS) $(DBUS_LIBS) @LIBXML_LIBS@ -ldl -lrt
562
563 if MIDI
564 unit_tests += unit/test-midi
565 unit_test_midi_CPPFLAGS = $(AM_CPPFLAGS) $(ALSA_CFLAGS) -DMIDI_TEST
566 unit_test_midi_SOURCES = unit/test-midi.c \
567                         profiles/midi/libmidi.h \
568                         profiles/midi/libmidi.c
569 unit_test_midi_LDADD = src/libshared-glib.la \
570                         $(GLIB_LIBS) $(ALSA_LIBS)
571 endif
572
573 if MESH
574 unit_tests += unit/test-mesh-crypto
575 unit_test_mesh_crypto_CPPFLAGS = $(ell_cflags)
576 unit_test_mesh_crypto_SOURCES = unit/test-mesh-crypto.c \
577                                mesh/crypto.h ell/internal ell/ell.h \
578                                $(ell_sources)
579 unit_test_mesh_crypto_LDADD = src/libshared-ell.la \
580                        $(ell_ldadd)
581 endif
582
583 if MAINTAINER_MODE
584 noinst_PROGRAMS += $(unit_tests)
585 endif
586
587 TESTS = $(unit_tests)
588 AM_TESTS_ENVIRONMENT = MALLOC_CHECK_=3 MALLOC_PERTURB_=69
589
590 if DBUS_RUN_SESSION
591 AM_TESTS_ENVIRONMENT += dbus-run-session --
592 endif
593
594 if VALGRIND
595 LOG_COMPILER = valgrind --error-exitcode=1 --num-callers=30
596 LOG_FLAGS = --trace-children=yes --leak-check=full --show-reachable=no \
597                 --suppressions=$(srcdir)/tools/valgrind.supp --quiet
598 endif
599
600 pkgconfigdir = $(libdir)/pkgconfig
601
602 if LIBRARY
603 pkgconfig_DATA = lib/bluez.pc
604 endif
605
606 EXTRA_DIST += $(manual_pages) $(patsubst %.1,%.rst, \
607                                 $(patsubst %.8,%.rst,$(manual_pages)))
608
609 DISTCHECK_CONFIGURE_FLAGS = --disable-datafiles --enable-library \
610                                                 --enable-health \
611                                                 --enable-midi \
612                                                 --enable-manpages \
613                                                 --enable-android \
614                                                 --disable-systemd \
615                                                 --disable-udev
616
617 DISTCLEANFILES = $(pkgconfig_DATA) $(unit_tests) $(manual_pages)
618
619 MAINTAINERCLEANFILES = Makefile.in \
620         aclocal.m4 configure config.h.in config.sub config.guess \
621         ltmain.sh depcomp compile missing install-sh mkinstalldirs test-driver
622
623 SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
624                 $(SED) -e 's,@pkglibexecdir\@,$(pkglibexecdir),g' \
625                 < $< > $@
626
627 if RUN_RST2MAN
628 RST2MAN_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
629                         $(RST2MAN) --strict --no-raw \
630                         --no-generator --no-datestamp $< $@
631 else
632 RST2MAN_PROCESS = $(AM_V_GEN)test -f $@ || \
633                 { echo "Generated manual page $@ does not exist"; false; }
634 endif
635
636 %.service: %.service.in Makefile
637         $(SED_PROCESS)
638
639 %.1: %.rst Makefile
640         $(RST2MAN_PROCESS)
641
642 %.8: %.rst Makefile
643         $(RST2MAN_PROCESS)
644
645 src/builtin.h: src/genbuiltin $(builtin_sources)
646         $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
647
648 tools/%.rules:
649         $(AM_V_at)$(MKDIR_P) tools
650         $(AM_V_GEN)cp $(srcdir)/$(subst 97-,,$@) $@
651
652 $(lib_libbluetooth_la_OBJECTS): $(local_headers)
653
654 lib/bluetooth/%.h: lib/%.h
655         $(AM_V_at)$(MKDIR_P) lib/bluetooth
656         $(AM_V_GEN)$(LN_S) -f $(abspath $<) $@
657
658 ell/shared: Makefile
659         $(AM_V_at)$(MKDIR_P) ell
660         $(AM_V_GEN)for f in $(ell_shared) ; do \
661                 if [ ! -f $$f ] ; then \
662                         $(LN_S) -t ell -f $(abs_srcdir)/../ell/$$f ; \
663                 fi \
664         done > $@
665
666 ell/internal: Makefile
667         $(AM_V_at)$(MKDIR_P) ell
668         $(AM_V_GEN)for f in $(ell_headers) $(ell_sources) ; do \
669         if [ ! -f $$f ] ; then \
670                 $(LN_S) -t ell -f $(abs_srcdir)/../ell/$$f ; \
671                 fi \
672         done > $@
673
674 ell/ell.h: Makefile
675         $(AM_V_at)echo -n > $@
676         $(AM_V_GEN)for f in $(ell_headers) ; do \
677                 echo "#include <$$f>" >> $@ ; \
678         done
679
680 maintainer-clean-local:
681         -rm -rf ell
682
683 if COVERAGE
684 clean-coverage:
685         @lcov --directory $(top_builddir) --zerocounters
686         $(RM) -r coverage $(top_builddir)/coverage.info
687
688 coverage: check
689         @lcov --compat-libtool --directory $(top_builddir) --capture \
690                                 --output-file $(top_builddir)/coverage.info
691         $(AM_V_at)$(MKDIR_P) coverage
692         @genhtml -o coverage/ $(top_builddir)/coverage.info
693
694 clean-local: clean-coverage
695         -find $(top_builddir) -name "*.gcno" -delete
696         -find $(top_builddir) -name "*.gcda" -delete
697         $(RM) -r lib/bluetooth
698
699 else
700 clean-local:
701         -find $(top_builddir) -name "*.gcno" -delete
702         -find $(top_builddir) -name "*.gcda" -delete
703         $(RM) -r lib/bluetooth
704 endif