xref: /btstack/example/Makefile.inc (revision 6643eff82494104fd6ecd3e68548609183ff0294)
1bcf00d8fSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src
2bcf00d8fSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src/ble
3bcf00d8fSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/src/classic
4bcf00d8fSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/example
5faccbb29SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/3rd-party/mbedtls/library
6e53be891SMatthias RingwaldVPATH += ${BTSTACK_ROOT}/test/security_manager
7bcf00d8fSMatthias Ringwald
8bcf00d8fSMatthias RingwaldCFLAGS += -I.
9bcf00d8fSMatthias RingwaldCFLAGS += -I${BTSTACK_ROOT}/src/ble
10bcf00d8fSMatthias RingwaldCFLAGS += -I${BTSTACK_ROOT}/src/classic
11bcf00d8fSMatthias RingwaldCFLAGS += -I${BTSTACK_ROOT}/src
12faccbb29SMatthias RingwaldCFLAGS += -I${BTSTACK_ROOT}/3rd-party/mbedtls/include
13e53be891SMatthias RingwaldCFLAGS += -I${BTSTACK_ROOT}/test/security_manager
14bcf00d8fSMatthias Ringwald
15bcf00d8fSMatthias RingwaldCORE += \
16bcf00d8fSMatthias Ringwald    btstack_memory.c            \
17bcf00d8fSMatthias Ringwald    btstack_linked_list.c	    \
18bcf00d8fSMatthias Ringwald    btstack_memory_pool.c       \
19bcf00d8fSMatthias Ringwald    btstack_run_loop.c		    \
20bcf00d8fSMatthias Ringwald    btstack_util.c 	            \
21bcf00d8fSMatthias Ringwald
22bcf00d8fSMatthias RingwaldCOMMON += \
23bcf00d8fSMatthias Ringwald    hci.c			            \
24bcf00d8fSMatthias Ringwald    hci_cmd.c		            \
25bcf00d8fSMatthias Ringwald    hci_dump.c		            \
26bcf00d8fSMatthias Ringwald    l2cap.c			            \
27bcf00d8fSMatthias Ringwald    l2cap_signaling.c	        \
28bcf00d8fSMatthias Ringwald	btstack_link_key_db_memory.c   \
29bcf00d8fSMatthias Ringwald    sdp_util.c	                \
30efda0b48SMatthias Ringwald    spp_server.c  				\
31bcf00d8fSMatthias Ringwald    rfcomm.c	                \
32bcf00d8fSMatthias Ringwald    bnep.c	                    \
33bcf00d8fSMatthias Ringwald    sdp_server.c			            \
34bcf00d8fSMatthias Ringwald
35bcf00d8fSMatthias RingwaldSDP_CLIENT += \
36bcf00d8fSMatthias Ringwald    sdp_client.o		        \
37efda0b48SMatthias Ringwald	sdp_client_rfcomm.o		    \
38bcf00d8fSMatthias Ringwald
39bcf00d8fSMatthias RingwaldATT	+= \
40bcf00d8fSMatthias Ringwald    att_dispatch.c       	    \
41bcf00d8fSMatthias Ringwald
42bcf00d8fSMatthias RingwaldGATT_SERVER += \
43bcf00d8fSMatthias Ringwald    att_db.c 				 	    \
44bcf00d8fSMatthias Ringwald    att_server.c        	    \
45bcf00d8fSMatthias Ringwald
46bcf00d8fSMatthias RingwaldGATT_CLIENT += \
47bcf00d8fSMatthias Ringwald    ad_parser.c                 \
48bcf00d8fSMatthias Ringwald    gatt_client.c        	    \
49bcf00d8fSMatthias Ringwald
50bcf00d8fSMatthias RingwaldSM_REAL += \
51bcf00d8fSMatthias Ringwald	sm.c 				 	    \
52bcf00d8fSMatthias Ringwald    le_device_db_memory.c       \
53e53be891SMatthias Ringwald    rijndael.c 					\
54bcf00d8fSMatthias Ringwald
55bcf00d8fSMatthias RingwaldSM_MINIMAL += \
56bcf00d8fSMatthias Ringwald	sm_minimal.c  		 	    \
57bcf00d8fSMatthias Ringwald    le_device_db_dummy.c        \
58bcf00d8fSMatthias Ringwald
59bcf00d8fSMatthias RingwaldPAN += \
60bcf00d8fSMatthias Ringwald	pan.c \
61bcf00d8fSMatthias Ringwald
62faccbb29SMatthias RingwaldMBEDTLS = 					\
63faccbb29SMatthias Ringwald	bignum.c 				\
64faccbb29SMatthias Ringwald	ecp.c 					\
65faccbb29SMatthias Ringwald	ecp_curves.c 			\
66*6643eff8SMatthias Ringwald	platform.c 				\
67faccbb29SMatthias Ringwald
68bcf00d8fSMatthias RingwaldEXAMPLES = 					\
69bcf00d8fSMatthias Ringwald	ancs_client_demo		\
70bcf00d8fSMatthias Ringwald	gap_dedicated_bonding	\
71bcf00d8fSMatthias Ringwald	gap_inquiry 			\
72bcf00d8fSMatthias Ringwald	gatt_battery_query		\
73bcf00d8fSMatthias Ringwald	gatt_browser            \
74bcf00d8fSMatthias Ringwald	le_counter              \
75bcf00d8fSMatthias Ringwald	le_streamer				\
76bcf00d8fSMatthias Ringwald	led_counter				\
77bcf00d8fSMatthias Ringwald	sdp_bnep_query 			\
78bcf00d8fSMatthias Ringwald	sdp_general_query		\
79bcf00d8fSMatthias Ringwald	sdp_rfcomm_query		\
80bcf00d8fSMatthias Ringwald	spp_and_le_counter 		\
81bcf00d8fSMatthias Ringwald	spp_counter 			\
82bcf00d8fSMatthias Ringwald	spp_streamer			\
83bcf00d8fSMatthias Ringwald    gap_le_advertisements   \
84ecb8c3aeSMatthias Ringwald    hsp_hs_demo             \
85fffdd288SMatthias Ringwald    hsp_ag_demo             \
86fffdd288SMatthias Ringwald    hfp_hf_demo             \
87fffdd288SMatthias Ringwald    hfp_ag_demo             \
88bcf00d8fSMatthias Ringwald
89bcf00d8fSMatthias RingwaldEXAMPLES_USING_LE =			\
90bcf00d8fSMatthias Ringwald	ancs_client_demo		\
91bcf00d8fSMatthias Ringwald	gatt_battery_query      \
92bcf00d8fSMatthias Ringwald	gatt_browser			\
93bcf00d8fSMatthias Ringwald	le_counter              \
94bcf00d8fSMatthias Ringwald	le_streamer				\
95bcf00d8fSMatthias Ringwald	spp_and_le_counter	    \
96bcf00d8fSMatthias Ringwald    gap_le_advertisements   \
97bcf00d8fSMatthias Ringwald
98bcf00d8fSMatthias Ringwald# .o for .c
99bcf00d8fSMatthias RingwaldCORE_OBJ    = $(CORE:.c=.o)
100bcf00d8fSMatthias RingwaldCOMMON_OBJ  = $(COMMON:.c=.o)
101faccbb29SMatthias RingwaldSM_REAL_OBJ = $(SM_REAL:.c=.o) $(MBEDTLS:.c=.o)
102bcf00d8fSMatthias RingwaldSM_MINIMAL_OBJ = $(SM_MINIMAL:.c=.o)
103bcf00d8fSMatthias RingwaldATT_OBJ     = $(ATT:.c=.o)
104bcf00d8fSMatthias RingwaldGATT_CLIENT_OBJ = $(GATT_CLIENT:.c=.o)
105bcf00d8fSMatthias RingwaldGATT_SERVER_OBJ = $(GATT_SERVER:.c=.o)
106bcf00d8fSMatthias RingwaldPAN_OBJ = $(PAN:.c=.o)
107bcf00d8fSMatthias Ringwald
108bcf00d8fSMatthias Ringwalddefault_target: all
109bcf00d8fSMatthias Ringwald
110bcf00d8fSMatthias Ringwald# compile .gatt descriptions
111bcf00d8fSMatthias Ringwaldprofile.h: profile.gatt
112b3fcedb9SMatthias Ringwald	python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
113bcf00d8fSMatthias Ringwaldancs_client_demo.h: ancs_client_demo.gatt
114b3fcedb9SMatthias Ringwald	python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
115bcf00d8fSMatthias Ringwaldspp_and_le_counter.h: spp_and_le_counter.gatt
116b3fcedb9SMatthias Ringwald	python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
117bcf00d8fSMatthias Ringwaldle_counter.h: le_counter.gatt
118b3fcedb9SMatthias Ringwald	python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
119bcf00d8fSMatthias Ringwaldle_streamer.h: le_streamer.gatt
120b3fcedb9SMatthias Ringwald	python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
121bcf00d8fSMatthias Ringwald
122bcf00d8fSMatthias Ringwald# examples
123bcf00d8fSMatthias Ringwaldsdp_rfcomm_query: ${CORE_OBJ} ${COMMON_OBJ} ${PAN_OBJ} ${SDP_CLIENT} sdp_rfcomm_query.c
124bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
125bcf00d8fSMatthias Ringwald
126bcf00d8fSMatthias Ringwaldsdp_general_query: ${CORE_OBJ} ${COMMON_OBJ} ${SDP_CLIENT} sdp_general_query.c
127bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
128bcf00d8fSMatthias Ringwald
129bcf00d8fSMatthias Ringwaldsdp_bnep_query: ${CORE_OBJ} ${COMMON_OBJ} ${SDP_CLIENT} sdp_bnep_query.c
130bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
131bcf00d8fSMatthias Ringwald
132bcf00d8fSMatthias Ringwaldspp_counter: ${CORE_OBJ} ${COMMON_OBJ} spp_counter.c
133bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
134bcf00d8fSMatthias Ringwald
135bcf00d8fSMatthias Ringwaldle_counter: le_counter.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_REAL_OBJ} le_counter.c
136bcf00d8fSMatthias Ringwald	${CC} $(filter-out le_counter.h,$^) ${CFLAGS} ${LDFLAGS} -o $@
137bcf00d8fSMatthias Ringwald
138bcf00d8fSMatthias Ringwaldle_streamer: le_streamer.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_REAL_OBJ} le_streamer.c
139bcf00d8fSMatthias Ringwald	${CC} $(filter-out le_streamer.h,$^) ${CFLAGS} ${LDFLAGS} -o $@
140bcf00d8fSMatthias Ringwald
141bcf00d8fSMatthias Ringwaldspp_and_le_counter: spp_and_le_counter.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${SM_REAL_OBJ} spp_and_le_counter.c
142bcf00d8fSMatthias Ringwald	${CC} $(filter-out spp_and_le_counter.h,$^)  ${CFLAGS} ${LDFLAGS} -o $@
143bcf00d8fSMatthias Ringwald
144bcf00d8fSMatthias Ringwaldspp_counter_ssp: ${CORE_OBJ} ${COMMON_OBJ} spp_counter_ssp.c
145bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
146bcf00d8fSMatthias Ringwald
147bcf00d8fSMatthias Ringwaldspp_streamer: ${CORE_OBJ} ${COMMON_OBJ} ${SDP_CLIENT} spp_streamer.c
148bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
149bcf00d8fSMatthias Ringwald
150bcf00d8fSMatthias Ringwaldgap_dedicated_bonding: ${CORE_OBJ} ${COMMON_OBJ} gap_dedicated_bonding.c
151bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
152bcf00d8fSMatthias Ringwald
153bcf00d8fSMatthias Ringwaldgap_inquiry: ${CORE_OBJ} ${COMMON_OBJ} gap_inquiry.c
154bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
155bcf00d8fSMatthias Ringwald
156bcf00d8fSMatthias Ringwaldpanu_demo: ${CORE_OBJ} ${COMMON_OBJ} ${SDP_CLIENT} panu_demo.c
157bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
158bcf00d8fSMatthias Ringwald
159bcf00d8fSMatthias Ringwaldgatt_browser: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} ${SM_REAL_OBJ} gatt_browser.c
160bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
161bcf00d8fSMatthias Ringwald
162bcf00d8fSMatthias Ringwaldgatt_battery_query: ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_CLIENT_OBJ} ${SM_REAL_OBJ} gatt_battery_query.c
163bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
164bcf00d8fSMatthias Ringwald
165bcf00d8fSMatthias Ringwaldancs_client_demo: ancs_client_demo.h ${CORE_OBJ} ${COMMON_OBJ} ${ATT_OBJ} ${GATT_SERVER_OBJ} ${GATT_CLIENT_OBJ} ${SM_REAL_OBJ} ancs_client.c ancs_client_demo.c
166bcf00d8fSMatthias Ringwald	${CC} $(filter-out ancs_client_demo.h,$^) ${CFLAGS} ${LDFLAGS} -o $@
167bcf00d8fSMatthias Ringwald
168bcf00d8fSMatthias Ringwaldled_counter: ${CORE_OBJ} ${COMMON_OBJ} led_counter.c
169bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
170bcf00d8fSMatthias Ringwald
171bcf00d8fSMatthias Ringwaldgap_le_advertisements: ${CORE_OBJ} ${COMMON_OBJ} ad_parser.c gap_le_advertisements.c
172bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
173bcf00d8fSMatthias Ringwald
174185c8cd4SMatthias Ringwaldhsp_hs_demo: ${CORE_OBJ} ${COMMON_OBJ} ${SDP_CLIENT} sco_demo_util.o hsp_hs.o hsp_hs_demo.c
175bcf00d8fSMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
176bcf00d8fSMatthias Ringwald
177185c8cd4SMatthias Ringwaldhsp_ag_demo: ${CORE_OBJ} ${COMMON_OBJ} ${SDP_CLIENT} sco_demo_util.o hsp_ag.o hsp_ag_demo.c
178fffdd288SMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
179fffdd288SMatthias Ringwald
180185c8cd4SMatthias Ringwaldhfp_ag_demo: ${CORE_OBJ} ${COMMON_OBJ} ${SDP_CLIENT} sco_demo_util.o hfp.o hfp_gsm_model.o hfp_ag.o hfp_ag_demo.c
181fffdd288SMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
182fffdd288SMatthias Ringwald
183185c8cd4SMatthias Ringwaldhfp_hf_demo: ${CORE_OBJ} ${COMMON_OBJ} ${SDP_CLIENT} sco_demo_util.o hfp.o hfp_hf.o hfp_hf_demo.c
184fffdd288SMatthias Ringwald	${CC} $^ ${CFLAGS} ${LDFLAGS} -o $@
185fffdd288SMatthias Ringwald
186bcf00d8fSMatthias Ringwaldclean:
187bcf00d8fSMatthias Ringwald	rm -f ${EXAMPLES}
188bcf00d8fSMatthias Ringwald	rm -f  *.o *.out *.hex *.exe
189bcf00d8fSMatthias Ringwald	rm -f  ancs_client_demo.h profile.h spp_and_le_counter.h
190bcf00d8fSMatthias Ringwald	rm -rf *.dSYM
191bcf00d8fSMatthias Ringwald	rm -rf ${BTSTACK_ROOT}/ble/*.o
192bcf00d8fSMatthias Ringwald	rm -rf ${BTSTACK_ROOT}/src/*.o
193bcf00d8fSMatthias Ringwald
194bcf00d8fSMatthias Ringwald
195