xref: /btstack/example/Makefile.inc (revision fe5451fa99e81254d892cdf68b39fdae1a22982c)
1fcb08cdbSMilanka Ringwald
2bcf00d8fSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src
3bcf00d8fSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src/ble
4*fe5451faSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src/ble/gatt-service
5bcf00d8fSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src/classic
6bcf00d8fSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/example
7faccbb29SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/mbedtls/library
80e5ac34fSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/srce
90e5ac34fSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder//srce
10bcf00d8fSMatthias Ringwald
11bcf00d8fSMatthias RingwaldCFLAGS += -I.
12bcf00d8fSMatthias RingwaldCFLAGS += -I${BTSTACK_ROOT}/src/ble
13bcf00d8fSMatthias RingwaldCFLAGS += -I${BTSTACK_ROOT}/src/classic
14bcf00d8fSMatthias RingwaldCFLAGS += -I${BTSTACK_ROOT}/src
15faccbb29SMatthias RingwaldCFLAGS += -I${BTSTACK_ROOT}/3rd-party/mbedtls/include
160e5ac34fSMatthias RingwaldCFLAGS += -I${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/include
170e5ac34fSMatthias RingwaldCFLAGS += -I${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/include
1840e13339SMatthias Ringwald
190e5ac34fSMatthias RingwaldCFLAGS += -I${BTSTACK_ROOT}/test/security_manager
20bcf00d8fSMatthias Ringwald
2140e13339SMatthias Ringwald# for CVSD/SBC PLC
2240e13339SMatthias RingwaldLDFLAGS += -lm
2340e13339SMatthias Ringwald
24bcf00d8fSMatthias RingwaldCORE += \
25bcf00d8fSMatthias Ringwald	btstack_memory.c            \
26bcf00d8fSMatthias Ringwald	btstack_linked_list.c	    \
27bcf00d8fSMatthias Ringwald	btstack_memory_pool.c       \
28bcf00d8fSMatthias Ringwald	btstack_run_loop.c		    \
29bcf00d8fSMatthias Ringwald	btstack_util.c 	            \
30bcf00d8fSMatthias Ringwald
31bcf00d8fSMatthias RingwaldCOMMON += \
32bcf00d8fSMatthias Ringwald	hci.c			            \
33bcf00d8fSMatthias Ringwald	hci_cmd.c		            \
34bcf00d8fSMatthias Ringwald	hci_dump.c		            \
35bcf00d8fSMatthias Ringwald	l2cap.c			            \
36bcf00d8fSMatthias Ringwald	l2cap_signaling.c	        \
373a18db10SMatthias Ringwald
383a18db10SMatthias RingwaldCLASSIC += \
39bcf00d8fSMatthias Ringwald	btstack_link_key_db_memory.c   \
40bcf00d8fSMatthias Ringwald	sdp_util.c	                \
41efda0b48SMatthias Ringwald	spp_server.c  				\
42bcf00d8fSMatthias Ringwald	rfcomm.c	                \
43bcf00d8fSMatthias Ringwald	bnep.c	                    \
44bcf00d8fSMatthias Ringwald	sdp_server.c			            \
45bcf00d8fSMatthias Ringwald
46bcf00d8fSMatthias RingwaldSDP_CLIENT += \
47bcf00d8fSMatthias Ringwald	sdp_client.o		        \
48efda0b48SMatthias Ringwald	sdp_client_rfcomm.o		    \
49bcf00d8fSMatthias Ringwald
50bcf00d8fSMatthias RingwaldATT	+= \
51bcf00d8fSMatthias Ringwald	att_dispatch.c       	    \
52bcf00d8fSMatthias Ringwald
53bcf00d8fSMatthias RingwaldGATT_SERVER += \
54bcf00d8fSMatthias Ringwald	att_db.c 				 	    \
55bcf00d8fSMatthias Ringwald	att_server.c        	    \
56bcf00d8fSMatthias Ringwald
57bcf00d8fSMatthias RingwaldGATT_CLIENT += \
58bcf00d8fSMatthias Ringwald	ad_parser.c                 \
59bcf00d8fSMatthias Ringwald	gatt_client.c        	    \
60bcf00d8fSMatthias Ringwald
615b9c6aadSMatthias RingwaldSM += \
62bcf00d8fSMatthias Ringwald	sm.c 				 	    \
63bcf00d8fSMatthias Ringwald
64bcf00d8fSMatthias RingwaldPAN += \
65bcf00d8fSMatthias Ringwald	pan.c \
66bcf00d8fSMatthias Ringwald
67faccbb29SMatthias RingwaldMBEDTLS = 					\
68faccbb29SMatthias Ringwald	bignum.c 				\
69faccbb29SMatthias Ringwald	ecp.c 					\
70faccbb29SMatthias Ringwald	ecp_curves.c 			\
7168437d83SMatthias Ringwald	sm_mbedtls_allocator.c  \
72d3bd9600SMatthias Ringwald	memory_buffer_alloc.c   \
736643eff8SMatthias Ringwald	platform.c 				\
74faccbb29SMatthias Ringwald
750e5ac34fSMatthias Ringwald# List of files for Bluedroid SBC codec
760e5ac34fSMatthias Ringwaldinclude ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/Makefile.inc
770e5ac34fSMatthias Ringwaldinclude ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/Makefile.inc
78fcb08cdbSMilanka Ringwald
79fcb08cdbSMilanka RingwaldSBC_DECODER += \
804e074f72SMilanka Ringwald	${BTSTACK_ROOT}/src/classic/btstack_sbc_plc.c \
810c87db9eSMilanka Ringwald	${BTSTACK_ROOT}/src/classic/btstack_sbc_bludroid.c \
82fcb08cdbSMilanka Ringwald
834f0d422dSMilanka RingwaldSBC_ENCODER += \
840c87db9eSMilanka Ringwald	${BTSTACK_ROOT}/src/classic/btstack_sbc_bludroid.c \
855b4ff0f7SMilanka Ringwald	${BTSTACK_ROOT}/src/classic/hfp_msbc.c \
864f0d422dSMilanka Ringwald
87fbc7c9f2SMilanka RingwaldCVSD_PLC = \
88fbc7c9f2SMilanka Ringwald	${BTSTACK_ROOT}/src/classic/btstack_cvsd_plc.c \
89fbc7c9f2SMilanka Ringwald
90fbc7c9f2SMilanka Ringwald
91bcf00d8fSMatthias RingwaldEXAMPLES = 					\
92bcf00d8fSMatthias Ringwald	ancs_client_demo		\
93bcf00d8fSMatthias Ringwald	gap_dedicated_bonding	\
94bcf00d8fSMatthias Ringwald	gap_inquiry 			\
95bcf00d8fSMatthias Ringwald	gatt_battery_query		\
96bcf00d8fSMatthias Ringwald	gatt_browser            \
97bcf00d8fSMatthias Ringwald	le_counter              \
98bcf00d8fSMatthias Ringwald	le_streamer				\
99bcf00d8fSMatthias Ringwald	led_counter				\
100bcf00d8fSMatthias Ringwald	sdp_bnep_query 			\
101bcf00d8fSMatthias Ringwald	sdp_general_query		\
102bcf00d8fSMatthias Ringwald	sdp_rfcomm_query		\
103bcf00d8fSMatthias Ringwald	spp_and_le_counter 		\
104bcf00d8fSMatthias Ringwald	spp_counter 			\
105bcf00d8fSMatthias Ringwald	spp_streamer			\
106bcf00d8fSMatthias Ringwald	gap_le_advertisements   \
107fffdd288SMatthias Ringwald	hfp_ag_demo             \
108d7ee901aSMatthias Ringwald	hfp_hf_demo             \
109d7ee901aSMatthias Ringwald	hsp_ag_demo             \
110d7ee901aSMatthias Ringwald	hsp_hs_demo             \
111d7ee901aSMatthias Ringwald	sm_pairing_peripheral   \
1127c485f8bSMatthias Ringwald	sm_pairing_central      \
113bcf00d8fSMatthias Ringwald
114bcf00d8fSMatthias RingwaldEXAMPLES_USING_LE =			\
115bcf00d8fSMatthias Ringwald	ancs_client_demo		\
116bcf00d8fSMatthias Ringwald	gatt_battery_query      \
117bcf00d8fSMatthias Ringwald	gatt_browser			\
118bcf00d8fSMatthias Ringwald	le_counter              \
119bcf00d8fSMatthias Ringwald	le_streamer				\
120bcf00d8fSMatthias Ringwald	spp_and_le_counter	    \
121bcf00d8fSMatthias Ringwald	gap_le_advertisements   \
122d7ee901aSMatthias Ringwald	sm_pairing_peripheral   \
1237c485f8bSMatthias Ringwald	sm_pairing_central      \
124bcf00d8fSMatthias Ringwald
125bcf00d8fSMatthias Ringwald# .o for .c
126bcf00d8fSMatthias RingwaldCORE_OBJ    = $(CORE:.c=.o)
127bcf00d8fSMatthias RingwaldCOMMON_OBJ  = $(COMMON:.c=.o)
1283a18db10SMatthias RingwaldCLASSIC_OBJ  = $(CLASSIC:.c=.o)
1295b9c6aadSMatthias RingwaldSM_OBJ = $(SM:.c=.o) $(MBEDTLS:.c=.o)
130bcf00d8fSMatthias RingwaldATT_OBJ     = $(ATT:.c=.o)
131bcf00d8fSMatthias RingwaldGATT_CLIENT_OBJ = $(GATT_CLIENT:.c=.o)
132bcf00d8fSMatthias RingwaldGATT_SERVER_OBJ = $(GATT_SERVER:.c=.o)
133bcf00d8fSMatthias RingwaldPAN_OBJ = $(PAN:.c=.o)
134fcb08cdbSMilanka RingwaldSBC_DECODER_OBJ  = $(SBC_DECODER:.c=.o)
135fcb08cdbSMilanka RingwaldSBC_ENCODER_OBJ  = $(SBC_ENCODER:.c=.o)
136fbc7c9f2SMilanka RingwaldCVSD_PLC_OBJ = $(CVSD_PLC:.c=.o)
137bcf00d8fSMatthias Ringwald
138bcf00d8fSMatthias Ringwalddefault_target: all
139bcf00d8fSMatthias Ringwald
140bcf00d8fSMatthias Ringwald# compile .gatt descriptions
141bcf00d8fSMatthias Ringwaldprofile.h: profile.gatt
142b3fcedb9SMatthias Ringwald	python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
143bcf00d8fSMatthias Ringwaldancs_client_demo.h: ancs_client_demo.gatt
144b3fcedb9SMatthias Ringwald	python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
145bcf00d8fSMatthias Ringwaldspp_and_le_counter.h: spp_and_le_counter.gatt
146b3fcedb9SMatthias Ringwald	python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
147bcf00d8fSMatthias Ringwaldle_counter.h: le_counter.gatt
148b3fcedb9SMatthias Ringwald	python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
149bcf00d8fSMatthias Ringwaldle_streamer.h: le_streamer.gatt
150b3fcedb9SMatthias Ringwald	python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
151d7ee901aSMatthias Ringwaldsm_pairing_peripheral.h: sm_pairing_peripheral.gatt
152d7ee901aSMatthias Ringwald	python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
153bcf00d8fSMatthias Ringwald
154bcf00d8fSMatthias Ringwald# examples
1553a18db10SMatthias Ringwaldsdp_rfcomm_query: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${PAN_OBJ} ${SDP_CLIENT} sdp_rfcomm_query.c
156bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
157bcf00d8fSMatthias Ringwald
1583a18db10SMatthias Ringwaldsdp_general_query: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} sdp_general_query.c
159bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
160bcf00d8fSMatthias Ringwald
1613a18db10SMatthias Ringwaldsdp_bnep_query: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} sdp_bnep_query.c
162bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
163bcf00d8fSMatthias Ringwald
1643a18db10SMatthias Ringwaldspp_counter: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} spp_counter.c
165bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
166bcf00d8fSMatthias Ringwald
1678577affdSMatthias Ringwaldle_counter: le_counter.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_OBJ} battery_service_server.o le_counter.c
168bcf00d8fSMatthias Ringwald	${CC} $(filter-out le_counter.h,$^) ${CFLAGS} ${LDFLAGS} -o $@
169bcf00d8fSMatthias Ringwald
1705b9c6aadSMatthias Ringwaldsm_pairing_peripheral: sm_pairing_peripheral.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_OBJ} sm_pairing_peripheral.c
171d7ee901aSMatthias Ringwald	${CC} $(filter-out sm_pairing_peripheral.h,$^) ${CFLAGS} ${LDFLAGS} -o $@
172d7ee901aSMatthias Ringwald
1735b9c6aadSMatthias Ringwaldsm_pairing_central: ${CORE_OBJ} ${COMMON_OBJ} ${SM_OBJ} ad_parser.o sm_pairing_central.o
17405cb0471SMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
1757c485f8bSMatthias Ringwald
1765b9c6aadSMatthias Ringwaldle_streamer: le_streamer.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_OBJ} le_streamer.c
177bcf00d8fSMatthias Ringwald	${CC} $(filter-out le_streamer.h,$^) ${CFLAGS} ${LDFLAGS} -o $@
178bcf00d8fSMatthias Ringwald
1795b9c6aadSMatthias Ringwaldspp_and_le_counter: spp_and_le_counter.h ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_OBJ} spp_and_le_counter.c
180bcf00d8fSMatthias Ringwald	${CC} $(filter-out spp_and_le_counter.h,$^)  ${CFLAGS} ${LDFLAGS} -o $@
181bcf00d8fSMatthias Ringwald
1823a18db10SMatthias Ringwaldspp_counter_ssp: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} spp_counter_ssp.c
183bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
184bcf00d8fSMatthias Ringwald
1853a18db10SMatthias Ringwaldspp_streamer: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} spp_streamer.c
186bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
187bcf00d8fSMatthias Ringwald
1883a18db10SMatthias Ringwaldgap_dedicated_bonding: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} gap_dedicated_bonding.c
189bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
190bcf00d8fSMatthias Ringwald
1913a18db10SMatthias Ringwaldgap_inquiry: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ad_parser.o gap_inquiry.c
192bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
193bcf00d8fSMatthias Ringwald
1943a18db10SMatthias Ringwaldpanu_demo: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} panu_demo.c
195bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
196bcf00d8fSMatthias Ringwald
1975b9c6aadSMatthias Ringwaldgatt_browser: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} ${SM_OBJ} gatt_browser.c
198bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
199bcf00d8fSMatthias Ringwald
2005b9c6aadSMatthias Ringwaldgatt_battery_query: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} ${SM_OBJ} gatt_battery_query.c
201bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
202bcf00d8fSMatthias Ringwald
2035b9c6aadSMatthias Ringwaldancs_client_demo: ancs_client_demo.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${GATT_CLIENT_OBJ} ${SM_OBJ} ancs_client.c ancs_client_demo.c
204bcf00d8fSMatthias Ringwald	${CC} $(filter-out ancs_client_demo.h,$^) ${CFLAGS} ${LDFLAGS} -o $@
205bcf00d8fSMatthias Ringwald
206bcf00d8fSMatthias Ringwaldled_counter: ${CORE_OBJ} ${COMMON_OBJ} led_counter.c
207bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
208bcf00d8fSMatthias Ringwald
209bcf00d8fSMatthias Ringwaldgap_le_advertisements: ${CORE_OBJ} ${COMMON_OBJ} ad_parser.c gap_le_advertisements.c
210bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
211bcf00d8fSMatthias Ringwald
212dbb41bfeSMilanka Ringwaldhsp_hs_demo: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} ${SBC_DECODER_OBJ} ${SBC_ENCODER_OBJ} ${CVSD_PLC_OBJ} wav_util.o sco_demo_util.o btstack_ring_buffer.o hsp_hs.o hsp_hs_demo.c
213fbc7c9f2SMilanka Ringwald	${CC} $^ ${CFLAGS} -I${BTSTACK_ROOT}/platform/posix ${LDFLAGS} -o $@
214bcf00d8fSMatthias Ringwald
215dbb41bfeSMilanka Ringwaldhsp_ag_demo: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} ${SBC_DECODER_OBJ} ${SBC_ENCODER_OBJ} ${CVSD_PLC_OBJ} wav_util.o sco_demo_util.o btstack_ring_buffer.o hsp_ag.o hsp_ag_demo.c
216fbc7c9f2SMilanka Ringwald	${CC} $^ ${CFLAGS} -I${BTSTACK_ROOT}/platform/posix ${LDFLAGS} -o $@
217fffdd288SMatthias Ringwald
218dbb41bfeSMilanka Ringwaldhfp_ag_demo: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} ${SBC_DECODER_OBJ} ${SBC_ENCODER_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
219fbc7c9f2SMilanka Ringwald	${CC} $^ ${CFLAGS} -I${BTSTACK_ROOT}/platform/posix ${LDFLAGS} -o $@
220fffdd288SMatthias Ringwald
221dbb41bfeSMilanka Ringwaldhfp_hf_demo: ${CORE_OBJ} ${COMMON_OBJ} ${CLASSIC_OBJ} ${SDP_CLIENT} ${SBC_DECODER_OBJ} ${SBC_ENCODER_OBJ} ${CVSD_PLC_OBJ} wav_util.o sco_demo_util.o btstack_ring_buffer.o hfp.o hfp_hf.o hfp_hf_demo.c
222fbc7c9f2SMilanka Ringwald	${CC} $^ ${CFLAGS} -I${BTSTACK_ROOT}/platform/posix ${LDFLAGS} -o $@
223fffdd288SMatthias Ringwald
224bcf00d8fSMatthias Ringwaldclean:
225bcf00d8fSMatthias Ringwald	rm -f ${EXAMPLES}
226bcf00d8fSMatthias Ringwald	rm -f  *.o *.out *.hex *.exe
227bcf00d8fSMatthias Ringwald	rm -f  ancs_client_demo.h profile.h spp_and_le_counter.h
228bcf00d8fSMatthias Ringwald	rm -rf *.dSYM
229bcf00d8fSMatthias Ringwald	rm -rf ${BTSTACK_ROOT}/ble/*.o
230bcf00d8fSMatthias Ringwald	rm -rf ${BTSTACK_ROOT}/src/*.o
231bcf00d8fSMatthias Ringwald
232bcf00d8fSMatthias Ringwald
233