Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
[fw/altos] / src / stm / Makefile.defs
index 3edfa41d5a512deca15f0b17d9ea8bafea3f10da..8173b349c33446f6ba14e7bc644e400746c7c001 100644 (file)
@@ -1,4 +1,4 @@
-vpath % ../stm:../product:../drivers:../core:../util:../kalman:..
+vpath % ../stm:../product:../drivers:../kernel:../util:../kalman:../aes:../math:../draw:../scheme:..
 vpath make-altitude ../util
 vpath make-kalman ../util
 vpath kalman.5c ../kalman
@@ -7,21 +7,36 @@ vpath load_csv.5c ../kalman
 vpath matrix.5c ../kalman
 vpath ao-make-product.5c ../util
 
-CC=arm-none-eabi-gcc
-SAT=/home/keithp/sat
-SAT_CLIB=$(SAT)/lib/pdclib.a
-SAT_CFLAGS=-I$(SAT)/include
+.SUFFIXES: .elf .ihx
+
+.elf.ihx:
+       $(ELFTOHEX) --output=$@ $*.elf
+
+ifndef TOPDIR
+TOPDIR=..
+endif
 
 ifndef VERSION
-include ../Version
+include $(TOPDIR)/Version
 endif
+include $(TOPDIR)/Makedefs
+
+CC=$(ARM_CC)
+LIBS=-L$(NEWLIB_NANO)/arm-none-eabi/lib/thumb/v7-m -lm -lc -lgcc
+
+WARN_FLAGS=-Wall -Wextra -Werror
+
+AO_CFLAGS=-I. -I../stm -I../kernel -I../drivers -I../math -I../draw \
+       -DNEWLIB_INTEGER_PRINTF_SCANF \
+       -I../lisp -I.. -isystem $(NEWLIB_NANO)/arm-none-eabi/include
 
-AO_CFLAGS=-I. -I../stm -I../core -I../drivers -I..
-STM_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m3 -mthumb -ffreestanding -nostdlib $(AO_CFLAGS) $(SAT_CFLAGS)
+STM_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m3 -mthumb -Wcast-align \
+       -ffreestanding -nostdlib $(AO_CFLAGS) $(WARN_FLAGS)
 
-LDFLAGS=-L../stm -Wl,-Taltos.ld
+LDFLAGS=-L../stm -Wl,-Taltos.ld -nostartfiles -Wl,-Map=$(PROGNAME).map
 
 NICKLE=nickle
+ELFTOHEX=$(TOPDIR)/../ao-tools/ao-elftohex/ao-elftohex
 
 V=0
 # The user has explicitly enabled quiet compilation.