Removed Werror, so launchpad code compiles again.
[goodfet] / firmware / config.mk
1 ##################################
2 ## These are production boards.
3 ##################################
4
5 #Unset by default, but can be explicitly set later.
6 config=undef
7
8 ifneq (,$(findstring $(board),apimote1))
9 mcu ?= msp430f2618
10 platform := apimote1
11 config := monitor spi ccspi
12 MSP430BSL?=goodfet.bsl --speed=38400 --swap-reset-test
13 CFLAGS += -Duseuart1 -Dapimote
14 endif
15
16 ifneq (,$(findstring $(board),goodthopter01 goodthopter10))
17 mcu ?= msp430f2274
18 platform := goodfet
19 config := monitor spi
20 endif
21
22 ifneq (,$(findstring $(board),goodfet20 goodfet10 goodfet11))
23 mcu ?= msp430f1612
24 platform := goodfet
25 endif
26
27 ifneq (,$(findstring $(board),goodfet21))
28 mcu ?= msp430f2618
29 platform := goodfet
30 endif
31
32 ifneq (,$(findstring $(board),goodfet30 goodfet31))
33 mcu ?= msp430f2274
34 platform := goodfet
35 # This will link to fit in a '2254, so unneeded packages should be omited.
36 CONFIG_ccspi = n
37 CONFIG_nrf = y
38 endif
39
40 ifneq (,$(findstring $(board),goodfet40 goodfet41))
41 mcu ?= msp430f2618
42 platform := goodfet
43 CONFIG_nrf = y
44 endif
45
46 ifneq (,$(findstring $(board),stm32f4discovery))
47
48 periph ?= /opt/STM32F4xx_StdPeriph_Driver
49 discovery ?= /opt/STM32F4-Discovery_FW_V1.1.0
50
51 usbcore ?= $(discovery)/Libraries/STM32_USB_Device_Library/Core
52 usbsrc ?= $(usbcore)/src
53 otginc ?= /opt/STM32F4-Discovery_FW_V1.1.0/Libraries/STM32_USB_OTG_Driver/inc
54 otgsrc ?= /opt/STM32F4-Discovery_FW_V1.1.0/Libraries/STM32_USB_OTG_Driver/src
55
56 pincs ?=  -I$(periph)/inc -I$(usbcore)/inc -I$(otginc) -I$(discovery)/Libraries/CMSIS/ST/STM32F4xx/Include  -I$(discovery)/Libraries/CMSIS/Include -Dassert_param\(x\)= -DUSE_USB_OTG_FS -I/opt/STM32F4-Discovery_FW_V1.1.0/Utilities/STM32F4-Discovery
57 psrc ?=  /opt/STM32F4xx_StdPeriph_Driver/src
58
59
60 GCC     = arm-none-eabi-gcc
61 CC      = arm-none-eabi-gcc
62 LD      = arm-none-eabi-ld -v
63 AR      = arm-none-eabi-ar
64 AS      = arm-none-eabi-as
65 CP      = arm-none-eabi-objcopy
66 OD      = arm-none-eabi-objdump
67 CFLAGS  = -c -fno-common -O1 -g -mcpu=cortex-m3 -mthumb $(pincs)
68 AFLAGS  = -ahls -mapcs-32
69 LFLAGS  = -Ttmplink.cmd -nostartfiles
70 CPFLAGS = -Obinary
71 ODFLAGS = -S
72 LDFLAGS = 
73
74
75 mcu ?= stm32f407
76 platform := stm32f4discovery
77 config = monitor
78
79 # This is a pain.
80 #usblibs =  $(usbsrc)/usbd_core.o $(usbsrc)/usbd_req.o $(usbsrc)/usbd_ioreq.o $(usbsrc)/usbd_core.o $(otgsrc)/usb_dcd.o $(otgsrc)/usb_dcd_int.o $(otgsrc)/usb_hcd.o $(otgsrc)/usb_hcd_int.o $(otgsrc)/usb_otg.o
81 extralibs = lib/cortexm3.o lib/system_stm32f4xx.o lib/stm32f4xx_rcc.o $(psrc)/stm32f4xx_gpio.o $(psrc)/stm32f4xx_usart.o $(usblibs) 
82
83 endif
84
85 ifneq (,$(findstring $(board),facedancer10 facedancer11))
86 mcu ?= msp430f2618
87 platform := goodfet
88 config = monitor spi maxusb
89 endif
90
91 ifeq ($(board),z1)
92 mcu ?= msp430f2617
93 platform := z1
94 config = monitor spi ccspi
95 MSP430BSL?=goodfet.bsl --z1  --speed=38400
96 endif
97
98 ifneq (,$(findstring $(board),goodfet24))
99 mcu ?= msp430f2618
100 platform := goodfet
101 CONFIG_glitch = y
102 endif
103
104 ifneq (,$(findstring $(board),nhb12b))
105 mcu ?= msp430f2618
106 CONFIG_nrf = y
107 platform := nhb12b
108 endif
109
110 ifneq (,$(findstring $(board),nhb12))
111 mcu ?= msp430f2618
112 CONFIG_nrf = y
113 platform := nhb12
114 endif
115
116 ifneq (,$(findstring $(board),goodfet50 goodfet51))
117 mcu ?= msp430f5510
118 platform := goodfet
119 endif
120
121 ifeq ($(board),telosb)
122 mcu ?= msp430f1611
123 platform := telosb
124 config := monitor spi ccspi
125 CFLAGS += -Duseuart1
126 endif
127
128 ifeq ($(board),telosbbt)
129 mcu ?=msp430f1612
130 platform := telosb
131 config := monitor spi ccspi
132 endif
133
134
135
136
137 ##################################
138 ## These are experimental boards.
139 ##################################
140
141 ifneq (,$(findstring $(board),donbfet))
142 GCC := avr-gcc
143 CC := avr-gcc
144 mcu ?= atmega644p
145 platform = donbfet
146 CFLAGS=$(DEBUG) -Iinclude -mmcu=$(mcu) -W -Os -mcall-prologues -Wall -Wextra -Wuninitialized -fpack-struct -fshort-enums -funsigned-bitfields
147 config := monitor avr spi jscan
148 endif
149
150 ifneq (,$(findstring $(board),arduino))
151 GCC := avr-gcc
152 mcu ?= atmega168
153 #BSL := avrdude -V -F -c stk500v1 -p m328p -b 57600 -P /dev/tty.usbserial-* -U flash:w:blink.hex
154 LDFLAGS := 
155 config := monitor
156 endif
157
158 ifneq (,$(findstring $(board),tilaunchpad))
159 mcu ?=msp430f1612
160 CFLAGS := -DDEBUG_LEVEL=3 -DDEBUG_START=1 -DINBAND_DEBUG
161 CFLAGS+= -Wall
162 config := monitor chipcon i2c
163 endif
164
165
166
167 mcu ?= undef
168 ifeq ($(mcu),undef)
169 $(error Please define board, as explained in the README)
170 endif
171 #platform := $(board)
172
173 AVAILABLE_APPS = monitor spi jtag sbw jtag430 jtag430x2 i2c jtagarm7 ejtag jtagxscale openocd chipcon avr pic adc nrf ccspi glitch smartcard ps2 slc2  maxusb
174
175 # defaults
176 CONFIG_monitor    ?= y
177 CONFIG_spi        ?= y
178 CONFIG_maxusb     ?= y
179 CONFIG_jtag       ?= n
180 CONFIG_sbw        ?= n
181 CONFIG_jtag430    ?= y
182 CONFIG_jtag430x2  ?= y
183 CONFIG_i2c        ?= n
184 CONFIG_jtagarm7   ?= n
185 CONFIG_ejtag      ?= n
186 CONFIG_jtagxscale ?= n
187 CONFIG_openocd    ?= y
188 CONFIG_chipcon    ?= y
189 CONFIG_avr        ?= y
190 CONFIG_pic        ?= n
191 CONFIG_adc        ?= n
192 CONFIG_nrf        ?= n
193 CONFIG_ccspi      ?= n
194 CONFIG_glitch     ?= n
195 CONFIG_smartcard  ?= n
196 CONFIG_ps2        ?= n
197 CONFIG_slc2       ?= n
198
199 #The CONFIG_foo vars are only interpreted if $(config) is "unset".
200 ifeq ($(config),undef)
201 config += $(foreach app,$(AVAILABLE_APPS),$(if $(findstring $(CONFIG_$(app)),y yes t true Y YES T TRUE),$(app)))
202 endif