altos: Add a pile more compiler warnings
[fw/altos] / src / stm / Makefile.defs
1 vpath % ../stm:../product:../drivers:../kernel:../util:../kalman:../aes:../math:../draw:../scheme:..
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=-L$(NEWLIB_NANO)/arm-none-eabi/lib/thumb/v7-m -lm -lc -lgcc
26
27 WARN_FLAGS=-Wall -Wextra -Werror -Wcast-align \
28         -Wpointer-arith \
29         -Wstrict-prototypes \
30         -Wmissing-prototypes \
31         -Wmissing-declarations \
32         -Wnested-externs
33
34 AO_CFLAGS=-I. -I../stm -I../kernel -I../drivers -I../math -I../draw \
35         -DNEWLIB_INTEGER_PRINTF_SCANF \
36         -I../lisp -I.. -isystem $(NEWLIB_NANO)/arm-none-eabi/include
37
38 STM_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m3 -mthumb -Wcast-align \
39         -ffreestanding -nostdlib $(AO_CFLAGS) $(WARN_FLAGS)
40
41 LDFLAGS=-L../stm -Wl,-Taltos.ld -nostartfiles -Wl,-Map=$(PROGNAME).map
42
43 NICKLE=nickle
44 ELFTOHEX=$(TOPDIR)/../ao-tools/ao-elftohex/ao-elftohex
45
46 V=0
47 # The user has explicitly enabled quiet compilation.
48 ifeq ($(V),0)
49 quiet = @printf "  $1 $2 $@\n"; $($1)
50 endif
51 # Otherwise, print the full command line.
52 quiet ?= $($1)
53
54 .c.o:
55         $(call quiet,CC) -c $(CFLAGS) -o $@ $<