xref: /btstack/example/Makefile.inc (revision e54a3bca5d33ee0e65d314c9513f358064739602)
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	gatt_service_client.c   	    			\
91	battery_service_client.c 				\
92	device_information_service_client.c 	\
93	scan_parameters_service_client.c 	    \
94	hids_client.c 	    					\
95
96PAN += \
97	pan.c \
98
99MBEDTLS = 					\
100	bignum.c 				\
101	ecp.c 					\
102	ecp_curves.c 			\
103	sm_mbedtls_allocator.c  \
104	memory_buffer_alloc.c   \
105	platform.c 				\
106
107
108LWIP_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
109LWIP_IPV4_SRC  = acd.c dhcp.c etharp.c icmp.c ip4.c ip4_frag.c ip4_addr.c
110LWIP_NETIF_SRC = ethernet.c
111LWIP_HTTPD = altcp_proxyconnect.c fs.c httpd.c
112LWIP_SRC = ${LWIP_CORE_SRC} ${LWIP_IPV4_SRC} ${LWIP_NETIF_SRC} ${LWIP_HTTPD} dhserver.c
113
114# List of files for Bluedroid SBC codec
115include ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/Makefile.inc
116include ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/Makefile.inc
117
118SBC_CODEC = \
119    ${SBC_DECODER} \
120	btstack_sbc_plc.c \
121	btstack_sbc_decoder_bluedroid.c \
122    ${SBC_ENCODER} \
123	btstack_sbc_encoder_bluedroid.c \
124	hfp_msbc.c \
125	hfp_codec.c \
126    btstack_sbc_bluedroid.c
127
128CVSD_PLC = \
129	btstack_cvsd_plc.c \
130
131AVDTP += \
132	avdtp_util.c           \
133	avdtp.c                \
134	avdtp_initiator.c      \
135	avdtp_acceptor.c       \
136	avdtp_source.c 	       \
137	avdtp_sink.c           \
138	a2dp.c                 \
139	a2dp_source.c          \
140	a2dp_sink.c            \
141	btstack_ring_buffer.c \
142
143AVRCP += \
144	avrcp.c							\
145	avrcp_controller.c				\
146	avrcp_target.c					\
147	avrcp_browsing.c				\
148	avrcp_browsing_controller.c		\
149	avrcp_browsing_target.c			\
150	avrcp_media_item_iterator.c		\
151
152HXCMOD_PLAYER = \
153	hxcmod.c                    \
154	nao-deceased_by_disease.c 	\
155
156MESH = \
157	adv_bearer.c \
158	beacon.c \
159	gatt_bearer.c \
160	mesh.c \
161	mesh_access.c \
162	mesh_configuration_client.c \
163	mesh_configuration_server.c \
164	mesh_crypto.c \
165	mesh_foundation.c \
166	mesh_generic_default_transition_time_client.c \
167	mesh_generic_default_transition_time_server.c \
168	mesh_generic_level_client.c \
169	mesh_generic_level_server.c \
170	mesh_generic_on_off_client.c \
171	mesh_generic_on_off_server.c \
172	mesh_health_server.c \
173	mesh_iv_index_seq_number.c \
174	mesh_keys.c \
175	mesh_lower_transport.c \
176	mesh_network.c \
177	mesh_node.c \
178	mesh_peer.c \
179	mesh_provisioning_service_server.c \
180	mesh_proxy.c \
181	mesh_proxy_service_server.c \
182	mesh_upper_transport.c \
183	mesh_virtual_addresses.c \
184	pb_adv.c \
185	pb_gatt.c \
186	provisioning.c \
187	provisioning_device.c \
188	provisioning_provisioner.c \
189
190# List of General Examples without Bluetooth
191
192EXAMPLES_GENERAL =          \
193	audio_duplex            \
194	led_counter             \
195	mod_player	            \
196	sine_player             \
197
198# List of Examples that only use Bluetooth BR/EDR = Classic
199
200EXAMPLES_CLASSIC_ONLY =     \
201	a2dp_sink_demo          \
202	a2dp_source_demo        \
203	avrcp_browsing_client   \
204	dut_mode_classic        \
205	gap_dedicated_bonding   \
206	gap_inquiry             \
207	gap_link_keys           \
208	hfp_ag_demo             \
209	hfp_hf_demo             \
210	hid_host_demo           \
211	hid_keyboard_demo       \
212	hid_mouse_demo          \
213	hsp_ag_demo             \
214	hsp_hs_demo             \
215	pbap_client_demo        \
216	sdp_bnep_query          \
217	sdp_general_query       \
218	sdp_rfcomm_query        \
219	spp_counter             \
220	spp_streamer            \
221	spp_streamer_client     \
222	ublox_spp_le_counter    \
223
224# List of Examples that only use Bluetooth LE
225
226EXAMPLES_LE_ONLY=           		\
227	ancs_client_demo        		\
228	att_delayed_response    		\
229	gap_le_advertisements   		\
230	gatt_battery_query      		\
231	gatt_browser            		\
232	gatt_counter            		\
233	gatt_device_information_query	\
234	gatt_heart_rate_client  		\
235	gatt_streamer_server    		\
236	hog_boot_host_demo      		\
237	hog_host_demo      		        \
238	hog_keyboard_demo       		\
239	hog_mouse_demo          		\
240	le_credit_based_flow_control_mode_client  		\
241	le_credit_based_flow_control_mode_server  		\
242	le_mitm                 		\
243	le_streamer_client      		\
244	mesh_node_demo          		\
245	nordic_spp_le_counter   		\
246	nordic_spp_le_streamer  		\
247	sm_pairing_central      		\
248	sm_pairing_peripheral   		\
249	ublox_spp_le_counter    		\
250
251# List of Examples that use Bluetooth BR/EDR/LE = Dual Mode
252
253EXAMPLES_DUAL_MODE=         \
254	gatt_counter            \
255	gatt_streamer_server    \
256	spp_and_gatt_counter    \
257	spp_and_gatt_streamer   \
258
259# List of GATT files used by either LE_ONLY or DUAL_MODE examples
260
261EXAMPLES_GATT_FILES =           		\
262	ancs_client_demo.gatt       		\
263	att_delayed_response.gatt   		\
264	gatt_battery_query.gatt     		\
265	gatt_browser.gatt           		\
266	gatt_counter.gatt           		\
267	gatt_device_information_query.gatt 	\
268	gatt_streamer_server.gatt   		\
269	hog_host_demo.gatt          		\
270	hog_keyboard_demo.gatt      		\
271	hog_mouse_demo.gatt         		\
272	le_credit_based_flow_control_mode_server.gatt 		\
273	nordic_spp_le_counter.gatt  		\
274	nordic_spp_le_streamer.gatt 		\
275	sm_pairing_central.gatt     		\
276	sm_pairing_peripheral.gatt  		\
277	spp_and_gatt_counter.gatt   		\
278	spp_and_gatt_streamer.gatt  		\
279	ublox_spp_le_counter.gatt  			\
280
281# .h for .gatt
282EXAMPLES_GATT_H_FILES = $(EXAMPLES_GATT_FILES:.gatt=.h)
283
284# .o for .c
285CORE_OBJ    = $(CORE:.c=.o)
286COMMON_OBJ  = $(COMMON:.c=.o)
287CLASSIC_OBJ  = $(CLASSIC:.c=.o)
288ATT_OBJ     = $(ATT:.c=.o)
289GATT_CLIENT_OBJ = $(GATT_CLIENT:.c=.o)
290GATT_SERVER_OBJ = $(GATT_SERVER:.c=.o)
291PAN_OBJ = $(PAN:.c=.o)
292SBC_DECODER_OBJ  = $(SBC_DECODER:.c=.o)
293SBC_ENCODER_OBJ  = $(SBC_ENCODER:.c=.o)
294SBC_CODEC_OBJ  = $(SBC_CODEC:.c=.o)
295CVSD_PLC_OBJ = $(CVSD_PLC:.c=.o)
296AVDTP_OBJ  = $(AVDTP:.c=.o)
297AVRCP_OBJ  = $(AVRCP:.c=.o)
298HXCMOD_PLAYER_OBJ = $(HXCMOD_PLAYER:.c=.o)
299LWIP_OBJ = $(LWIP_SRC:.c=.o)
300MESH_OBJ = $(MESH:.c=.o)
301
302default_target: all
303
304# compile .gatt descriptions
305%.h: %.gatt
306	python3 ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
307
308# examples
309
310ant_test: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ant_test.c
311	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
312
313sdp_rfcomm_query: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${PAN_OBJ} ${SDP_CLIENT} sdp_rfcomm_query.c
314	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
315
316pbap_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
317	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
318
319sdp_general_query: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} sdp_general_query.c
320	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
321
322sdp_bnep_query: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} sdp_bnep_query.c
323	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
324
325spp_counter: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} spp_counter.c
326	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
327
328
329att_delayed_response.o: att_delayed_response.h att_delayed_response.c
330	${CC} ${CFLAGS} -c $(filter-out att_delayed_response.h,$^) -o $@
331
332att_delayed_response: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} att_delayed_response.o
333	${CC} $^ ${LDFLAGS} -o $@
334
335
336hog_keyboard_demo.o: hog_keyboard_demo.h hog_keyboard_demo.c
337	${CC} ${CFLAGS} -c $(filter-out hog_keyboard_demo.h,$^) -o $@
338
339hog_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
340	${CC} $^ ${LDFLAGS} -o $@
341
342
343hog_mouse_demo.o: hog_mouse_demo.h hog_mouse_demo.c
344	${CC} ${CFLAGS} -c $(filter-out hog_mouse_demo.h,$^) -o $@
345
346hog_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
347	${CC} $^ ${LDFLAGS} -o $@
348
349
350hog_boot_host_demo: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} hog_boot_host_demo.o
351	${CC} $^ ${LDFLAGS} -o $@
352
353
354hog_host_demo.o: hog_host_demo.h hog_host_demo.c
355	${CC} ${CFLAGS} -c $(filter-out hog_host_demo.h,$^) -o $@
356
357hog_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
358	${CC} $^ ${LDFLAGS} -o $@
359
360
361sm_pairing_peripheral.o: sm_pairing_peripheral.h sm_pairing_peripheral.c
362	${CC} ${CFLAGS} -c $(filter-out sm_pairing_peripheral.h,$^) -o $@
363
364sm_pairing_peripheral: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${GATT_CLIENT_OBJ} sm_pairing_peripheral.o
365	${CC} $^ ${LDFLAGS} -o $@
366
367
368sm_pairing_central.o: sm_pairing_central.h sm_pairing_central.c
369	${CC} ${CFLAGS} -c $(filter-out sm_pairing_central.h,$^) -o $@
370
371sm_pairing_central: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${GATT_CLIENT_OBJ} sm_pairing_central.o
372	${CC} $^ ${LDFLAGS} -o $@
373
374
375gatt_counter.o: gatt_counter.h gatt_counter.c
376	${CC} ${CFLAGS} -c $(filter-out gatt_counter.h,$^) -o $@
377
378gatt_counter: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${CLASSIC_OBJ} battery_service_server.o gatt_counter.o
379	${CC} $^ ${LDFLAGS} -o $@
380
381
382gatt_streamer_server.o: gatt_streamer_server.h gatt_streamer_server.c
383	${CC} ${CFLAGS} -c $(filter-out gatt_streamer_server.h,$^) -o $@
384
385gatt_streamer_server: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${CLASSIC_OBJ} gatt_streamer_server.o
386	${CC} $^ ${LDFLAGS} -o $@
387
388
389le_streamer_client: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} le_streamer_client.c
390	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
391
392le_mitm: ${CORE_OBJ} ${COMMON_OBJ} le_mitm.c
393	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
394
395gatt_heart_rate_client: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} gatt_heart_rate_client.c
396	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
397
398
399spp_and_gatt_counter.o: spp_and_gatt_counter.h spp_and_gatt_counter.c
400	${CC} ${CFLAGS} -c $(filter-out spp_and_gatt_counter.h,$^) -o $@
401
402spp_and_gatt_counter: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} spp_and_gatt_counter.o
403	${CC} $^ ${LDFLAGS} -o $@
404
405
406spp_and_gatt_streamer.o: spp_and_gatt_streamer.h spp_and_gatt_streamer.c
407	${CC} ${CFLAGS} -c $(filter-out spp_and_gatt_streamer.h,$^) -o $@
408
409spp_and_gatt_streamer: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} spp_and_gatt_streamer.o
410	${CC} $^ ${LDFLAGS} -o $@
411
412
413spp_streamer: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} spp_streamer.c
414	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
415
416spp_flowcontrol: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} spp_flowcontrol.c
417	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
418
419spp_streamer_client: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} spp_streamer_client.c
420	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
421
422gap_dedicated_bonding: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} gap_dedicated_bonding.c
423	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
424
425gap_inquiry: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} gap_inquiry.c
426	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
427
428gap_link_keys: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} gap_link_keys.c
429	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
430
431panu_demo: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} ${PAN_OBJ} panu_demo.c
432	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
433
434pan_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
435	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
436
437
438gatt_browser.o: gatt_browser.h gatt_browser.c
439	${CC} ${CFLAGS} -c $(filter-out gatt_browser.h,$^) -o $@
440
441gatt_browser: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} ${GATT_SERVER_OBJ} gatt_browser.o
442	${CC} $^ ${LDFLAGS} -o $@
443
444
445gatt_battery_query.o: gatt_battery_query.h gatt_battery_query.c
446	${CC} ${CFLAGS} -c $(filter-out gatt_battery_query.h,$^) -o $@
447
448gatt_battery_query: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} ${GATT_SERVER_OBJ} gatt_battery_query.o
449	${CC} $^ ${LDFLAGS} -o $@
450
451
452gatt_device_information_query.o: gatt_device_information_query.h gatt_device_information_query.c
453	${CC} ${CFLAGS} -c $(filter-out gatt_device_information_query.h,$^) -o $@
454
455gatt_device_information_query: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} ${GATT_SERVER_OBJ} gatt_device_information_query.o
456	${CC} $^ ${LDFLAGS} -o $@
457
458
459ancs_client_demo.o: ancs_client_demo.h ancs_client_demo.c
460	${CC} ${CFLAGS} -c $(filter-out ancs_client_demo.h,$^) -o $@
461
462ancs_client_demo: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${GATT_CLIENT_OBJ} ancs_client.o ancs_client_demo.o
463	${CC} $^ ${LDFLAGS} -o $@
464
465
466led_counter: ${CORE_OBJ} ${COMMON_OBJ} led_counter.c
467	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
468
469gap_le_advertisements: ${CORE_OBJ} ${COMMON_OBJ}  gap_le_advertisements.c
470	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
471
472hsp_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
473	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
474
475hsp_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
476	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
477
478hfp_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
479	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
480
481hfp_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
482	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
483
484hid_host_demo: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} btstack_hid_parser.o hid_host.o hid_host_demo.o
485	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
486
487hid_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
488	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
489
490hid_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
491	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
492
493a2dp_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
494	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
495
496a2dp_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
497	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
498
499avrcp_browsing_client: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} ${AVRCP_OBJ} ${AVDTP_OBJ} avrcp_browsing_client.c
500	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
501
502dut_mode_classic: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} dut_mode_classic.c
503	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
504
505le_credit_based_flow_control_mode_client: ${CORE_OBJ} ${COMMON_OBJ} le_credit_based_flow_control_mode_client.c
506	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
507
508
509le_credit_based_flow_control_mode_server.o: le_credit_based_flow_control_mode_server.h le_credit_based_flow_control_mode_server.c
510	${CC} ${CFLAGS} -c $(filter-out le_credit_based_flow_control_mode_server.h,$^) -o $@
511
512le_credit_based_flow_control_mode_server: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} le_credit_based_flow_control_mode_server.o
513	${CC} $^ ${LDFLAGS} -o $@
514
515
516mod_player: ${CORE_OBJ} ${COMMON_OBJ} ${HXCMOD_PLAYER_OBJ} btstack_audio.o mod_player.c
517	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
518
519sine_player: ${CORE_OBJ} ${COMMON_OBJ} btstack_audio.o sine_player.c
520	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
521
522audio_duplex: ${CORE_OBJ} ${COMMON_OBJ} btstack_audio.o btstack_ring_buffer.o audio_duplex.c
523	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
524
525
526nordic_spp_le_counter.o: nordic_spp_le_counter.h nordic_spp_le_counter.c
527	${CC} ${CFLAGS} -c $(filter-out nordic_spp_le_counter.h,$^) -o $@
528
529nordic_spp_le_counter: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} nordic_spp_service_server.o nordic_spp_le_counter.o
530	${CC} $^ ${LDFLAGS} -o $@
531
532
533nordic_spp_le_streamer.o: nordic_spp_le_streamer.h nordic_spp_le_streamer.c
534	${CC} ${CFLAGS} -c $(filter-out nordic_spp_le_streamer.h,$^) -o $@
535
536nordic_spp_le_streamer: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} nordic_spp_service_server.o nordic_spp_le_streamer.o
537	${CC} $^ ${LDFLAGS} -o $@
538
539
540ublox_spp_le_counter.o: ublox_spp_le_counter.h ublox_spp_le_counter.c
541	${CC} ${CFLAGS} -c $(filter-out ublox_spp_le_counter.h,$^) -o $@
542
543ublox_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
544	${CC} $^ ${LDFLAGS} -o $@
545
546
547mesh_node_demo.o: mesh_node_demo.h mesh_node_demo.c
548	${CC} ${CFLAGS} -c $(filter-out mesh_node_demo.h,$^) -o $@
549
550mesh_node_demo:${CORE_OBJ} ${COMMON_OBJ} ${MESH_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_OBJ} mesh_node_demo.o
551	${CC} $^ ${LDFLAGS} -o $@
552
553clean:
554	rm -f ${EXAMPLES} ${EXAMPLES_GATT_H_FILES}
555	rm -f  *.o *.out *.hex *.exe *.wav *.sbc
556	rm -rf *.dSYM
557	rm -rf ${BTSTACK_ROOT}/src/*.o
558	rm -rf ${BTSTACK_ROOT}/src/ble/*.o
559	rm -rf ${BTSTACK_ROOT}/src/ble/gatt-service/*.o
560	rm -rf ${BTSTACK_ROOT}/src/classic/*.o
561	rm -rf ${BTSTACK_ROOT}/example/*.o
562