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