0392839ed1c5fe296c1f4e5f67f7f04198f312f7
[goodfet] / firmware / config.mk
1 ##################################
2 ## These are production boards.
3 ##################################
4 mcu = undef
5
6 ifneq (,$(findstring $(board),goodfet20 goodfet10 goodfet11))
7 mcu := msp430x1612
8 platform := goodfet
9 endif
10
11 ifneq (,$(findstring $(board),goodfet21))
12 mcu := msp430x2618
13 platform := goodfet
14 endif
15
16 ifneq (,$(findstring $(board),goodfet30 goodfet31))
17 mcu := msp430x2274
18 platform := goodfet
19 # This will link to fit in a '2254, so unneeded packages should be omited.
20 CONFIG_ccspi = n
21 endif
22
23 ifneq (,$(findstring $(board),goodfet40 goodfet41))
24 mcu := msp430x2618
25 platform := goodfet
26 endif
27
28 ifneq (,$(findstring $(board),nhb12b))
29 mcu := msp430x2618
30 CONFIG_nrf = y
31 platform := nhb12b
32 endif
33
34 ifneq (,$(findstring $(board),nhb12))
35 mcu := msp430x2618
36 CONFIG_nrf = y
37 platform := nhb12
38 endif
39
40 ifneq (,$(findstring $(board),goodfet50 goodfet51))
41 mcu := msp430x5510
42 platform := goodfet
43 endif
44
45 ifneq (,$(findstring $(board),telosb))
46 mcu :=msp430x1612
47 platform := goodfet
48 CFLAGS := -Dtelosb
49 #CFLAGS+= -Werror
50 config := monitor spi ccspi
51 endif
52
53 ifneq (,$(findstring $(board),telosbbt))
54 mcu :=msp430x1612
55 platform := goodfet
56 #CFLAGS+= -Werror
57 config := monitor spi ccspi
58 endif
59
60
61
62
63 ##################################
64 ## These are experimental boards.
65 ##################################
66
67 ifneq (,$(findstring $(board),donbfet))
68 GCC := avr-gcc
69 mcu := atmega644p
70 CFLAGS=$(DEBUG) -mmcu=$(mcu) -W -Os -mcall-prologues -Wall -Wextra -Wuninitialized -fpack-struct -fshort-enums -funsigned-bitfields
71 config := monitor avr spi jscan
72 endif
73
74 ifneq (,$(findstring $(board),arduino))
75 GCC := avr-gcc
76 mcu := atmega168
77 #BSL := avrdude -V -F -c stk500v1 -p m328p -b 57600 -P /dev/tty.usbserial-* -U flash:w:blink.hex
78 LDFLAGS := 
79 config := monitor
80 endif
81
82 ifneq (,$(findstring $(board),tilaunchpad))
83 mcu :=msp430x1612
84 CFLAGS := -DDEBUG_LEVEL=3 -DDEBUG_START=1 -DINBAND_DEBUG
85 #CFLAGS+= -Werror
86 config := monitor chipcon i2c
87 endif
88
89
90
91
92 ifeq ($(mcu),undef)
93 $(error Please define board, as explained in the README)
94 endif
95 #platform := $(board)
96
97 AVAILABLE_APPS = monitor spi jtag sbw jtag430 jtag430x2 i2c jtagarm7 ejtag jtagxscale openocd chipcon avr pic adc nrf ccspi glitch smartcard ps2 slc2 
98
99 # defaults
100 CONFIG_monitor    ?= y
101 CONFIG_spi        ?= y
102 CONFIG_jtag       ?= n
103 CONFIG_sbw        ?= n
104 CONFIG_jtag430    ?= y
105 CONFIG_jtag430x2  ?= y
106 CONFIG_i2c        ?= n
107 CONFIG_jtagarm7   ?= n
108 CONFIG_ejtag      ?= n
109 CONFIG_jtagxscale ?= n
110 CONFIG_openocd    ?= y
111 CONFIG_chipcon    ?= y
112 CONFIG_avr        ?= y
113 CONFIG_pic        ?= n
114 CONFIG_adc        ?= n
115 CONFIG_nrf        ?= n
116 CONFIG_ccspi      ?= y
117 CONFIG_glitch     ?= n
118 CONFIG_smartcard  ?= n
119 CONFIG_ps2        ?= n
120 CONFIG_slc2       ?= n
121
122 #The CONFIG_foo vars are only interpreted if $(config) is unset.
123 ifeq ($(config),undef)
124 config += $(foreach app,$(AVAILABLE_APPS),$(if $(findstring $(CONFIG_$(app)),y yes t true Y YES T TRUE),$(app)))
125 endif