More code cleanup. Broke support for the Launchpad.
[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),tilaunchpad))
43 mcu :=msp430x1612
44 CFLAGS := -DDEBUG_LEVEL=3 -DDEBUG_START=1 -DINBAND_DEBUG
45 #CFLAGS+= -Werror
46 config := monitor chipcon i2c
47 endif
48
49
50
51
52 ifeq ($(mcu),undef)
53 $(error Please define board, as explained in the README)
54 endif
55 platform := $(board)
56
57 AVAILABLE_APPS = monitor spi jtag sbw jtag430 jtag430x2 i2c jtagarm7 ejtag jtagxscale openocd chipcon avr pic adc nrf ccspi glitch smartcard ps2 
58
59 CONFIG_sbw         = y
60
61 # defaults
62 CONFIG_monitor    ?= y
63 CONFIG_spi        ?= y
64 CONFIG_jtag       ?= n
65 CONFIG_sbw        ?= n
66 CONFIG_jtag430    ?= y
67 CONFIG_jtag430x2  ?= y
68 CONFIG_i2c        ?= n
69 CONFIG_jtagarm7   ?= n
70 CONFIG_ejtag      ?= n
71 CONFIG_jtagxscale ?= n
72 CONFIG_openocd    ?= y
73 CONFIG_chipcon    ?= y
74 CONFIG_avr        ?= y
75 CONFIG_pic        ?= n
76 CONFIG_adc        ?= n
77 CONFIG_nrf        ?= n
78 CONFIG_ccspi      ?= y
79 CONFIG_glitch     ?= n
80 CONFIG_smartcard  ?= n
81 CONFIG_ps2        ?= n
82
83 #The CONFIG_foo vars are only interpreted if $(config) is unset.
84 ifeq ($(config),undef)
85 config := $(foreach app,$(AVAILABLE_APPS),$(if $(findstring $(CONFIG_$(app)),y yes t true Y YES T TRUE),$(app)))
86 endif