diff options
author | Perry Hung <iperry@alum.mit.edu> | 2010-05-28 03:06:03 -0400 |
---|---|---|
committer | Perry Hung <iperry@alum.mit.edu> | 2010-05-28 03:06:03 -0400 |
commit | 5b9c5d9c9388f58c0d08c398dc368ca40460830a (patch) | |
tree | 3f9fb49a69acd4c0f2d05733b30eb32af5acb006 /Makefile | |
parent | cf068bc0ac946391c940a79ee2e55e1ff87eb79a (diff) | |
download | librambutan-5b9c5d9c9388f58c0d08c398dc368ca40460830a.tar.gz librambutan-5b9c5d9c9388f58c0d08c398dc368ca40460830a.zip |
libcs3 refactor merge
Removed dependency on libcs3.a because Codesourcery does not provide the
source for it.
We now link against a modified libcs3-lanchon-stm32.a built from parts
in public domain from Lanchon, and a start_c.c from Codesourcery that is
licensed under a permissive license.
Also removed all of the extra linker cruft from the stm32conf directory.
The linker files now live in support/ld
The openocd scripts now live in support/openocd
The udev rules and copy-to-ide scripts now live in support/scripts
The source lives in support/ld/libcs3-lanchon-stm32.tar.gz
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 67 |
1 files changed, 32 insertions, 35 deletions
@@ -2,8 +2,6 @@ # Project name PROJECT=maple -STM_CONF = stm32conf/flash.conf - # ARM/GNU toolchain parameters CC := arm-none-eabi-gcc CPP := arm-none-eabi-g++ @@ -27,35 +25,34 @@ else endif BUILD_PATH = build -LIB_PATH = libmaple - -OUTDIRS = $(BUILD_PATH)/$(LIB_PATH)\ - $(BUILD_PATH)/wirish \ - $(BUILD_PATH)/wirish/comm \ - $(BUILD_PATH)/$(LIB_PATH)/usb \ - $(BUILD_PATH)/$(LIB_PATH)/usb/usb_lib - - -INCLUDES = -I$(LIB_PATH) \ - -I./ \ - -Iwirish \ - -Iwirish/comm \ - -I$(LIB_PATH)/usb \ - -I$(LIB_PATH)/usb/usb_lib - -# default is to upload to flash -#DEFFLAGS = VECT_TAB_BASE -CFLAGS = $(INCLUDES) -c \ - -Os\ - -g -mcpu=cortex-m3 -mthumb -march=armv7-m -nostdlib \ - -ffunction-sections -fdata-sections -Wl,--gc-sections \ - -D$(DEFFLAGS) +LIB_PATH = libmaple + +OUTDIRS = $(BUILD_PATH)/$(LIB_PATH) \ + $(BUILD_PATH)/wirish \ + $(BUILD_PATH)/wirish/comm \ + $(BUILD_PATH)/$(LIB_PATH)/usb \ + $(BUILD_PATH)/$(LIB_PATH)/usb/usb_lib + + + +INCLUDES = -I$(LIB_PATH) \ + -I./ \ + -Iwirish \ + -Iwirish/comm \ + -I$(LIB_PATH)/usb \ + -I$(LIB_PATH)/usb/usb_lib + +CFLAGS = $(INCLUDES) -c \ + -Os \ + -g -mcpu=cortex-m3 -mthumb -march=armv7-m -nostdlib \ + -ffunction-sections -fdata-sections -Wl,--gc-sections \ + -D$(DEFFLAGS) CXXFLAGS = -fno-rtti -fno-exceptions -Wall -#LINKER=lanchon-stm32.ld -LFLAGS = -Tstm32conf/$(LINKER) -L stm32conf/lanchon-stm32 \ - -mcpu=cortex-m3 -mthumb -Xlinker \ +LDDIR=support/ld +LFLAGS = -T$(LDDIR)/$(LDSCRIPT) -L$(LDDIR) \ + -mcpu=cortex-m3 -mthumb -Xlinker \ --gc-sections --print-gc-sections --march=armv7-m -Wall CPFLAGS = -v -Obinary @@ -184,17 +181,17 @@ $(BUILD_PATH)/main.bin: $(BUILD_PATH)/$(PROJECT).out arm-none-eabi-size $< ram: DEFFLAGS := VECT_TAB_RAM -ram: LINKER := lanchon-stm32-user-ram.ld +ram: LDSCRIPT := ram.ld ram: $(BUILD_PATH)/main.bin @echo "RAM build" -flash: DEFFLAGS := VECT_TAB_ROM -flash: LINKER := lanchon-stm32-user-rom.ld +flash: DEFFLAGS := VECT_TAB_FLASH +flash: LDSCRIPT := flash.ld flash: $(BUILD_PATH)/main.bin @echo "Flash build" jtag: DEFFLAGS := VECT_TAB_BASE -jtag: LINKER := lanchon-stm32.ld +jtag: LDSCRIPT := jtag.ld jtag: $(BUILD_PATH)/main.bin @echo "JTAG build" @@ -209,15 +206,15 @@ program_flash: flash $(DFU) -a1 -d $(VENDOR_ID):$(PRODUCT_ID) -D build/main.bin -R program_jtag: jtag - openocd -f stm32conf/flash.cfg + openocd -f support/openocd/flash.cfg run: $(BUILD_PATH)/main.bin - openocd -f stm32conf/run.cfg + openocd -f support/openocd/run.cfg cscope: rm -rf *.cscope - find . -name '*.[hcs]' -o -name '*.cpp' | xargs cscope + find . -name '*.[hcs]' -o -name '*.cpp' | xargs cscope -b clean: rm -f *.hex *.o |