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