summaryrefslogtreecommitdiff
path: root/src/stm-bringup/Makefile
diff options
context:
space:
mode:
authorBdale Garbee <bdale@gag.com>2012-09-12 20:01:22 -0600
committerBdale Garbee <bdale@gag.com>2012-09-12 20:01:22 -0600
commit3b612efcd1dddc6a3d59012f7ed57754b1f798c2 (patch)
tree18d50713491ef96c5c127a309f870efb6c33f98d /src/stm-bringup/Makefile
parente076773c1693e2a62bb828dee71c04c20dbab0a5 (diff)
parent01eb36408d7e0e826b431fcc1d3b2deb23607e0b (diff)
Merge branch 'new-debian' into debian
Conflicts: ChangeLog debian/altos.install debian/changelog debian/control debian/copyright debian/dirs debian/docs debian/menu debian/rules src/Makefile
Diffstat (limited to 'src/stm-bringup/Makefile')
-rw-r--r--src/stm-bringup/Makefile46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/stm-bringup/Makefile b/src/stm-bringup/Makefile
new file mode 100644
index 00000000..d45e836d
--- /dev/null
+++ b/src/stm-bringup/Makefile
@@ -0,0 +1,46 @@
+vpath % ..:../core:../product:../drivers:../stm
+vpath ao-make-product.5c ../util
+
+ifndef VERSION
+include ../Version
+endif
+
+CC=arm-none-eabi-gcc
+OBJCOPY=arm-none-eabi-objcopy
+
+PDCLIB=/home/keithp/sat
+C_LIB=$(PDCLIB)/lib/pdclib.a
+C_INC=-I$(PDCLIB)/include
+
+DEF_CFLAGS=-g -std=gnu99 -Os -mlittle-endian -mthumb -ffreestanding -nostdlib -I../../src/stm $(C_INC)
+
+# to run from SRAM
+LD_FLAGS_RAM=-L../stm -Wl,-Taltos-ram.ld
+LD_FLAGS=-L../stm -Wl,-Tbringup.ld
+
+CFLAGS=$(DEF_CFLAGS) -mcpu=cortex-m3 -DCONFIG_STM32L_DISCOVERY
+
+SRC=bringup.c ao_interrupt.c
+OBJ=$(SRC:.c=.o)
+
+all: bringup-ram.elf bringup.elf
+
+%.bin: %.elf
+ $(OBJCOPY) -O binary $^ $@
+
+bringup.elf: $(OBJ) $(C_LIB) bringup.ld
+ $(CC) $(CFLAGS) $(LD_FLAGS) -o $@ $(OBJ) $(C_LIB) -lgcc
+
+bringup-ram.elf: $(OBJ) $(C_LIB) altos-ram.ld
+ $(CC) $(CFLAGS) $(LD_FLAGS_RAM) -o $@ $(OBJ) $(C_LIB) -lgcc
+
+clean:
+ rm -f *.o
+ rm -rf *.elf
+ rm -rf *.bin
+
+.PHONY: all clean
+
+install:
+
+uninstall: