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 20:5:17
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 attrib_sources = attrib/att.h attrib/att-database.h attrib/att.c \
99 attrib/gatt.h attrib/gatt.c \
100 attrib/gattrib.h attrib/gattrib.c \
101 attrib/gatt-service.h attrib/gatt-service.c
103 btio_sources = btio/btio.h btio/btio.c
105 gobex_sources = gobex/gobex.h gobex/gobex.c \
106 gobex/gobex-defs.h gobex/gobex-defs.c \
107 gobex/gobex-packet.c gobex/gobex-packet.h \
108 gobex/gobex-header.c gobex/gobex-header.h \
109 gobex/gobex-transfer.c gobex/gobex-debug.h \
110 gobex/gobex-apparam.c gobex/gobex-apparam.h
116 include Makefile.plugins
119 plugin_LTLIBRARIES += plugins/external-dummy.la
120 plugins_external_dummy_la_SOURCES = plugins/external-dummy.c
121 plugins_external_dummy_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
123 plugins_external_dummy_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden
126 libexec_PROGRAMS += src/bluetoothd
128 src_bluetoothd_SOURCES = $(builtin_sources) \
129 $(attrib_sources) $(btio_sources) \
131 src/main.c src/log.h src/log.c \
132 src/systemd.h src/systemd.c \
133 src/rfkill.c src/hcid.h src/sdpd.h \
134 src/sdpd-server.c src/sdpd-request.c \
135 src/sdpd-service.c src/sdpd-database.c \
136 src/attrib-server.h src/attrib-server.c \
137 src/sdp-xml.h src/sdp-xml.c \
138 src/sdp-client.h src/sdp-client.c \
139 src/textfile.h src/textfile.c \
140 src/uuid-helper.h src/uuid-helper.c \
142 src/plugin.h src/plugin.c \
143 src/storage.h src/storage.c \
144 src/agent.h src/agent.c \
145 src/error.h src/error.c \
146 src/adapter.h src/adapter.c \
147 src/profile.h src/profile.c \
148 src/service.h src/service.c \
149 src/device.h src/device.c src/attio.h \
150 src/dbus-common.c src/dbus-common.h \
151 src/eir.h src/eir.c \
152 src/shared/io.h src/shared/io-glib.c \
153 src/shared/queue.h src/shared/queue.c \
154 src/shared/util.h src/shared/util.c \
155 src/shared/mgmt.h src/shared/mgmt.c
156 src_bluetoothd_LDADD = lib/libbluetooth-internal.la gdbus/libgdbus-internal.la \
157 @GLIB_LIBS@ @DBUS_LIBS@ -ldl -lrt
158 src_bluetoothd_LDFLAGS = $(AM_LDFLAGS) -Wl,--export-dynamic \
159 -Wl,--version-script=$(srcdir)/src/bluetooth.ver
161 src_bluetoothd_DEPENDENCIES = lib/libbluetooth-internal.la \
162 gdbus/libgdbus-internal.la src/bluetooth.service
164 src_bluetoothd_CFLAGS = $(AM_CFLAGS) -DBLUETOOTH_PLUGIN_BUILTIN \
165 -DPLUGINDIR=\""$(build_plugindir)"\"
166 src_bluetoothd_SHORTNAME = bluetoothd
168 builtin_files = src/builtin.h $(builtin_nodist)
170 nodist_src_bluetoothd_SOURCES = $(builtin_files)
172 CLEANFILES += $(builtin_files) src/bluetooth.service
174 man_MANS = src/bluetoothd.8
176 EXTRA_DIST += src/genbuiltin src/bluetooth.conf \
177 src/main.conf profiles/network/network.conf \
178 profiles/input/input.conf profiles/proximity/proximity.conf
182 include Makefile.tools
183 include Makefile.obexd
184 include android/Makefile.am
187 rulesdir = @UDEV_DIR@/rules.d
189 rules_DATA = tools/97-hid2hci.rules
191 CLEANFILES += $(rules_DATA)
194 EXTRA_DIST += tools/hid2hci.rules
197 testdir = $(pkglibdir)/test
198 test_SCRIPTS = $(test_scripts)
201 EXTRA_DIST += $(test_scripts)
203 EXTRA_DIST += doc/assigned-numbers.txt doc/supported-features.txt \
204 doc/test-coverage.txt doc/settings-storage.txt
206 EXTRA_DIST += doc/mgmt-api.txt \
207 doc/adapter-api.txt doc/device-api.txt \
208 doc/agent-api.txt doc/profile-api.txt \
209 doc/network-api.txt doc/media-api.txt \
210 doc/health-api.txt doc/sap-api.txt
212 EXTRA_DIST += doc/alert-api.txt \
213 doc/proximity-api.txt doc/heartrate-api.txt \
214 doc/thermometer-api.txt doc/cyclingspeed-api.txt
216 EXTRA_DIST += doc/obex-api.txt doc/obex-agent-api.txt
218 EXTRA_DIST += tools/magic.btsnoop
220 AM_CFLAGS += @DBUS_CFLAGS@ @GLIB_CFLAGS@
222 AM_CPPFLAGS = -I$(builddir)/lib -I$(builddir)/src -I$(srcdir)/src \
223 -I$(srcdir)/gdbus -I$(srcdir)/btio
226 unit_tests = unit/test-eir unit/test-uuid unit/test-textfile unit/test-crc
228 unit_test_eir_SOURCES = unit/test-eir.c src/eir.c src/uuid-helper.c
229 unit_test_eir_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@
231 unit_test_uuid_SOURCES = unit/test-uuid.c
232 unit_test_uuid_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@
234 unit_test_textfile_SOURCES = unit/test-textfile.c src/textfile.h src/textfile.c
235 unit_test_textfile_LDADD = @GLIB_LIBS@
237 unit_test_crc_SOURCES = unit/test-crc.c monitor/crc.h monitor/crc.c
238 unit_test_crc_LDADD = @GLIB_LIBS@
240 unit_tests += unit/test-mgmt
242 unit_test_mgmt_SOURCES = unit/test-mgmt.c \
243 src/shared/io.h src/shared/io-glib.c \
244 src/shared/queue.h src/shared/queue.c \
245 src/shared/util.h src/shared/util.c \
246 src/shared/mgmt.h src/shared/mgmt.c
247 unit_test_mgmt_LDADD = @GLIB_LIBS@
249 unit_tests += unit/test-sdp
251 unit_test_sdp_SOURCES = unit/test-sdp.c \
252 src/shared/util.h src/shared/util.c \
253 src/sdpd.h src/sdpd-database.c \
254 src/sdpd-service.c src/sdpd-request.c
255 unit_test_sdp_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@
257 unit_tests += unit/test-avdtp
259 unit_test_avdtp_SOURCES = unit/test-avdtp.c \
260 src/shared/util.h src/shared/util.c \
261 src/log.h src/log.c \
262 android/avdtp.c android/avdtp.h
263 unit_test_avdtp_LDADD = @GLIB_LIBS@
265 unit_tests += unit/test-gdbus-client
267 unit_test_gdbus_client_SOURCES = unit/test-gdbus-client.c
268 unit_test_gdbus_client_LDADD = gdbus/libgdbus-internal.la \
269 @GLIB_LIBS@ @DBUS_LIBS@
271 unit_tests += unit/test-gobex-header unit/test-gobex-packet unit/test-gobex \
272 unit/test-gobex-transfer unit/test-gobex-apparam
274 unit_test_gobex_SOURCES = $(gobex_sources) unit/util.c unit/util.h \
276 unit_test_gobex_LDADD = @GLIB_LIBS@
278 unit_test_gobex_packet_SOURCES = $(gobex_sources) unit/util.c unit/util.h \
279 unit/test-gobex-packet.c
280 unit_test_gobex_packet_LDADD = @GLIB_LIBS@
282 unit_test_gobex_header_SOURCES = $(gobex_sources) unit/util.c unit/util.h \
283 unit/test-gobex-header.c
284 unit_test_gobex_header_LDADD = @GLIB_LIBS@
286 unit_test_gobex_transfer_SOURCES = $(gobex_sources) unit/util.c unit/util.h \
287 unit/test-gobex-transfer.c
288 unit_test_gobex_transfer_LDADD = @GLIB_LIBS@
290 unit_test_gobex_apparam_SOURCES = $(gobex_sources) unit/util.c unit/util.h \
291 unit/test-gobex-apparam.c
292 unit_test_gobex_apparam_LDADD = @GLIB_LIBS@
294 unit_tests += unit/test-lib
296 unit_test_lib_SOURCES = unit/test-lib.c
297 unit_test_lib_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@
299 noinst_PROGRAMS += $(unit_tests)
301 TESTS = $(unit_tests)
303 pkgconfigdir = $(libdir)/pkgconfig
306 pkgconfig_DATA = lib/bluez.pc
309 DISTCHECK_CONFIGURE_FLAGS = --disable-datafiles --enable-library \
310 --disable-systemd --disable-udev \
313 DISTCLEANFILES = $(pkgconfig_DATA)
315 MAINTAINERCLEANFILES = Makefile.in \
316 aclocal.m4 configure config.h.in config.sub config.guess \
317 ltmain.sh depcomp compile missing install-sh mkinstalldirs test-driver
319 SED_PROCESS = $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
320 $(SED) -e 's,@libexecdir\@,$(libexecdir),g' \
323 %.service: %.service.in Makefile
326 src/builtin.h: src/genbuiltin $(builtin_sources)
327 $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
330 $(AM_V_GEN)cp $(srcdir)/$(subst 97-,,$@) $@
332 $(lib_libbluetooth_la_OBJECTS): $(local_headers)
334 lib/bluetooth/%.h: lib/%.h
335 $(AM_V_at)$(MKDIR_P) lib/bluetooth
336 $(AM_V_GEN)$(LN_S) -f "$(abs_top_builddir)"/$< $@
339 $(RM) -r lib/bluetooth