]> git.gag.com Git - fw/altos/blob - src/stm32f4/Makefile-stm32f4.defs
c39633c794dbeb42878561889c3ee571ac44bd89
[fw/altos] / src / stm32f4 / Makefile-stm32f4.defs
1 ifndef TOPDIR
2 TOPDIR=..
3 endif
4
5 include $(TOPDIR)/Makedefs
6
7 vpath % $(TOPDIR)/stm32f4:$(TOPDIR)/product:$(TOPDIR)/drivers:$(TOPDIR)/kernel:$(TOPDIR)/util:$(TOPDIR)/kalman:$(TOPDIR)/aes:$(TOPDIR):$(TOPDIR)/math
8 vpath make-altitude $(TOPDIR)/util
9 vpath make-kalman $(TOPDIR)/util
10 vpath kalman.5c $(TOPDIR)/kalman
11 vpath kalman_filter.5c $(TOPDIR)/kalman
12 vpath load_csv.5c $(TOPDIR)/kalman
13 vpath matrix.5c $(TOPDIR)/kalman
14 vpath ao-make-product.5c $(TOPDIR)/util
15
16 .SUFFIXES: .elf .ihx
17
18 .elf.ihx:
19         $(ELFTOHEX) --output=$@ $*.elf
20
21 ifndef VERSION
22 include $(TOPDIR)/Version
23 endif
24
25 ELFTOHEX=$(TOPDIR)/../ao-tools/ao-elftohex/ao-elftohex
26 CC=$(ARM_CC)
27
28 WARN_FLAGS=-Wall -Wextra -Werror -Wcast-align
29
30 AO_CFLAGS=-I. -I$(TOPDIR)/stm32f4 -I$(TOPDIR)/kernel -I$(TOPDIR)/drivers \
31         -Os -g \
32         -I$(TOPDIR)/product -I$(TOPDIR) -I$(TOPDIR)/math \
33         -isystem $(NEWLIB_NANO)/arm-none-eabi/include
34
35 STM32F4_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m4 -mthumb \
36         -mfloat-abi=hard -mfpu=fpv4-sp-d16 \
37         -ffreestanding -nostdlib $(AO_CFLAGS) $(WARN_FLAGS)
38
39 NICKLE=nickle
40
41 LIBS=-L$(NEWLIB_NANO)/arm-none-eabi/lib/thumb/v7e-m/fpv4-sp/hard -lc -lm -lgcc
42
43 V=0
44 # The user has explicitly enabled quiet compilation.
45 ifeq ($(V),0)
46 quiet = @printf "  $1 $2 $@\n"; $($1)
47 endif
48 # Otherwise, print the full command line.
49 quiet ?= $($1)
50
51 .c.o:
52         $(call quiet,CC) -c $(CFLAGS) -o $@ $<