Working toward some ARM targets.
[goodfet] / firmware / Makefile
index 4df4028..35a8bb6 100644 (file)
@@ -12,18 +12,14 @@ MSP430BSL?=goodfet.bsl --speed=38400
 JTAG=msp430-jtag
 
 
-#N.B., gcc WILL NOT BITCH if this file doesn't exist.
 GCCINC?=
 
-#GCC?=avr-gcc
-# We use -Wl,-dT because gcc adds the msp430mcu definitions at the
-# very end of the command line, so they only have an effect for a
-# default linker script
-GCC?=msp430-gcc
+#All of these are ?= in order ot allow overriding.
+GCC?=msp430-gcc -mmcu=$(mcu)
 LDFLAGS?=-mmcu=$(mcu) #-Wl,-dT ldscripts/$(mcu).x
 
-CCEXTRA?=  $(CFLAGS) -D$(mcu) -D$(platform) -Dplatform=$(platform) -Dboard=$(board) $(GCCINC) -I include -I platforms
-CC=$(GCC) -Wall -O1 -fno-strict-aliasing -g -mmcu=$(mcu)  $(CCEXTRA)
+CCEXTRA ?=  $(CFLAGS) -D$(mcu) -D$(platform) -Dplatform=$(platform) -Dboard=$(board) $(GCCINC) -I include -I platforms
+CC =$(GCC) -Wall -O1 -fno-strict-aliasing -g   $(CCEXTRA)
 
 # Available Applications
 # ======================
@@ -98,7 +94,7 @@ CC=$(GCC) -Wall -O1 -fno-strict-aliasing -g -mmcu=$(mcu)  $(CCEXTRA)
 ifeq ($(platform),tilaunchpad)
 config ?= monitor chipcon i2c
 else
-config ?= monitor chipcon spi jtag430 jtag430x2 avr openocd ccspi
+config ?= monitor chipcon spi jtag430 jtag430x2 avr openocd ccspi maxusb
 endif
 
 
@@ -141,6 +137,14 @@ ifeq ($(filter jtag, $(config)), jtag)
        endif
 endif
 
+# include MAX342x USB drivers.
+ifeq ($(filter maxusb, $(config)), maxusb)
+       ifneq ($(filter apps/usb/maxusb.o, $(apps)), apps/usb/maxusb.o)
+               apps+= apps/usb/maxusb.o
+               hdrs+= maxusb.h
+       endif
+endif
+
 # include the sbw defs if they specified it
 ifeq ($(filter sbw, $(config)), sbw)
        # if they only specify sbw, include jtag