554e79a459786dae022e0656bf59cc3ffe44aff5
[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 endif
51
52 ifneq (,$(findstring $(board),facedancer10))
53 mcu ?= msp430f2618
54 platform := goodfet
55 config = monitor spi maxusb
56 endif
57
58 ifeq ($(board),z1)
59 mcu ?= msp430f2617
60 platform := z1
61 config = monitor spi ccspi
62 MSP430BSL?=goodfet.bsl --z1  --speed=38400
63 endif
64
65 ifneq (,$(findstring $(board),goodfet24))
66 mcu ?= msp430f2618
67 platform := goodfet
68 CONFIG_glitch = y
69 endif
70
71 ifneq (,$(findstring $(board),nhb12b))
72 mcu ?= msp430f2618
73 CONFIG_nrf = y
74 platform := nhb12b
75 endif
76
77 ifneq (,$(findstring $(board),nhb12))
78 mcu ?= msp430f2618
79 CONFIG_nrf = y
80 platform := nhb12
81 endif
82
83 ifneq (,$(findstring $(board),goodfet50 goodfet51))
84 mcu ?= msp430f5510
85 platform := goodfet
86 endif
87
88 ifeq ($(board),telosb)
89 mcu ?= msp430f1611
90 platform := telosb
91 config := monitor spi ccspi
92 CFLAGS += -Duseuart1
93 endif
94
95 ifeq ($(board),telosbbt)
96 mcu ?=msp430f1612
97 platform := telosb
98 config := monitor spi ccspi
99 endif
100
101
102
103
104 ##################################
105 ## These are experimental boards.
106 ##################################
107
108 ifneq (,$(findstring $(board),donbfet))
109 GCC := avr-gcc
110 CC := avr-gcc
111 mcu ?= atmega644p
112 platform = donbfet
113 CFLAGS=$(DEBUG) -Iinclude -mmcu=$(mcu) -W -Os -mcall-prologues -Wall -Wextra -Wuninitialized -fpack-struct -fshort-enums -funsigned-bitfields
114 config := monitor avr spi jscan
115 endif
116
117 ifneq (,$(findstring $(board),arduino))
118 GCC := avr-gcc
119 mcu ?= atmega168
120 #BSL := avrdude -V -F -c stk500v1 -p m328p -b 57600 -P /dev/tty.usbserial-* -U flash:w:blink.hex
121 LDFLAGS := 
122 config := monitor
123 endif
124
125 ifneq (,$(findstring $(board),tilaunchpad))
126 mcu ?=msp430f1612
127 CFLAGS := -DDEBUG_LEVEL=3 -DDEBUG_START=1 -DINBAND_DEBUG
128 CFLAGS+= -Werror -Wall
129 config := monitor chipcon i2c
130 endif
131
132
133
134 mcu ?= undef
135 ifeq ($(mcu),undef)
136 $(error Please define board, as explained in the README)
137 endif
138 #platform := $(board)
139
140 AVAILABLE_APPS = monitor spi jtag sbw jtag430 jtag430x2 i2c jtagarm7 ejtag jtagxscale openocd chipcon avr pic adc nrf ccspi glitch smartcard ps2 slc2  maxusb
141
142 # defaults
143 CONFIG_monitor    ?= y
144 CONFIG_spi        ?= y
145 CONFIG_maxusb     ?= y
146 CONFIG_jtag       ?= n
147 CONFIG_sbw        ?= n
148 CONFIG_jtag430    ?= y
149 CONFIG_jtag430x2  ?= y
150 CONFIG_i2c        ?= n
151 CONFIG_jtagarm7   ?= n
152 CONFIG_ejtag      ?= n
153 CONFIG_jtagxscale ?= n
154 CONFIG_openocd    ?= y
155 CONFIG_chipcon    ?= y
156 CONFIG_avr        ?= y
157 CONFIG_pic        ?= n
158 CONFIG_adc        ?= n
159 CONFIG_nrf        ?= n
160 CONFIG_ccspi      ?= n
161 CONFIG_glitch     ?= n
162 CONFIG_smartcard  ?= n
163 CONFIG_ps2        ?= n
164 CONFIG_slc2       ?= n
165
166 #The CONFIG_foo vars are only interpreted if $(config) is "unset".
167 ifeq ($(config),undef)
168 config += $(foreach app,$(AVAILABLE_APPS),$(if $(findstring $(CONFIG_$(app)),y yes t true Y YES T TRUE),$(app)))
169 endif