altos: Build .ihx files for all arm projects
[fw/altos] / src / stm / Makefile.defs
1 vpath % ../stm:../product:../drivers:../core:../util:../kalman:../aes:../math:..
2 vpath make-altitude ../util
3 vpath make-kalman ../util
4 vpath kalman.5c ../kalman
5 vpath kalman_filter.5c ../kalman
6 vpath load_csv.5c ../kalman
7 vpath matrix.5c ../kalman
8 vpath ao-make-product.5c ../util
9
10 .SUFFIXES: .elf .ihx
11
12 .elf.ihx:
13         $(ELFTOHEX) --output=$@ $*.elf
14
15 ifndef TOPDIR
16 TOPDIR=..
17 endif
18
19 ifndef VERSION
20 include $(TOPDIR)/Version
21 endif
22 include $(TOPDIR)/Makedefs
23
24 CC=$(ARM_CC)
25 LIBS=-lpdclib-cortex-m3 -lgcc
26
27 AO_CFLAGS=-I. -I../stm -I../core -I../drivers -I../math -I..
28 STM_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m3 -mthumb -ffreestanding -nostdlib $(AO_CFLAGS)
29
30 LDFLAGS=-L../stm -Wl,-Taltos.ld
31
32 NICKLE=nickle
33 ELFTOHEX=$(TOPDIR)/../ao-tools/ao-elftohex/ao-elftohex
34
35 V=0
36 # The user has explicitly enabled quiet compilation.
37 ifeq ($(V),0)
38 quiet = @printf "  $1 $2 $@\n"; $($1)
39 endif
40 # Otherwise, print the full command line.
41 quiet ?= $($1)
42
43 .c.o:
44         $(call quiet,CC) -c $(CFLAGS) -o $@ $<