xref: /btstack/port/archive/msp-exp430f5438-cc2564b/Makefile (revision 1664436fd643daf66517dc309e6cc72448e8a86d)
1*1664436fSMatthias Ringwald# Makefile for MSP-EXP430F5438 board with CC2560B/CC2564B/CC2567 modules
2*1664436fSMatthias Ringwald##
3*1664436fSMatthias Ringwald# mspgcc is used: http://sourceforge.net/apps/mediawiki/mspgcc/index.php?title=MSPGCC_Wiki
4*1664436fSMatthias Ringwald#
5*1664436fSMatthias Ringwald
6*1664436fSMatthias Ringwald# init scripts
7*1664436fSMatthias RingwaldCC2560B = bluetooth_init_cc2560B_1.8_BT_Spec_4.1.o
8*1664436fSMatthias RingwaldCC2564B = bluetooth_init_cc2564B_1.8_BT_Spec_4.1.o
9*1664436fSMatthias RingwaldCC2567  = CC256x_BT_Service_Pack_2.8_ANT_1.16.o
10*1664436fSMatthias Ringwald
11*1664436fSMatthias RingwaldBTSTACK_ROOT ?= ../..
12*1664436fSMatthias RingwaldVPATH += example
13*1664436fSMatthias RingwaldVPATH += firmware
14*1664436fSMatthias RingwaldVPATH += src
15*1664436fSMatthias RingwaldVPATH += $(BTSTACK_ROOT)/src
16*1664436fSMatthias RingwaldVPATH += $(BTSTACK_ROOT)/src/ble
17*1664436fSMatthias RingwaldVPATH += $(BTSTACK_ROOT)/src/classic
18*1664436fSMatthias RingwaldVPATH += $(BTSTACK_ROOT)/chipset/cc256x
19*1664436fSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/msp430
20*1664436fSMatthias RingwaldVPATH += ${BTSTACK_ROOT}/platform/embedded
21*1664436fSMatthias RingwaldVPATH += $(BTSTACK_ROOT)/example
22*1664436fSMatthias Ringwald
23*1664436fSMatthias RingwaldCC      = msp430-gcc
24*1664436fSMatthias RingwaldCFLAGS  = -mmcu=msp430f5438a -Os -Wall -fno-toplevel-reorder
25*1664436fSMatthias RingwaldCFLAGS += \
26*1664436fSMatthias Ringwald	-I. \
27*1664436fSMatthias Ringwald	-I src \
28*1664436fSMatthias Ringwald	-I firmware \
29*1664436fSMatthias Ringwald  	-I$(BTSTACK_ROOT)/src \
30*1664436fSMatthias Ringwald	-I$(BTSTACK_ROOT)/chipset/cc256x \
31*1664436fSMatthias Ringwald	-I$(BTSTACK_ROOT)/platform/embedded \
32*1664436fSMatthias Ringwald    -I${BTSTACK_ROOT}/platform/msp430 \
33*1664436fSMatthias Ringwald
34*1664436fSMatthias RingwaldLDFLAGS = -mmcu=msp430f5438a
35*1664436fSMatthias Ringwald
36*1664436fSMatthias RingwaldCORE   = \
37*1664436fSMatthias Ringwald    btstack_linked_list.c	  \
38*1664436fSMatthias Ringwald    btstack_memory.c          \
39*1664436fSMatthias Ringwald    btstack_memory_pool.c        \
40*1664436fSMatthias Ringwald    btstack_run_loop_embedded.c  \
41*1664436fSMatthias Ringwald    btstack_run_loop.c		     \
42*1664436fSMatthias Ringwald    btstack_tlv.c             \
43*1664436fSMatthias Ringwald    hal_board.c	              \
44*1664436fSMatthias Ringwald    hal_compat.c              \
45*1664436fSMatthias Ringwald    hal_cpu.c                 \
46*1664436fSMatthias Ringwald    hal_led.c 				  \
47*1664436fSMatthias Ringwald    hal_tick.c	              \
48*1664436fSMatthias Ringwald    hal_usb.c                 \
49*1664436fSMatthias Ringwald    hci_dump.c		          \
50*1664436fSMatthias Ringwald    main.c 					  \
51*1664436fSMatthias Ringwald    btstack_util.c			          \
52*1664436fSMatthias Ringwald
53*1664436fSMatthias RingwaldCOMMON = \
54*1664436fSMatthias Ringwald	ad_parser.c 			           \
55*1664436fSMatthias Ringwald	btstack_chipset_cc256x.c           \
56*1664436fSMatthias Ringwald	btstack_link_key_db_memory.c       \
57*1664436fSMatthias Ringwald    btstack_uart_block_embedded.c      \
58*1664436fSMatthias Ringwald    hal_uart_dma.c                     \
59*1664436fSMatthias Ringwald    hci.c			                   \
60*1664436fSMatthias Ringwald    hci_cmd.c		                   \
61*1664436fSMatthias Ringwald    hci_transport_h4.c                 \
62*1664436fSMatthias Ringwald
63*1664436fSMatthias RingwaldSPP = \
64*1664436fSMatthias Ringwald    l2cap.c			          \
65*1664436fSMatthias Ringwald    l2cap_signaling.c         \
66*1664436fSMatthias Ringwald	rfcomm.c			      \
67*1664436fSMatthias Ringwald    sdp_util.c                \
68*1664436fSMatthias Ringwald    spp_server.c 			  \
69*1664436fSMatthias Ringwald
70*1664436fSMatthias RingwaldSDP_CLIENT += \
71*1664436fSMatthias Ringwald    sdp_client.o		      \
72*1664436fSMatthias Ringwald	sdp_client_rfcomm.o		  \
73*1664436fSMatthias Ringwald
74*1664436fSMatthias RingwaldBLE = \
75*1664436fSMatthias Ringwald	att_db.c 					  \
76*1664436fSMatthias Ringwald	att_server.c     		  \
77*1664436fSMatthias Ringwald	le_device_db_memory.c  \
78*1664436fSMatthias Ringwald	sm.c                      \
79*1664436fSMatthias Ringwald	att_dispatch.c            \
80*1664436fSMatthias Ringwald	l2cap.c 				  \
81*1664436fSMatthias Ringwald	${CC2564B}                \
82*1664436fSMatthias Ringwald#	gatt_client.c             \
83*1664436fSMatthias Ringwald
84*1664436fSMatthias RingwaldLCD = hal_lcd.c hal_lcd_fonts.c
85*1664436fSMatthias Ringwald
86*1664436fSMatthias Ringwald
87*1664436fSMatthias RingwaldCORE_OBJ   = $(CORE:.c=.o)
88*1664436fSMatthias RingwaldCOMMON_OBJ = $(COMMON:.c=.o)
89*1664436fSMatthias RingwaldSPP_OBJ    = $(SPP:.c=.o)
90*1664436fSMatthias RingwaldBLE_OBJ    = $(BLE:.c=.o)
91*1664436fSMatthias RingwaldLCD_OBJ    = $(LCD:.c=.o)
92*1664436fSMatthias Ringwald
93*1664436fSMatthias Ringwald# create .hex file from .out
94*1664436fSMatthias Ringwald%.hex: %.out
95*1664436fSMatthias Ringwald	msp430-objcopy -O ihex $< $@
96*1664436fSMatthias Ringwald
97*1664436fSMatthias Ringwald# create firmware image from common objects and example source file
98*1664436fSMatthias Ringwald
99*1664436fSMatthias Ringwaldall: led_counter.hex
100*1664436fSMatthias Ringwald
101*1664436fSMatthias Ringwald# fetch and convert init scripts
102*1664436fSMatthias Ringwaldinclude ${BTSTACK_ROOT}/chipset/cc256x/Makefile.inc
103*1664436fSMatthias Ringwald
104*1664436fSMatthias Ringwald# compiling requires a 20-bit mspgcc version
105*1664436fSMatthias Ringwald# hid_demo.hex
106*1664436fSMatthias Ringwald# spp_and_gatt_counter.hex
107*1664436fSMatthias Ringwald# spp_accel.hex
108*1664436fSMatthias Ringwald# ble_server.hex
109*1664436fSMatthias Ringwald# spp_counter.hex
110*1664436fSMatthias Ringwald# spp_flowcontrol.hex
111*1664436fSMatthias Ringwald# sdp_rfcomm_query.hex
112*1664436fSMatthias Ringwald# sdp_general_query.hex
113*1664436fSMatthias Ringwald# gap_inquiry.hex
114*1664436fSMatthias Ringwald
115*1664436fSMatthias Ringwald# compiling ant-test requires special ant init script
116*1664436fSMatthias Ringwald# ant-test.hex
117*1664436fSMatthias Ringwald
118*1664436fSMatthias Ringwald# compile GATT database
119*1664436fSMatthias Ringwald%.h: %.gatt
120*1664436fSMatthias Ringwald	python3 ${BTSTACK_ROOT}/tool/compile_gatt.py $< $@
121*1664436fSMatthias Ringwald
122*1664436fSMatthias Ringwald
123*1664436fSMatthias Ringwaldled_counter.out: ${CORE_OBJ} ${COMMON_OBJ} ${CC2560B} led_counter.o
124*1664436fSMatthias Ringwald	${CC} $^ ${LDFLAGS} -o $@
125*1664436fSMatthias Ringwald
126*1664436fSMatthias Ringwaldant-test.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} profile.h sdp_server.o ant_cmds.o ${CC2567} ant-test.o
127*1664436fSMatthias Ringwald	${CC} $^ ${LDFLAGS} -o $@
128*1664436fSMatthias Ringwald
129*1664436fSMatthias Ringwaldble_server.out: ${CORE_OBJ} ${COMMON_OBJ} ${BLE_OBJ} ${LCD_OBJ} profile.h ble_server.o
130*1664436fSMatthias Ringwald	${CC} $^ ${LDFLAGS} -o $@
131*1664436fSMatthias Ringwald
132*1664436fSMatthias Ringwaldhid_demo.out: ${CORE_OBJ} ${COMMON_OBJ} ${LCD_OBJ} ${SPP_OBJ} ${CC2560B} hid_demo.o
133*1664436fSMatthias Ringwald	${CC} $^ ${LDFLAGS} -o $@
134*1664436fSMatthias Ringwald
135*1664436fSMatthias Ringwaldspp_accel.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${CC2560B} spp_accel.o sdp_server.o hal_adc.o
136*1664436fSMatthias Ringwald	${CC} $^ ${LDFLAGS} -o $@
137*1664436fSMatthias Ringwald
138*1664436fSMatthias Ringwaldspp_and_gatt_counter.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${BLE_OBJ} spp_and_gatt_counter.h spp_and_gatt_counter.o sdp_server.o
139*1664436fSMatthias Ringwald	${CC} $^ ${LDFLAGS} -o $@
140*1664436fSMatthias Ringwald
141*1664436fSMatthias Ringwaldspp_counter.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${CC2560B} spp_counter.o sdp_server.o
142*1664436fSMatthias Ringwald	${CC} $^ ${LDFLAGS} -o $@
143*1664436fSMatthias Ringwald
144*1664436fSMatthias Ringwaldspp_flowcontrol.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${CC2560B} spp_flowcontrol.o sdp_server.o
145*1664436fSMatthias Ringwald	${CC} $^ ${LDFLAGS} -o $@
146*1664436fSMatthias Ringwald
147*1664436fSMatthias Ringwaldgap_inquiry.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${CC2560B} ad_parser.o gap_inquiry.o
148*1664436fSMatthias Ringwald	${CC} $^ ${LDFLAGS} -o $@
149*1664436fSMatthias Ringwald
150*1664436fSMatthias Ringwaldsdp_rfcomm_query.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${SDP_CLIENT} ${CC2560B} sdp_rfcomm_query.o
151*1664436fSMatthias Ringwald	${CC} $^ ${LDFLAGS} -o $@
152*1664436fSMatthias Ringwald
153*1664436fSMatthias Ringwaldsdp_general_query.out: ${CORE_OBJ} ${COMMON_OBJ} ${SPP_OBJ} ${SDP_CLIENT} ${CC2560B} sdp_general_query.o
154*1664436fSMatthias Ringwald	${CC} $^ ${LDFLAGS} -o $@
155*1664436fSMatthias Ringwald
156*1664436fSMatthias Ringwaldclean:
157*1664436fSMatthias Ringwald	rm -f $ *.o *.out *.hex profile.h spp_and_gatt_counter.h
158*1664436fSMatthias Ringwald
159*1664436fSMatthias Ringwaldsize: all
160*1664436fSMatthias Ringwald	msp430-size *.o
161*1664436fSMatthias Ringwald	msp430-size *.out
162