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