]> git.gag.com Git - fw/altos/blob - src/stm-bringup/Makefile
update Releasing for non-native versioning and builds on debian branch
[fw/altos] / src / stm-bringup / Makefile
1 vpath % ..:../core:../product:../drivers:../stm
2 vpath ao-make-product.5c ../util
3
4 ifndef VERSION
5 include ../Version
6 endif
7
8 CC=arm-none-eabi-gcc
9 OBJCOPY=arm-none-eabi-objcopy
10
11 PDCLIB=/home/keithp/sat
12 C_LIB=$(PDCLIB)/lib/pdclib.a
13 C_INC=-I$(PDCLIB)/include
14
15 DEF_CFLAGS=-g -std=gnu99 -Os -mlittle-endian -mthumb -ffreestanding -nostdlib -I../../src/stm $(C_INC)
16
17 # to run from SRAM
18 LD_FLAGS_RAM=-L../stm -Wl,-Taltos-ram.ld
19 LD_FLAGS=-L../stm -Wl,-Tbringup.ld
20
21 CFLAGS=$(DEF_CFLAGS) -mcpu=cortex-m3 -DCONFIG_STM32L_DISCOVERY
22
23 SRC=bringup.c ao_interrupt.c
24 OBJ=$(SRC:.c=.o)
25
26 all: bringup-ram.elf bringup.elf
27
28 %.bin: %.elf
29         $(OBJCOPY) -O binary $^ $@
30
31 bringup.elf: $(OBJ) $(C_LIB) bringup.ld
32         $(CC) $(CFLAGS) $(LD_FLAGS) -o $@ $(OBJ) $(C_LIB) -lgcc
33
34 bringup-ram.elf: $(OBJ) $(C_LIB) altos-ram.ld
35         $(CC) $(CFLAGS) $(LD_FLAGS_RAM) -o $@ $(OBJ) $(C_LIB) -lgcc
36
37 clean:
38         rm -f *.o
39         rm -rf *.elf
40         rm -rf *.bin
41
42 .PHONY: all clean
43
44 install:
45
46 uninstall: