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