includedir=$(prefix)/include
#CPU=cortex-m3
-CPUS=cortex-m0 cortex-m3
+CPUS=cortex-m0 cortex-m3 cortex-m4
FIRSTCPU=cortex-m0
CPU=none
BUILD=build-$(CPU)
+# CPU specific compiler flags
+ifeq ($(CPU),cortex-m0)
+CPU_FLAGS=
+endif
+ifeq ($(CPU),cortex-m3)
+CPU_FLAGS=
+endif
+ifeq ($(CPU),cortex-m4)
+CPU_FLAGS=-mfloat-abi=hard
+endif
+
#CC=$(bindir)/arm-none-eabi-gcc
CC=/usr/bin/arm-none-eabi-gcc
+AR=/usr/bin/arm-none-eabi-ar
# This is where you chose which platform to compile for (see 'make links' / './platform')
PLATFORM := altos
ALLFILES := $(SRCFILES) $(HDRFILES) $(AUXFILES)
WARNINGS := -Wall -Wextra -pedantic -Wno-unused-parameter -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wnested-externs -Winline -Wno-long-long -Wuninitialized -Wstrict-prototypes
-PLATFORM_FLAGS=-mlittle-endian -mthumb -mcpu=$(CPU) -ffreestanding
+PLATFORM_FLAGS=-mlittle-endian -mthumb -mcpu=$(CPU) -ffreestanding $(CPU_FLAGS)
CFLAGS := -Os -g -std=c99 -I./$(BUILD)/internals -I./testing $(WARNINGS) $(USERFLAGS) $(PLATFORM_FLAGS)
.PHONY: all clean srcdist bindist test tests testdrivers regtests regtestdrivers todos fixmes find links unlink help
$(PDCLIB): $(BUILD) $(OBJFILES)
@echo " AR $@"
- @ar rc $@ $(OBJFILES)
+ @$(AR) rc $@ $(OBJFILES)
@echo
install-$(CPU): install-$(CPU)-lib install-hdr