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