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