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