Build cortex-m4 version of pdclib
authorKeith Packard <keithp@keithp.com>
Mon, 30 Nov 2015 02:21:43 +0000 (20:21 -0600)
committerKeith Packard <keithp@keithp.com>
Mon, 30 Nov 2015 02:21:43 +0000 (20:21 -0600)
We're using the m4 version until the arm binutils package gains
support for the m7.

Signed-off-by: Keith Packard <keithp@keithp.com>
Makefile

index 4796dfb58065cdbb3a09ba90d9ef85aec3945a6e..97da5cc892e03a1fab049252dffbdd653a0e3f29 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -9,11 +9,22 @@ bindir=$(prefix)/bin
 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
 
@@ -49,7 +60,7 @@ REGDEPFILES := $(patsubst %,%.d,$(REGFILES))
 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