xref: /btstack/example/Makefile.inc (revision 755c0732ebd94ff8e946ea8b138fa599ff3146a7)
1
2VPATH += ${BTSTACK_ROOT}/src
3VPATH += ${BTSTACK_ROOT}/src/ble
4VPATH += ${BTSTACK_ROOT}/src/ble/gatt-service
5VPATH += ${BTSTACK_ROOT}/src/classic
6VPATH += ${BTSTACK_ROOT}/src/mesh
7VPATH += ${BTSTACK_ROOT}/src/mesh/gatt-service
8VPATH += ${BTSTACK_ROOT}/example
9VPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/srce
10VPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/srce
11VPATH += ${BTSTACK_ROOT}/3rd-party/hxcmod-player
12VPATH += ${BTSTACK_ROOT}/3rd-party/hxcmod-player
13VPATH += ${BTSTACK_ROOT}/3rd-party/hxcmod-player/mods
14VPATH += ${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/
15VPATH += ${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4
16VPATH += ${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv6
17VPATH += ${BTSTACK_ROOT}/3rd-party/lwip/core/src/netif
18VPATH += ${BTSTACK_ROOT}/3rd-party/lwip/core/src/apps/http
19VPATH += ${BTSTACK_ROOT}/3rd-party/lwip/dhcp-server
20VPATH += ${BTSTACK_ROOT}/3rd-party/md5
21VPATH += ${BTSTACK_ROOT}/3rd-party/micro-ecc
22VPATH += ${BTSTACK_ROOT}/3rd-party/yxml
23VPATH += ${BTSTACK_ROOT}/platform/lwip
24VPATH += ${BTSTACK_ROOT}/platform/lwip/port
25
26
27CFLAGS += -I.
28CFLAGS += -I${BTSTACK_ROOT}/src/ble
29CFLAGS += -I${BTSTACK_ROOT}/src/classic
30CFLAGS += -I${BTSTACK_ROOT}/src/mesh
31CFLAGS += -I${BTSTACK_ROOT}/src
32CFLAGS += -I${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/include
33CFLAGS += -I${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/include
34CFLAGS += -I${BTSTACK_ROOT}/3rd-party/hxcmod-player
35CFLAGS += -I${BTSTACK_ROOT}/3rd-party/lwip/core/src/include/
36CFLAGS += -I${BTSTACK_ROOT}/3rd-party/lwip/dhcp-server
37CFLAGS += -I${BTSTACK_ROOT}/3rd-party/md5
38CFLAGS += -I${BTSTACK_ROOT}/3rd-party/micro-ecc
39CFLAGS += -I${BTSTACK_ROOT}/3rd-party/yxml
40CFLAGS += -I${BTSTACK_ROOT}/platform/lwip
41CFLAGS += -I${BTSTACK_ROOT}/platform/lwip/port
42
43# for CVSD/SBC PLC
44LDFLAGS += -lm
45
46CORE += \
47	btstack_memory.c            \
48	btstack_linked_list.c	    \
49	btstack_memory_pool.c       \
50	btstack_run_loop.c		    \
51	btstack_util.c 	            \
52
53COMMON += \
54	ad_parser.c                 \
55	hci.c			            \
56	hci_cmd.c		            \
57	hci_dump.c		            \
58	hci_event.c                 \
59	hci_event_builder.c         \
60	l2cap.c			            \
61	l2cap_signaling.c	        \
62	btstack_audio.c             \
63	btstack_tlv.c               \
64	btstack_crypto.c            \
65	uECC.c                      \
66	sm.c                        \
67
68CLASSIC ?= \
69	sdp_util.c	                \
70	gatt_sdp.c                  \
71	spp_server.c  				\
72	rfcomm.c	                \
73	bnep.c	                    \
74	sdp_server.c			            \
75	device_id_server.c          \
76
77SDP_CLIENT += \
78	sdp_client.o		        \
79	sdp_client_rfcomm.o		    \
80
81ATT	+= \
82	att_dispatch.c       	    \
83
84GATT_SERVER += \
85	att_db.c 				 	    \
86	att_server.c        	    \
87
88GATT_CLIENT += \
89	gatt_client.c        	    			\
90	battery_service_client.c 				\
91	device_information_service_client.c 	\
92	scan_parameters_service_client.c 	    \
93	hids_client.c 	    					\
94
95PAN += \
96	pan.c \
97
98MBEDTLS = 					\
99	bignum.c 				\
100	ecp.c 					\
101	ecp_curves.c 			\
102	sm_mbedtls_allocator.c  \
103	memory_buffer_alloc.c   \
104	platform.c 				\
105
106
107LWIP_CORE_SRC  = init.c mem.c memp.c netif.c udp.c ip.c pbuf.c inet_chksum.c def.c tcp.c tcp_in.c tcp_out.c timeouts.c sys_arch.c
108LWIP_IPV4_SRC  = acd.c dhcp.c etharp.c icmp.c ip4.c ip4_frag.c ip4_addr.c
109LWIP_NETIF_SRC = ethernet.c
110LWIP_HTTPD = altcp_proxyconnect.c fs.c httpd.c
111LWIP_SRC = ${LWIP_CORE_SRC} ${LWIP_IPV4_SRC} ${LWIP_NETIF_SRC} ${LWIP_HTTPD} dhserver.c
112
113# List of files for Bluedroid SBC codec
114include ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/Makefile.inc
115include ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/Makefile.inc
116
117SBC_CODEC = \
118    ${SBC_DECODER} \
119	btstack_sbc_plc.c \
120	btstack_sbc_decoder_bluedroid.c \
121    ${SBC_ENCODER} \
122	btstack_sbc_encoder_bluedroid.c \
123	hfp_msbc.c \
124	hfp_codec.c \
125    btstack_sbc_bluedroid.c
126
127CVSD_PLC = \
128	btstack_cvsd_plc.c \
129
130AVDTP += \
131	avdtp_util.c           \
132	avdtp.c                \
133	avdtp_initiator.c      \
134	avdtp_acceptor.c       \
135	avdtp_source.c 	       \
136	avdtp_sink.c           \
137	a2dp.c                 \
138	a2dp_source.c          \
139	a2dp_sink.c            \
140	btstack_ring_buffer.c \
141
142AVRCP += \
143	avrcp.c							\
144	avrcp_controller.c				\
145	avrcp_target.c					\
146	avrcp_browsing.c				\
147	avrcp_browsing_controller.c		\
148	avrcp_browsing_target.c			\
149	avrcp_media_item_iterator.c		\
150
151HXCMOD_PLAYER = \
152	hxcmod.c                    \
153	nao-deceased_by_disease.c 	\
154
155MESH = \
156	adv_bearer.c \
157	beacon.c \
158	gatt_bearer.c \
159	mesh.c \
160	mesh_access.c \
161	mesh_configuration_client.c \
162	mesh_configuration_server.c \
163	mesh_crypto.c \
164	mesh_foundation.c \
165	mesh_generic_default_transition_time_client.c \
166	mesh_generic_default_transition_time_server.c \
167	mesh_generic_level_client.c \
168	mesh_generic_level_server.c \
169	mesh_generic_on_off_client.c \
170	mesh_generic_on_off_server.c \
171	mesh_health_server.c \
172	mesh_iv_index_seq_number.c \
173	mesh_keys.c \
174	mesh_lower_transport.c \
175	mesh_network.c \
176	mesh_node.c \
177	mesh_peer.c \
178	mesh_provisioning_service_server.c \
179	mesh_proxy.c \
180	mesh_proxy_service_server.c \
181	mesh_upper_transport.c \
182	mesh_virtual_addresses.c \
183	pb_adv.c \
184	pb_gatt.c \
185	provisioning.c \
186	provisioning_device.c \
187	provisioning_provisioner.c \
188
189# List of General Examples without Bluetooth
190
191EXAMPLES_GENERAL =          \
192	audio_duplex            \
193	led_counter             \
194	mod_player	            \
195	sine_player             \
196
197# List of Examples that only use Bluetooth BR/EDR = Classic
198
199EXAMPLES_CLASSIC_ONLY =     \
200	a2dp_sink_demo          \
201	a2dp_source_demo        \
202	avrcp_browsing_client   \
203	dut_mode_classic        \
204	gap_dedicated_bonding   \
205	gap_inquiry             \
206	gap_link_keys           \
207	hfp_ag_demo             \
208	hfp_hf_demo             \
209	hid_host_demo           \
210	hid_keyboard_demo       \
211	hid_mouse_demo          \
212	hsp_ag_demo             \
213	hsp_hs_demo             \
214	pbap_client_demo        \
215	sdp_bnep_query          \
216	sdp_general_query       \
217	sdp_rfcomm_query        \
218	spp_counter             \
219	spp_streamer            \
220	spp_streamer_client     \
221	ublox_spp_le_counter    \
222
223# List of Examples that only use Bluetooth LE
224
225EXAMPLES_LE_ONLY=           		\
226	ancs_client_demo        		\
227	att_delayed_response    		\
228	gap_le_advertisements   		\
229	gatt_battery_query      		\
230	gatt_browser            		\
231	gatt_counter            		\
232	gatt_device_information_query	\
233	gatt_heart_rate_client  		\
234	gatt_streamer_server    		\
235	hog_boot_host_demo      		\
236	hog_host_demo      		        \
237	hog_keyboard_demo       		\
238	hog_mouse_demo          		\
239	le_credit_based_flow_control_mode_client  		\
240	le_credit_based_flow_control_mode_server  		\
241	le_mitm                 		\
242	le_streamer_client      		\
243	mesh_node_demo          		\
244	nordic_spp_le_counter   		\
245	nordic_spp_le_streamer  		\
246	sm_pairing_central      		\
247	sm_pairing_peripheral   		\
248	ublox_spp_le_counter    		\
249
250# List of Examples that use Bluetooth BR/EDR/LE = Dual Mode
251
252EXAMPLES_DUAL_MODE=         \
253	gatt_counter            \
254	gatt_streamer_server    \
255	spp_and_gatt_counter    \
256	spp_and_gatt_streamer   \
257
258# List of GATT files used by either LE_ONLY or DUAL_MODE examples
259
260EXAMPLES_GATT_FILES =           		\
261	ancs_client_demo.gatt       		\
262	att_delayed_response.gatt   		\
263	gatt_battery_query.gatt     		\
264	gatt_browser.gatt           		\
265	gatt_counter.gatt           		\
266	gatt_device_information_query.gatt 	\
267	gatt_streamer_server.gatt   		\
268	hog_host_demo.gatt          		\
269	hog_keyboard_demo.gatt      		\
270	hog_mouse_demo.gatt         		\
271	le_credit_based_flow_control_mode_server.gatt 		\
272	nordic_spp_le_counter.gatt  		\
273	nordic_spp_le_streamer.gatt 		\
274	sm_pairing_central.gatt     		\
275	sm_pairing_peripheral.gatt  		\
276	spp_and_gatt_counter.gatt   		\
277	spp_and_gatt_streamer.gatt  		\
278	ublox_spp_le_counter.gatt  			\
279
280# .h for .gatt
281EXAMPLES_GATT_H_FILES = $(EXAMPLES_GATT_FILES:.gatt=.h)
282
283# .o for .c
284CORE_OBJ    = $(CORE:.c=.o)
285COMMON_OBJ  = $(COMMON:.c=.o)
286CLASSIC_OBJ  = $(CLASSIC:.c=.o)
287ATT_OBJ     = $(ATT:.c=.o)
288GATT_CLIENT_OBJ = $(GATT_CLIENT:.c=.o)
289GATT_SERVER_OBJ = $(GATT_SERVER:.c=.o)
290PAN_OBJ = $(PAN:.c=.o)
291SBC_DECODER_OBJ  = $(SBC_DECODER:.c=.o)
292SBC_ENCODER_OBJ  = $(SBC_ENCODER:.c=.o)
293SBC_CODEC_OBJ  = $(SBC_CODEC:.c=.o)
294CVSD_PLC_OBJ = $(CVSD_PLC:.c=.o)
295AVDTP_OBJ  = $(AVDTP:.c=.o)
296AVRCP_OBJ  = $(AVRCP:.c=.o)
297HXCMOD_PLAYER_OBJ = $(HXCMOD_PLAYER:.c=.o)
298LWIP_OBJ = $(LWIP_SRC:.c=.o)
299MESH_OBJ = $(MESH:.c=.o)
300
301default_target: all
302
303# compile .gatt descriptions
304%.h: %.gatt
305	python3 ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
306
307# examples
308
309ant_test: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ant_test.c
310	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
311
312sdp_rfcomm_query: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${PAN_OBJ} ${SDP_CLIENT} sdp_rfcomm_query.c
313	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
314
315pbap_client_demo: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} md5.o obex_iterator.o obex_parser.o obex_message_builder.o obex_srm_client.o goep_client.o yxml.o pbap_client.o pbap_client_demo.o
316	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
317
318sdp_general_query: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} sdp_general_query.c
319	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
320
321sdp_bnep_query: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} sdp_bnep_query.c
322	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
323
324spp_counter: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} spp_counter.c
325	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
326
327
328att_delayed_response.o: att_delayed_response.h att_delayed_response.c
329	${CC} ${CFLAGS} -c $(filter-out att_delayed_response.h,$^) -o $@
330
331att_delayed_response: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} att_delayed_response.o
332	${CC} $^ ${LDFLAGS} -o $@
333
334
335hog_keyboard_demo.o: hog_keyboard_demo.h hog_keyboard_demo.c
336	${CC} ${CFLAGS} -c $(filter-out hog_keyboard_demo.h,$^) -o $@
337
338hog_keyboard_demo: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} battery_service_server.o device_information_service_server.o btstack_hid_parser.o hids_device.o btstack_ring_buffer.o hog_keyboard_demo.o
339	${CC} $^ ${LDFLAGS} -o $@
340
341
342hog_mouse_demo.o: hog_mouse_demo.h hog_mouse_demo.c
343	${CC} ${CFLAGS} -c $(filter-out hog_mouse_demo.h,$^) -o $@
344
345hog_mouse_demo: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} battery_service_server.o device_information_service_server.o btstack_hid_parser.o hids_device.o hog_mouse_demo.o
346	${CC} $^ ${LDFLAGS} -o $@
347
348
349hog_boot_host_demo: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} hog_boot_host_demo.o
350	${CC} $^ ${LDFLAGS} -o $@
351
352
353hog_host_demo.o: hog_host_demo.h hog_host_demo.c
354	${CC} ${CFLAGS} -c $(filter-out hog_host_demo.h,$^) -o $@
355
356hog_host_demo: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} btstack_hid_parser.o btstack_hid.o hog_host_demo.o
357	${CC} $^ ${LDFLAGS} -o $@
358
359
360sm_pairing_peripheral.o: sm_pairing_peripheral.h sm_pairing_peripheral.c
361	${CC} ${CFLAGS} -c $(filter-out sm_pairing_peripheral.h,$^) -o $@
362
363sm_pairing_peripheral: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${GATT_CLIENT_OBJ} sm_pairing_peripheral.o
364	${CC} $^ ${LDFLAGS} -o $@
365
366
367sm_pairing_central.o: sm_pairing_central.h sm_pairing_central.c
368	${CC} ${CFLAGS} -c $(filter-out sm_pairing_central.h,$^) -o $@
369
370sm_pairing_central: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${GATT_CLIENT_OBJ} sm_pairing_central.o
371	${CC} $^ ${LDFLAGS} -o $@
372
373
374gatt_counter.o: gatt_counter.h gatt_counter.c
375	${CC} ${CFLAGS} -c $(filter-out gatt_counter.h,$^) -o $@
376
377gatt_counter: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${CLASSIC_OBJ} battery_service_server.o gatt_counter.o
378	${CC} $^ ${LDFLAGS} -o $@
379
380
381gatt_streamer_server.o: gatt_streamer_server.h gatt_streamer_server.c
382	${CC} ${CFLAGS} -c $(filter-out gatt_streamer_server.h,$^) -o $@
383
384gatt_streamer_server: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${CLASSIC_OBJ} gatt_streamer_server.o
385	${CC} $^ ${LDFLAGS} -o $@
386
387
388le_streamer_client: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} le_streamer_client.c
389	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
390
391le_mitm: ${CORE_OBJ} ${COMMON_OBJ} le_mitm.c
392	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
393
394gatt_heart_rate_client: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} gatt_heart_rate_client.c
395	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
396
397
398spp_and_gatt_counter.o: spp_and_gatt_counter.h spp_and_gatt_counter.c
399	${CC} ${CFLAGS} -c $(filter-out spp_and_gatt_counter.h,$^) -o $@
400
401spp_and_gatt_counter: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} spp_and_gatt_counter.o
402	${CC} $^ ${LDFLAGS} -o $@
403
404
405spp_and_gatt_streamer.o: spp_and_gatt_streamer.h spp_and_gatt_streamer.c
406	${CC} ${CFLAGS} -c $(filter-out spp_and_gatt_streamer.h,$^) -o $@
407
408spp_and_gatt_streamer: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} spp_and_gatt_streamer.o
409	${CC} $^ ${LDFLAGS} -o $@
410
411
412spp_streamer: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} spp_streamer.c
413	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
414
415spp_flowcontrol: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} spp_flowcontrol.c
416	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
417
418spp_streamer_client: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} spp_streamer_client.c
419	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
420
421gap_dedicated_bonding: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} gap_dedicated_bonding.c
422	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
423
424gap_inquiry: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} gap_inquiry.c
425	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
426
427gap_link_keys: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} gap_link_keys.c
428	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
429
430panu_demo: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} ${PAN_OBJ} panu_demo.c
431	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
432
433pan_lwip_http_server: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} ${PAN_OBJ} ${LWIP_SRC} btstack_ring_buffer.o bnep_lwip.o pan_lwip_http_server.o
434	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
435
436
437gatt_browser.o: gatt_browser.h gatt_browser.c
438	${CC} ${CFLAGS} -c $(filter-out gatt_browser.h,$^) -o $@
439
440gatt_browser: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} ${GATT_SERVER_OBJ} gatt_browser.o
441	${CC} $^ ${LDFLAGS} -o $@
442
443
444gatt_battery_query.o: gatt_battery_query.h gatt_battery_query.c
445	${CC} ${CFLAGS} -c $(filter-out gatt_battery_query.h,$^) -o $@
446
447gatt_battery_query: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} ${GATT_SERVER_OBJ} gatt_battery_query.o
448	${CC} $^ ${LDFLAGS} -o $@
449
450
451gatt_device_information_query.o: gatt_device_information_query.h gatt_device_information_query.c
452	${CC} ${CFLAGS} -c $(filter-out gatt_device_information_query.h,$^) -o $@
453
454gatt_device_information_query: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} ${GATT_SERVER_OBJ} gatt_device_information_query.o
455	${CC} $^ ${LDFLAGS} -o $@
456
457
458ancs_client_demo.o: ancs_client_demo.h ancs_client_demo.c
459	${CC} ${CFLAGS} -c $(filter-out ancs_client_demo.h,$^) -o $@
460
461ancs_client_demo: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${GATT_CLIENT_OBJ} ancs_client.o ancs_client_demo.o
462	${CC} $^ ${LDFLAGS} -o $@
463
464
465led_counter: ${CORE_OBJ} ${COMMON_OBJ} led_counter.c
466	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
467
468gap_le_advertisements: ${CORE_OBJ} ${COMMON_OBJ}  gap_le_advertisements.c
469	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
470
471hsp_hs_demo: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} ${SBC_CODEC_OBJ} ${CVSD_PLC_OBJ} wav_util.o sco_demo_util.o btstack_ring_buffer.o hsp_hs.o hsp_hs_demo.c
472	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
473
474hsp_ag_demo: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} ${SBC_CODEC_OBJ} ${CVSD_PLC_OBJ} wav_util.o sco_demo_util.o btstack_ring_buffer.o hsp_ag.o hsp_ag_demo.c
475	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
476
477hfp_ag_demo: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} ${SBC_CODEC_OBJ} ${CVSD_PLC_OBJ} wav_util.o sco_demo_util.o btstack_ring_buffer.o hfp.o hfp_gsm_model.o hfp_ag.o hfp_ag_demo.c
478	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
479
480hfp_hf_demo: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} ${SBC_CODEC_OBJ} ${CVSD_PLC_OBJ} wav_util.o sco_demo_util.o btstack_ring_buffer.o hfp.o hfp_hf.o hfp_hf_demo.c
481	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
482
483hid_host_demo: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} btstack_hid_parser.o hid_host.o hid_host_demo.o
484	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
485
486hid_keyboard_demo: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} btstack_ring_buffer.o hid_device.o btstack_hid_parser.o hid_keyboard_demo.o
487	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
488
489hid_mouse_demo: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} btstack_ring_buffer.o hid_device.o btstack_hid_parser.o hid_mouse_demo.o
490	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
491
492a2dp_source_demo: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} ${SBC_CODEC_OBJ} ${AVDTP_OBJ} ${HXCMOD_PLAYER_OBJ} avrcp.o avrcp_controller.o avrcp_target.o a2dp_source_demo.c
493	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
494
495a2dp_sink_demo: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} ${SBC_CODEC_OBJ} ${AVDTP_OBJ} avrcp.o avrcp_controller.o avrcp_target.o avrcp_cover_art_client.o  obex_srm_client.o goep_client.o obex_parser.o obex_message_builder.o btstack_resample.o btstack_sample_rate_compensation.o a2dp_sink_demo.c
496	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
497
498avrcp_browsing_client: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} ${AVRCP_OBJ} ${AVDTP_OBJ} avrcp_browsing_client.c
499	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
500
501dut_mode_classic: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} dut_mode_classic.c
502	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
503
504le_credit_based_flow_control_mode_client: ${CORE_OBJ} ${COMMON_OBJ} le_credit_based_flow_control_mode_client.c
505	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
506
507
508le_credit_based_flow_control_mode_server.o: le_credit_based_flow_control_mode_server.h le_credit_based_flow_control_mode_server.c
509	${CC} ${CFLAGS} -c $(filter-out le_credit_based_flow_control_mode_server.h,$^) -o $@
510
511le_credit_based_flow_control_mode_server: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} le_credit_based_flow_control_mode_server.o
512	${CC} $^ ${LDFLAGS} -o $@
513
514
515mod_player: ${CORE_OBJ} ${COMMON_OBJ} ${HXCMOD_PLAYER_OBJ} btstack_audio.o mod_player.c
516	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
517
518sine_player: ${CORE_OBJ} ${COMMON_OBJ} btstack_audio.o sine_player.c
519	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
520
521audio_duplex: ${CORE_OBJ} ${COMMON_OBJ} btstack_audio.o btstack_ring_buffer.o audio_duplex.c
522	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
523
524
525nordic_spp_le_counter.o: nordic_spp_le_counter.h nordic_spp_le_counter.c
526	${CC} ${CFLAGS} -c $(filter-out nordic_spp_le_counter.h,$^) -o $@
527
528nordic_spp_le_counter: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} nordic_spp_service_server.o nordic_spp_le_counter.o
529	${CC} $^ ${LDFLAGS} -o $@
530
531
532nordic_spp_le_streamer.o: nordic_spp_le_streamer.h nordic_spp_le_streamer.c
533	${CC} ${CFLAGS} -c $(filter-out nordic_spp_le_streamer.h,$^) -o $@
534
535nordic_spp_le_streamer: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} nordic_spp_service_server.o nordic_spp_le_streamer.o
536	${CC} $^ ${LDFLAGS} -o $@
537
538
539ublox_spp_le_counter.o: ublox_spp_le_counter.h ublox_spp_le_counter.c
540	${CC} ${CFLAGS} -c $(filter-out ublox_spp_le_counter.h,$^) -o $@
541
542ublox_spp_le_counter: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} device_information_service_server.o ublox_spp_service_server.o ublox_spp_le_counter.o
543	${CC} $^ ${LDFLAGS} -o $@
544
545
546mesh_node_demo.o: mesh_node_demo.h mesh_node_demo.c
547	${CC} ${CFLAGS} -c $(filter-out mesh_node_demo.h,$^) -o $@
548
549mesh_node_demo:${CORE_OBJ} ${COMMON_OBJ} ${MESH_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_OBJ} mesh_node_demo.o
550	${CC} $^ ${LDFLAGS} -o $@
551
552clean:
553	rm -f ${EXAMPLES} ${EXAMPLES_GATT_H_FILES}
554	rm -f  *.o *.out *.hex *.exe *.wav *.sbc
555	rm -rf *.dSYM
556	rm -rf ${BTSTACK_ROOT}/src/*.o
557	rm -rf ${BTSTACK_ROOT}/src/ble/*.o
558	rm -rf ${BTSTACK_ROOT}/src/ble/gatt-service/*.o
559	rm -rf ${BTSTACK_ROOT}/src/classic/*.o
560	rm -rf ${BTSTACK_ROOT}/example/*.o
561