xref: /btstack/port/msp432p401lp-cc256x/Makefile (revision 06816492480ce7ade9146f46190a1bd8fa90f994)
1#
2# Defines the part type that this project uses.
3#
4PART=__MSP432P401R__
5
6#
7# The base directory for MSPWare.
8#
9ROOT=ti/devices/msp432p4xx/
10
11#
12# Include the common make definitions.
13#
14include Makefile.defs
15
16#
17# Where to find header files that do not live in the source directory.
18#
19IPATH+=CMSIS
20IPATH+=${ROOT}/driverlib
21
22# BTstack
23BTSTACK_ROOT=../..
24VPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/srce
25VPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/srce
26VPATH += ${BTSTACK_ROOT}/3rd-party/hxcmod-player
27VPATH += ${BTSTACK_ROOT}/3rd-party/hxcmod-player/mods
28VPATH += ${BTSTACK_ROOT}/3rd-party/md5
29VPATH += ${BTSTACK_ROOT}/3rd-party/micro-ecc
30VPATH += ${BTSTACK_ROOT}/3rd-party/segger-rtt
31VPATH += ${BTSTACK_ROOT}/3rd-party/yxml
32VPATH += ${BTSTACK_ROOT}/example
33VPATH += ${BTSTACK_ROOT}/src
34VPATH += ${BTSTACK_ROOT}/src/ble
35VPATH += ${BTSTACK_ROOT}/src/ble/gatt-service
36VPATH += ${BTSTACK_ROOT}/src/classic
37VPATH += ${BTSTACK_ROOT}/platform/embedded
38VPATH += ${BTSTACK_ROOT}/chipset/cc256x
39IPATH += ${BTSTACK_ROOT}/3rd-party/segger-rtt
40IPATH += ${BTSTACK_ROOT}/src
41IPATH += ${BTSTACK_ROOT}/platform/embedded
42IPATH += ${BTSTACK_ROOT}/chipset/cc256x
43IPATH += ${BTSTACK_ROOT}/3rd-party/hxcmod-player
44IPATH += ${BTSTACK_ROOT}/3rd-party/hxcmod-player/mods
45IPATH += ${BTSTACK_ROOT}/3rd-party/md5
46IPATH += ${BTSTACK_ROOT}/3rd-party/yxml
47IPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/include
48IPATH += ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/include
49IPATH += ${BTSTACK_ROOT}/3rd-party/lwip/core/src/include
50IPATH += ${BTSTACK_ROOT}/3rd-party/lwip/dhcp-server
51IPATH += ${BTSTACK_ROOT}/platform/lwip/
52IPATH += ${BTSTACK_ROOT}/platform/lwip/port
53
54
55IPATH += .
56IPATH += ${COMPILER}
57
58BTSTACK_SOURCES = \
59${BTSTACK_ROOT}/3rd-party/hxcmod-player/hxcmod.c \
60${BTSTACK_ROOT}/3rd-party/hxcmod-player/mods/nao-deceased_by_disease.c \
61${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/def.c \
62${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/inet_chksum.c \
63${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/init.c \
64${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ip.c \
65${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/mem.c \
66${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/memp.c \
67${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/netif.c \
68${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/pbuf.c \
69${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/tcp.c \
70${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/tcp_in.c \
71${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/tcp_out.c \
72${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/timeouts.c \
73${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/udp.c \
74${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/acd.c \
75${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/dhcp.c \
76${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/etharp.c \
77${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/icmp.c \
78${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/ip4.c \
79${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/ip4_addr.c \
80${BTSTACK_ROOT}/3rd-party/lwip/core/src/core/ipv4/ip4_frag.c \
81${BTSTACK_ROOT}/3rd-party/lwip/core/src/netif/ethernet.c \
82${BTSTACK_ROOT}/3rd-party/lwip/core/src/apps/http/altcp_proxyconnect.c \
83${BTSTACK_ROOT}/3rd-party/lwip/core/src/apps/http/fs.c \
84${BTSTACK_ROOT}/3rd-party/lwip/core/src/apps/http/httpd.c \
85${BTSTACK_ROOT}/3rd-party/lwip/dhcp-server/dhserver.c \
86${BTSTACK_ROOT}/3rd-party/md5/md5.c \
87${BTSTACK_ROOT}/3rd-party/micro-ecc/uECC.c \
88${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT.c \
89${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_printf.c \
90${BTSTACK_ROOT}/3rd-party/segger-rtt/SEGGER_RTT_Syscalls_GCC.c \
91${BTSTACK_ROOT}/3rd-party/yxml/yxml.c \
92${BTSTACK_ROOT}/example/sco_demo_util.c \
93${BTSTACK_ROOT}/src/ad_parser.c \
94${BTSTACK_ROOT}/src/ble/att_db.c \
95${BTSTACK_ROOT}/src/ble/att_dispatch.c \
96${BTSTACK_ROOT}/src/ble/att_server.c \
97${BTSTACK_ROOT}/src/ble/gatt-service/ancs_client.c \
98${BTSTACK_ROOT}/src/ble/gatt-service/battery_service_server.c \
99${BTSTACK_ROOT}/src/ble/gatt-service/device_information_service_server.c \
100${BTSTACK_ROOT}/src/ble/gatt-service/hids_device.c \
101${BTSTACK_ROOT}/src/ble/gatt_client.c \
102${BTSTACK_ROOT}/src/ble/le_device_db_memory.c \
103${BTSTACK_ROOT}/src/ble/le_device_db_tlv.c \
104${BTSTACK_ROOT}/src/ble/sm.c \
105${BTSTACK_ROOT}/src/btstack_crypto.c \
106${BTSTACK_ROOT}/src/btstack_hid_parser.c \
107${BTSTACK_ROOT}/src/btstack_linked_list.c \
108${BTSTACK_ROOT}/src/btstack_memory.c \
109${BTSTACK_ROOT}/src/btstack_memory_pool.c \
110${BTSTACK_ROOT}/src/btstack_ring_buffer.c \
111${BTSTACK_ROOT}/src/btstack_run_loop.c \
112${BTSTACK_ROOT}/src/btstack_tlv.c \
113${BTSTACK_ROOT}/src/btstack_util.c \
114${BTSTACK_ROOT}/src/classic/a2dp.c \
115${BTSTACK_ROOT}/src/classic/a2dp_sink.c \
116${BTSTACK_ROOT}/src/classic/a2dp_source.c \
117${BTSTACK_ROOT}/src/classic/avdtp.c \
118${BTSTACK_ROOT}/src/classic/avdtp_acceptor.c \
119${BTSTACK_ROOT}/src/classic/avdtp_initiator.c \
120${BTSTACK_ROOT}/src/classic/avdtp_sink.c \
121${BTSTACK_ROOT}/src/classic/avdtp_source.c \
122${BTSTACK_ROOT}/src/classic/avdtp_util.c \
123${BTSTACK_ROOT}/src/classic/avrcp.c \
124${BTSTACK_ROOT}/src/classic/avrcp_browsing_controller.c \
125${BTSTACK_ROOT}/src/classic/avrcp_controller.c \
126${BTSTACK_ROOT}/src/classic/avrcp_media_item_iterator.c \
127${BTSTACK_ROOT}/src/classic/avrcp_target.c \
128${BTSTACK_ROOT}/src/classic/bnep.c \
129${BTSTACK_ROOT}/src/classic/btstack_cvsd_plc.c \
130${BTSTACK_ROOT}/src/classic/btstack_link_key_db_tlv.c \
131${BTSTACK_ROOT}/src/classic/btstack_sbc_bluedroid.c \
132${BTSTACK_ROOT}/src/classic/btstack_sbc_decoder_bluedroid.c \
133${BTSTACK_ROOT}/src/classic/btstack_sbc_encoder_bluedroid.c \
134${BTSTACK_ROOT}/src/classic/btstack_sbc_plc.c \
135${BTSTACK_ROOT}/src/classic/device_id_server.c \
136${BTSTACK_ROOT}/src/classic/goep_client.c \
137${BTSTACK_ROOT}/src/classic/hfp.c \
138${BTSTACK_ROOT}/src/classic/hfp_ag.c \
139${BTSTACK_ROOT}/src/classic/hfp_gsm_model.c \
140${BTSTACK_ROOT}/src/classic/hfp_hf.c \
141${BTSTACK_ROOT}/src/classic/hfp_codec.c \
142${BTSTACK_ROOT}/src/classic/hfp_msbc.c \
143${BTSTACK_ROOT}/src/classic/hid_device.c \
144${BTSTACK_ROOT}/src/classic/hid_host.c \
145${BTSTACK_ROOT}/src/classic/hsp_ag.c \
146${BTSTACK_ROOT}/src/classic/hsp_hs.c \
147${BTSTACK_ROOT}/src/classic/obex_parser.c \
148${BTSTACK_ROOT}/src/classic/obex_message_builder.c \
149${BTSTACK_ROOT}/src/classic/pan.c \
150${BTSTACK_ROOT}/src/classic/pbap_client.c \
151${BTSTACK_ROOT}/src/classic/rfcomm.c \
152${BTSTACK_ROOT}/src/classic/sdp_client.c \
153${BTSTACK_ROOT}/src/classic/sdp_client_rfcomm.c \
154${BTSTACK_ROOT}/src/classic/sdp_server.c \
155${BTSTACK_ROOT}/src/classic/sdp_util.c \
156${BTSTACK_ROOT}/src/classic/spp_server.c \
157${BTSTACK_ROOT}/src/hci.c \
158${BTSTACK_ROOT}/src/hci_cmd.c \
159${BTSTACK_ROOT}/src/hci_dump.c \
160${BTSTACK_ROOT}/src/hci_event_builder.c \
161${BTSTACK_ROOT}/src/hci_transport_h4.c \
162${BTSTACK_ROOT}/src/l2cap.c \
163${BTSTACK_ROOT}/src/l2cap_signaling.c \
164${BTSTACK_ROOT}/platform/embedded/btstack_run_loop_embedded.c \
165${BTSTACK_ROOT}/platform/embedded/btstack_stdin_embedded.c \
166${BTSTACK_ROOT}/platform/embedded/btstack_tlv_flash_bank.c \
167${BTSTACK_ROOT}/platform/embedded/btstack_uart_block_embedded.c \
168${BTSTACK_ROOT}/platform/embedded/hci_dump_embedded_stdout.c \
169${BTSTACK_ROOT}/platform/embedded/hci_dump_segger_rtt_stdout.c \
170${BTSTACK_ROOT}/platform/lwip/port/sys_arch.c \
171${BTSTACK_ROOT}/platform/lwip/bnep_lwip.c \
172
173# CC2564B
174# - BOOST-CC2564MODA
175# - EM Wireless BoosterPacket with CC2564B module
176# INIT_SCRIPT = bluetooth_init_cc2564B_1.8_BT_Spec_4.1
177
178# CC2564C
179# - EM Wireless BoosterPacket with CC2564C module
180INIT_SCRIPT = bluetooth_init_cc2564C_1.4
181
182PORT_SOURCES = \
183	${BTSTACK_ROOT}/chipset/cc256x/${INIT_SCRIPT}.o \
184 	${BTSTACK_ROOT}/chipset/cc256x/btstack_chipset_cc256x.o \
185	hal_flash_bank_msp432.o \
186	main.o \
187	startup_msp432p401r_${COMPILER}.o \
188	system_msp432p401r.o \
189
190include ${BTSTACK_ROOT}/3rd-party/bluedroid/decoder/Makefile.inc
191include ${BTSTACK_ROOT}/3rd-party/bluedroid/encoder/Makefile.inc
192
193BTSTACK_SOURCES += ${SBC_ENCODER}
194BTSTACK_SOURCES += ${SBC_DECODER}
195
196EXAMPLES =                      \
197        a2dp_source_demo        \
198        ancs_client_demo        \
199        dut_mode_classic        \
200        gap_dedicated_bonding   \
201        gap_inquiry             \
202        gap_le_advertisements   \
203        gatt_battery_query      \
204        gatt_browser            \
205        gatt_counter            \
206        gatt_streamer_server    \
207        hid_host_demo           \
208        hid_keyboard_demo       \
209        hid_mouse_demo          \
210        hog_keyboard_demo       \
211        hog_mouse_demo          \
212        le_streamer_client      \
213        led_counter             \
214        sdp_bnep_query          \
215        sdp_general_query       \
216        sdp_rfcomm_query        \
217        sm_pairing_central      \
218        sm_pairing_peripheral   \
219        spp_and_gatt_counter    \
220        spp_and_gatt_streamer   \
221        spp_counter             \
222        spp_streamer            \
223        spp_streamer_client     \
224        pbap_client_demo        \
225        pan_lwip_http_server    \
226#        audio_duplex            \
227#        a2dp_sink_demo          \
228#        hfp_ag_demo             \
229#        hfp_hf_demo             \
230#        hsp_ag_demo             \
231#        hsp_hs_demo             \
232#        mod_player              \
233#        sine_player             \
234
235GATT_FILES = \
236        ancs_client_demo.gatt \
237        gatt_counter.gatt \
238        gatt_streamer_server.gatt \
239        gatt_browser.gatt \
240        gatt_battery_query.gatt \
241        hog_keyboard_demo.gatt \
242        hog_mouse_demo.gatt \
243        sm_pairing_peripheral.gatt \
244        sm_pairing_central.gatt \
245        spp_and_gatt_counter.gatt \
246        spp_and_gatt_streamer.gatt \
247
248
249#
250# The default rule, which causes the le_counter example to be built.
251#
252all: ${COMPILER}
253all: \
254    linker_script_gcc.ld \
255	$(addprefix $(COMPILER)/,$(GATT_FILES:.gatt=.h)) \
256	$(addprefix $(COMPILER)/,$(EXAMPLES:=.elf)) \
257	$(addprefix $(COMPILER)/,$(EXAMPLES:=.jdebug)) \
258
259include $(BTSTACK_ROOT)/chipset/cc256x/Makefile.inc
260
261#
262# The rule to clean out all the build products.
263#
264clean:
265	@rm -rf ${COMPILER} ${wildcard *~}
266
267#
268# The rule to create the target directory.
269#
270${COMPILER}:
271	@mkdir -p ${COMPILER}
272
273# compile .gatt descriptions
274${COMPILER}/%.h: %.gatt
275	python ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
276
277$(COMPILER)/%.jdebug: ozone.jdebug | $(COMPILER)
278	sed -e "s|EXAMPLE|$(basename $(notdir $@))|" $<  > $@
279
280##
281
282# pick up sources
283C_SOURCES = $(BTSTACK_SOURCES) $(PORT_SOURCES)
284OBJECTS = $(addprefix $(COMPILER)/,$(notdir $(C_SOURCES:.c=.o)))
285vpath %.c $(sort $(dir $(C_SOURCES)))
286
287LDFLAGS2 = ${CPU} ${FPU} -specs=nano.specs  -lc -lm -lnosys -Wl,--gc-sections
288
289# #
290# # The rule for linking the application.
291# #
292${COMPILER}${SUFFIX}/%.elf: ${OBJECTS} ${COMPILER}/%.o ti/devices/msp432p4xx/driverlib/${COMPILER}/msp432p4xx_driverlib.a
293	@ \
294	 ldname="linker_script_gcc.ld";                                       \
295	 if [ 'x${VERBOSE}' = x ];                                            \
296	 then                                                                 \
297	     echo "  LD          ${@} ${LNK_SCP}";                            \
298	 else                                                                 \
299	     echo ${CC} -T linker_script_gcc.ld ${LDFLAGS2} -o ${@} $(filter %.o %.a, ${^}); \
300	 fi;                                                                  \
301 	${CC} -T linker_script_gcc.ld ${LDFLAGS2} -o ${@} $(filter %.o %.a, ${^})
302	@${OBJCOPY} -O binary ${@} ${@:.elf=.bin}
303
304#
305# Include the automatically generated dependency files.
306#
307ifneq (${MAKECMDGOALS},clean)
308-include ${wildcard ${COMPILER}/*.d} __dummy__
309endif
310