2 AM_MAKEFLAGS = --no-print-directory
22 libexecdir = @libexecdir@/bluetooth
26 includedir = @includedir@/bluetooth
30 AM_CFLAGS = $(WARNING_CFLAGS) $(MISC_CFLAGS)
31 AM_LDFLAGS = $(MISC_LDFLAGS)
34 dbusdir = @DBUS_CONFDIR@/dbus-1/system.d
35 dbus_DATA = src/bluetooth.conf
37 confdir = $(sysconfdir)/bluetooth
40 statedir = $(localstatedir)/lib/bluetooth
45 systemdsystemunitdir = @SYSTEMD_SYSTEMUNITDIR@
46 systemdsystemunit_DATA = src/bluetooth.service
48 dbussystembusdir = @DBUS_SYSTEMBUSDIR@
49 dbussystembus_DATA = src/org.bluez.service
52 EXTRA_DIST += src/bluetooth.service.in src/org.bluez.service
54 plugindir = $(libdir)/bluetooth/plugins
57 build_plugindir = $(abs_top_srcdir)/plugins/.libs
59 build_plugindir = $(plugindir)
65 lib_sources = lib/bluetooth.c lib/hci.c lib/sdp.c
66 lib_headers = lib/bluetooth.h lib/hci.h lib/hci_lib.h \
67 lib/sco.h lib/l2cap.h lib/sdp.h lib/sdp_lib.h \
68 lib/rfcomm.h lib/bnep.h lib/cmtp.h lib/hidp.h
70 extra_headers = lib/mgmt.h lib/uuid.h lib/a2mp.h lib/amp.h
71 extra_sources = lib/uuid.c
73 local_headers = $(foreach file,$(lib_headers), lib/bluetooth/$(notdir $(file)))
75 BUILT_SOURCES = $(local_headers) src/builtin.h
78 include_HEADERS += $(lib_headers)
80 lib_LTLIBRARIES += lib/libbluetooth.la
82 lib_libbluetooth_la_SOURCES = $(lib_headers) $(lib_sources)
83 lib_libbluetooth_la_LDFLAGS = $(AM_LDFLAGS) -version-info 21:10:18
84 lib_libbluetooth_la_DEPENDENCIES = $(local_headers)
87 noinst_LTLIBRARIES += lib/libbluetooth-internal.la
89 lib_libbluetooth_internal_la_SOURCES = $(lib_headers) $(lib_sources) \
90 $(extra_headers) $(extra_sources)
92 noinst_LTLIBRARIES += gdbus/libgdbus-internal.la
94 gdbus_libgdbus_internal_la_SOURCES = gdbus/gdbus.h \
95 gdbus/mainloop.c gdbus/watch.c \
96 gdbus/object.c gdbus/client.c gdbus/polkit.c
98 noinst_LTLIBRARIES += src/libshared-glib.la src/libshared-mainloop.la
100 shared_sources = src/shared/io.h src/shared/timeout.h \
101 src/shared/queue.h src/shared/queue.c \
102 src/shared/util.h src/shared/util.c \
103 src/shared/mgmt.h src/shared/mgmt.c \
104 src/shared/crypto.h src/shared/crypto.c \
105 src/shared/ecc.h src/shared/ecc.c \
106 src/shared/ringbuf.h src/shared/ringbuf.c \
107 src/shared/tester.h src/shared/tester.c \
108 src/shared/hci.h src/shared/hci.c \
109 src/shared/hci-crypto.h src/shared/hci-crypto.c \
110 src/shared/hfp.h src/shared/hfp.c \
111 src/shared/uhid.h src/shared/uhid.c \
112 src/shared/pcap.h src/shared/pcap.c \
113 src/shared/btsnoop.h src/shared/btsnoop.c \
114 src/shared/ad.h src/shared/ad.c \
115 src/shared/att-types.h \
116 src/shared/att.h src/shared/att.c \
117 src/shared/gatt-helpers.h src/shared/gatt-helpers.c \
118 src/shared/gatt-client.h src/shared/gatt-client.c \
119 src/shared/gatt-server.h src/shared/gatt-server.c \
120 src/shared/gatt-db.h src/shared/gatt-db.c \
121 src/shared/gap.h src/shared/gap.c
123 src_libshared_glib_la_SOURCES = $(shared_sources) \
124 src/shared/io-glib.c \
125 src/shared/timeout-glib.c
127 src_libshared_mainloop_la_SOURCES = $(shared_sources) \
128 src/shared/io-mainloop.c \
129 src/shared/timeout-mainloop.c \
130 src/shared/mainloop.h src/shared/mainloop.c
132 attrib_sources = attrib/att.h attrib/att-database.h attrib/att.c \
133 attrib/gatt.h attrib/gatt.c \
134 attrib/gattrib.h attrib/gattrib.c \
135 attrib/gatt-service.h attrib/gatt-service.c
137 btio_sources = btio/btio.h btio/btio.c
139 gobex_sources = gobex/gobex.h gobex/gobex.c \
140 gobex/gobex-defs.h gobex/gobex-defs.c \
141 gobex/gobex-packet.c gobex/gobex-packet.h \
142 gobex/gobex-header.c gobex/gobex-header.h \
143 gobex/gobex-transfer.c gobex/gobex-debug.h \
144 gobex/gobex-apparam.c gobex/gobex-apparam.h
150 include Makefile.plugins
153 plugin_LTLIBRARIES += plugins/external-dummy.la
154 plugins_external_dummy_la_SOURCES = plugins/external-dummy.c
155 plugins_external_dummy_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
157 plugins_external_dummy_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden
160 libexec_PROGRAMS += src/bluetoothd
162 src_bluetoothd_SOURCES = $(builtin_sources) \
163 $(attrib_sources) $(btio_sources) \
165 src/main.c src/log.h src/log.c \
166 src/backtrace.h src/backtrace.c \
167 src/systemd.h src/systemd.c \
168 src/rfkill.c src/hcid.h src/sdpd.h \
169 src/sdpd-server.c src/sdpd-request.c \
170 src/sdpd-service.c src/sdpd-database.c \
171 src/attrib-server.h src/attrib-server.c \
172 src/gatt-database.h src/gatt-database.c \
173 src/sdp-xml.h src/sdp-xml.c \
174 src/sdp-client.h src/sdp-client.c \
175 src/textfile.h src/textfile.c \
176 src/uuid-helper.h src/uuid-helper.c \
178 src/plugin.h src/plugin.c \
179 src/storage.h src/storage.c \
180 src/advertising.h src/advertising.c \
181 src/agent.h src/agent.c \
182 src/error.h src/error.c \
183 src/adapter.h src/adapter.c \
184 src/adapter_le_vsc_features.h src/adapter_le_vsc_features.c \
185 src/profile.h src/profile.c \
186 src/service.h src/service.c \
187 src/gatt-client.h src/gatt-client.c \
188 src/device.h src/device.c src/attio.h \
189 src/dbus-common.c src/dbus-common.h \
191 src_bluetoothd_LDADD = lib/libbluetooth-internal.la \
192 gdbus/libgdbus-internal.la \
193 src/libshared-glib.la \
194 @BACKTRACE_LIBS@ @GLIB_LIBS@ @DBUS_LIBS@ -ldl -lrt
195 src_bluetoothd_LDFLAGS = $(AM_LDFLAGS) -Wl,--export-dynamic \
196 -Wl,--version-script=$(srcdir)/src/bluetooth.ver
198 src_bluetoothd_DEPENDENCIES = lib/libbluetooth-internal.la \
199 gdbus/libgdbus-internal.la \
200 src/libshared-glib.la \
201 src/bluetooth.service
203 src_bluetoothd_CFLAGS = $(AM_CFLAGS) -DBLUETOOTH_PLUGIN_BUILTIN \
204 -DPLUGINDIR=\""$(build_plugindir)"\"
205 src_bluetoothd_SHORTNAME = bluetoothd
207 builtin_files = src/builtin.h $(builtin_nodist)
209 nodist_src_bluetoothd_SOURCES = $(builtin_files)
211 CLEANFILES += $(builtin_files) src/bluetooth.service
213 man_MANS = src/bluetoothd.8
216 EXTRA_DIST += src/genbuiltin src/bluetooth.conf \
217 src/main_w.conf profiles/network/network.conf \
218 profiles/input/input.conf profiles/proximity/proximity.conf
220 EXTRA_DIST += src/genbuiltin src/bluetooth.conf \
221 src/main_m.conf profiles/network/network.conf \
222 profiles/input/input.conf profiles/proximity/proximity.conf
228 include Makefile.tools
229 include Makefile.obexd
230 include android/Makefile.am
233 rulesdir = @UDEV_DIR@/rules.d
235 rules_DATA = tools/97-hid2hci.rules
237 CLEANFILES += $(rules_DATA)
240 EXTRA_DIST += tools/hid2hci.rules
243 testdir = $(pkglibdir)/test
244 test_SCRIPTS = $(test_scripts)
247 EXTRA_DIST += $(test_scripts)
249 EXTRA_DIST += doc/assigned-numbers.txt doc/supported-features.txt \
250 doc/test-coverage.txt \
251 doc/test-runner.txt \
252 doc/settings-storage.txt
254 EXTRA_DIST += doc/mgmt-api.txt \
255 doc/adapter-api.txt doc/device-api.txt \
256 doc/agent-api.txt doc/profile-api.txt \
257 doc/network-api.txt doc/media-api.txt \
258 doc/health-api.txt doc/sap-api.txt \
261 EXTRA_DIST += doc/alert-api.txt \
262 doc/proximity-api.txt doc/heartrate-api.txt \
263 doc/thermometer-api.txt doc/cyclingspeed-api.txt \
264 doc/gatt-api.txt doc/advertising-api.txt
266 EXTRA_DIST += doc/obex-api.txt doc/obex-agent-api.txt
268 EXTRA_DIST += doc/pics-opp.txt doc/pixit-opp.txt \
271 EXTRA_DIST += tools/magic.btsnoop
273 AM_CFLAGS += @DBUS_CFLAGS@ @GLIB_CFLAGS@
275 AM_CPPFLAGS = -I$(builddir)/lib
278 unit_tests += unit/test-eir
280 unit_test_eir_SOURCES = unit/test-eir.c src/eir.c src/uuid-helper.c
281 unit_test_eir_LDADD = src/libshared-glib.la lib/libbluetooth-internal.la \
284 unit_tests += unit/test-uuid
286 unit_test_uuid_SOURCES = unit/test-uuid.c
287 unit_test_uuid_LDADD = src/libshared-glib.la lib/libbluetooth-internal.la \
290 unit_tests += unit/test-textfile
292 unit_test_textfile_SOURCES = unit/test-textfile.c src/textfile.h src/textfile.c
293 unit_test_textfile_LDADD = src/libshared-glib.la @GLIB_LIBS@
295 unit_tests += unit/test-crc
297 unit_test_crc_SOURCES = unit/test-crc.c monitor/crc.h monitor/crc.c
298 unit_test_crc_LDADD = src/libshared-glib.la @GLIB_LIBS@
300 unit_tests += unit/test-crypto
302 unit_test_crypto_SOURCES = unit/test-crypto.c
303 unit_test_crypto_LDADD = src/libshared-glib.la @GLIB_LIBS@
305 unit_tests += unit/test-ecc
307 unit_test_ecc_SOURCES = unit/test-ecc.c
308 unit_test_ecc_LDADD = src/libshared-glib.la @GLIB_LIBS@
310 unit_tests += unit/test-ringbuf unit/test-queue
312 unit_test_ringbuf_SOURCES = unit/test-ringbuf.c
313 unit_test_ringbuf_LDADD = src/libshared-glib.la @GLIB_LIBS@
315 unit_test_queue_SOURCES = unit/test-queue.c
316 unit_test_queue_LDADD = src/libshared-glib.la @GLIB_LIBS@
318 unit_tests += unit/test-mgmt
320 unit_test_mgmt_SOURCES = unit/test-mgmt.c
321 unit_test_mgmt_LDADD = src/libshared-glib.la @GLIB_LIBS@
323 unit_tests += unit/test-uhid
325 unit_test_uhid_SOURCES = unit/test-uhid.c
326 unit_test_uhid_LDADD = src/libshared-glib.la @GLIB_LIBS@
328 unit_tests += unit/test-sdp
330 unit_test_sdp_SOURCES = unit/test-sdp.c \
331 src/sdpd.h src/sdpd-database.c \
332 src/log.h src/log.c \
333 src/sdpd-service.c src/sdpd-request.c
334 unit_test_sdp_LDADD = lib/libbluetooth-internal.la \
335 src/libshared-glib.la @GLIB_LIBS@
337 unit_tests += unit/test-avdtp
339 unit_test_avdtp_SOURCES = unit/test-avdtp.c \
340 src/log.h src/log.c \
341 android/avdtp.c android/avdtp.h
342 unit_test_avdtp_LDADD = src/libshared-glib.la @GLIB_LIBS@
344 unit_tests += unit/test-avctp
346 unit_test_avctp_SOURCES = unit/test-avctp.c \
347 src/log.h src/log.c \
348 android/avctp.c android/avctp.h
349 unit_test_avctp_LDADD = src/libshared-glib.la @GLIB_LIBS@
351 unit_tests += unit/test-avrcp
353 unit_test_avrcp_SOURCES = unit/test-avrcp.c \
354 src/log.h src/log.c \
355 android/avctp.c android/avctp.h \
356 android/avrcp-lib.c android/avrcp-lib.h
357 unit_test_avrcp_LDADD = lib/libbluetooth-internal.la \
358 src/libshared-glib.la @GLIB_LIBS@
360 unit_tests += unit/test-hfp
362 unit_test_hfp_SOURCES = unit/test-hfp.c
363 unit_test_hfp_LDADD = src/libshared-glib.la @GLIB_LIBS@
365 unit_tests += unit/test-gdbus-client
367 unit_test_gdbus_client_SOURCES = unit/test-gdbus-client.c
368 unit_test_gdbus_client_LDADD = gdbus/libgdbus-internal.la \
369 src/libshared-glib.la @GLIB_LIBS@ @DBUS_LIBS@
371 unit_tests += unit/test-gobex-header unit/test-gobex-packet unit/test-gobex \
372 unit/test-gobex-transfer unit/test-gobex-apparam
374 unit_test_gobex_SOURCES = $(gobex_sources) unit/util.c unit/util.h \
376 unit_test_gobex_LDADD = @GLIB_LIBS@
378 unit_test_gobex_packet_SOURCES = $(gobex_sources) unit/util.c unit/util.h \
379 unit/test-gobex-packet.c
380 unit_test_gobex_packet_LDADD = @GLIB_LIBS@
382 unit_test_gobex_header_SOURCES = $(gobex_sources) unit/util.c unit/util.h \
383 unit/test-gobex-header.c
384 unit_test_gobex_header_LDADD = @GLIB_LIBS@
386 unit_test_gobex_transfer_SOURCES = $(gobex_sources) unit/util.c unit/util.h \
387 unit/test-gobex-transfer.c
388 unit_test_gobex_transfer_LDADD = @GLIB_LIBS@
390 unit_test_gobex_apparam_SOURCES = $(gobex_sources) unit/util.c unit/util.h \
391 unit/test-gobex-apparam.c
392 unit_test_gobex_apparam_LDADD = @GLIB_LIBS@
394 unit_tests += unit/test-lib
396 unit_test_lib_SOURCES = unit/test-lib.c
397 unit_test_lib_LDADD = src/libshared-glib.la \
398 lib/libbluetooth-internal.la @GLIB_LIBS@
400 unit_tests += unit/test-gatt
402 unit_test_gatt_SOURCES = unit/test-gatt.c
403 unit_test_gatt_LDADD = src/libshared-glib.la \
404 lib/libbluetooth-internal.la @GLIB_LIBS@
406 unit_tests += unit/test-hog
408 unit_test_hog_SOURCES = unit/test-hog.c \
410 profiles/input/hog-lib.h profiles/input/hog-lib.c \
411 profiles/scanparam/scpp.h profiles/scanparam/scpp.c \
412 profiles/battery/bas.h profiles/battery/bas.c \
413 profiles/deviceinfo/dis.h profiles/deviceinfo/dis.c \
414 src/log.h src/log.c \
415 attrib/att.h attrib/att.c \
416 attrib/gatt.h attrib/gatt.c \
417 attrib/gattrib.h attrib/gattrib.c
418 unit_test_hog_LDADD = src/libshared-glib.la \
419 lib/libbluetooth-internal.la @GLIB_LIBS@
421 unit_tests += unit/test-gattrib
423 unit_test_gattrib_SOURCES = unit/test-gattrib.c attrib/gattrib.c $(btio_sources) src/log.h src/log.c
424 unit_test_gattrib_LDADD = lib/libbluetooth-internal.la \
425 src/libshared-glib.la \
426 @GLIB_LIBS@ @DBUS_LIBS@ -ldl -lrt
429 noinst_PROGRAMS += $(unit_tests)
432 TESTS = $(unit_tests)
434 pkgconfigdir = $(libdir)/pkgconfig
437 pkgconfig_DATA = lib/bluez.pc
440 manual_pages = doc/btmon.1
443 dist_noinst_MANS += $(manual_pages)
446 EXTRA_DIST += $(manual_pages:.1=.txt)
448 DISTCHECK_CONFIGURE_FLAGS = --disable-datafiles --enable-library \
450 --disable-systemd --disable-udev
452 DISTCLEANFILES = $(pkgconfig_DATA) $(unit_tests) $(manual_pages)
454 MAINTAINERCLEANFILES = Makefile.in \
455 aclocal.m4 configure config.h.in config.sub config.guess \
456 ltmain.sh depcomp compile missing install-sh mkinstalldirs test-driver
458 SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
459 $(SED) -e 's,@libexecdir\@,$(libexecdir),g' \
462 %.service: %.service.in Makefile
466 $(AM_V_GEN)a2x --doctype manpage --format manpage $(srcdir)/$<
468 src/builtin.h: src/genbuiltin $(builtin_sources)
469 $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
472 $(AM_V_GEN)cp $(srcdir)/$(subst 97-,,$@) $@
474 $(lib_libbluetooth_la_OBJECTS): $(local_headers)
476 lib/bluetooth/%.h: lib/%.h
477 $(AM_V_at)$(MKDIR_P) lib/bluetooth
478 $(AM_V_GEN)$(LN_S) -f "$(abs_top_builddir)"/$< $@
482 @lcov --directory $(top_builddir) --zerocounters
483 $(RM) -r coverage $(top_builddir)/coverage.info
486 @lcov --compat-libtool --directory $(top_builddir) --capture \
487 --output-file $(top_builddir)/coverage.info
488 $(AM_V_at)$(MKDIR_P) coverage
489 @genhtml -o coverage/ $(top_builddir)/coverage.info
491 clean-local: clean-coverage
492 -find $(top_builddir) -name "*.gcno" -delete
493 -find $(top_builddir) -name "*.gcda" -delete
494 $(RM) -r lib/bluetooth
498 -find $(top_builddir) -name "*.gcno" -delete
499 -find $(top_builddir) -name "*.gcda" -delete
500 $(RM) -r lib/bluetooth