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