Getting closer to working Cortex M3 targets.
[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),goodfet20 goodfet10 goodfet11))
9 mcu ?= msp430f1612
10 platform := goodfet
11 endif
12
13 ifneq (,$(findstring $(board),goodfet21))
14 mcu ?= msp430f2618
15 platform := goodfet
16 endif
17
18 ifneq (,$(findstring $(board),goodfet30 goodfet31))
19 mcu ?= msp430f2274
20 platform := goodfet
21 # This will link to fit in a '2254, so unneeded packages should be omited.
22 CONFIG_ccspi = n
23 CONFIG_nrf = y
24 endif
25
26 ifneq (,$(findstring $(board),goodfet40 goodfet41))
27 mcu ?= msp430f2618
28 platform := goodfet
29 CONFIG_nrf = y
30 endif
31
32 ifneq (,$(findstring $(board),stm32f4discovery))
33 GCC     = arm-none-eabi-gcc
34 CC      = arm-none-eabi-gcc
35 LD      = arm-none-eabi-ld -v
36 AR      = arm-none-eabi-ar
37 AS      = arm-none-eabi-as
38 CP      = arm-none-eabi-objcopy
39 OD      = arm-none-eabi-objdump
40 CFLAGS  =  -I./ -Iinclude/ -c -fno-common -O1 -g -mcpu=cortex-m3 -mthumb 
41 AFLAGS  = -ahls -mapcs-32
42 LFLAGS  = -Ttmplink.cmd -nostartfiles
43 CPFLAGS = -Obinary
44 ODFLAGS = -S
45 LDFLAGS = 
46
47 mcu ?= stm32f407
48 platform := stm32f4discovery
49 config = monitor
50 extralibs = lib/cortexm3.o
51 endif
52
53 ifneq (,$(findstring $(board),facedancer10))
54 mcu ?= msp430f2618
55 platform := goodfet
56 config = monitor spi maxusb
57 endif
58
59 ifeq ($(board),z1)
60 mcu ?= msp430f2617
61 platform := z1
62 config = monitor spi ccspi
63 MSP430BSL?=goodfet.bsl --z1  --speed=38400
64 endif
65
66 ifneq (,$(findstring $(board),goodfet24))
67 mcu ?= msp430f2618
68 platform := goodfet
69 CONFIG_glitch = y
70 endif
71
72 ifneq (,$(findstring $(board),nhb12b))
73 mcu ?= msp430f2618
74 CONFIG_nrf = y
75 platform := nhb12b
76 endif
77
78 ifneq (,$(findstring $(board),nhb12))
79 mcu ?= msp430f2618
80 CONFIG_nrf = y
81 platform := nhb12
82 endif
83
84 ifneq (,$(findstring $(board),goodfet50 goodfet51))
85 mcu ?= msp430f5510
86 platform := goodfet
87 endif
88
89 ifeq ($(board),telosb)
90 mcu ?= msp430f1611
91 platform := telosb
92 config := monitor spi ccspi
93 CFLAGS += -Duseuart1
94 endif
95
96 ifeq ($(board),telosbbt)
97 mcu ?=msp430f1612
98 platform := telosb
99 config := monitor spi ccspi
100 endif
101
102
103
104
105 ##################################
106 ## These are experimental boards.
107 ##################################
108
109 ifneq (,$(findstring $(board),donbfet))
110 GCC := avr-gcc
111 CC := avr-gcc
112 mcu ?= atmega644p
113 platform = donbfet
114 CFLAGS=$(DEBUG) -Iinclude -mmcu=$(mcu) -W -Os -mcall-prologues -Wall -Wextra -Wuninitialized -fpack-struct -fshort-enums -funsigned-bitfields
115 config := monitor avr spi jscan
116 endif
117
118 ifneq (,$(findstring $(board),arduino))
119 GCC := avr-gcc
120 mcu ?= atmega168
121 #BSL := avrdude -V -F -c stk500v1 -p m328p -b 57600 -P /dev/tty.usbserial-* -U flash:w:blink.hex
122 LDFLAGS := 
123 config := monitor
124 endif
125
126 ifneq (,$(findstring $(board),tilaunchpad))
127 mcu ?=msp430f1612
128 CFLAGS := -DDEBUG_LEVEL=3 -DDEBUG_START=1 -DINBAND_DEBUG
129 CFLAGS+= -Werror -Wall
130 config := monitor chipcon i2c
131 endif
132
133
134
135 mcu ?= undef
136 ifeq ($(mcu),undef)
137 $(error Please define board, as explained in the README)
138 endif
139 #platform := $(board)
140
141 AVAILABLE_APPS = monitor spi jtag sbw jtag430 jtag430x2 i2c jtagarm7 ejtag jtagxscale openocd chipcon avr pic adc nrf ccspi glitch smartcard ps2 slc2  maxusb
142
143 # defaults
144 CONFIG_monitor    ?= y
145 CONFIG_spi        ?= y
146 CONFIG_maxusb     ?= y
147 CONFIG_jtag       ?= n
148 CONFIG_sbw        ?= n
149 CONFIG_jtag430    ?= y
150 CONFIG_jtag430x2  ?= y
151 CONFIG_i2c        ?= n
152 CONFIG_jtagarm7   ?= n
153 CONFIG_ejtag      ?= n
154 CONFIG_jtagxscale ?= n
155 CONFIG_openocd    ?= y
156 CONFIG_chipcon    ?= y
157 CONFIG_avr        ?= y
158 CONFIG_pic        ?= n
159 CONFIG_adc        ?= n
160 CONFIG_nrf        ?= n
161 CONFIG_ccspi      ?= n
162 CONFIG_glitch     ?= n
163 CONFIG_smartcard  ?= n
164 CONFIG_ps2        ?= n
165 CONFIG_slc2       ?= n
166
167 #The CONFIG_foo vars are only interpreted if $(config) is "unset".
168 ifeq ($(config),undef)
169 config += $(foreach app,$(AVAILABLE_APPS),$(if $(findstring $(CONFIG_$(app)),y yes t true Y YES T TRUE),$(app)))
170 endif