Use packaged gcc-arm-none-eabi compiler
[fw/pdclib] / Makefile
index 84e3393f18ad406237f4c68e5c3c8b166ba46b42..107dced5b7a345cbd73fea642f17b80256e3bf32 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 # $Id$
 
 DESTDIR=
-prefix=/opt/sat
+prefix=/opt/cortex
 libdir=$(prefix)/lib
 bindir=$(prefix)/bin
 includedir=$(prefix)/include
@@ -12,7 +12,8 @@ FIRSTCPU=cortex-m0
 CPU=none
 BUILD=build-$(CPU)
 
-CC=$(bindir)/arm-none-eabi-gcc
+#CC=$(bindir)/arm-none-eabi-gcc
+CC=/usr/bin/arm-none-eabi-gcc
 
 # This is where you chose which platform to compile for (see 'make links' / './platform')
 PLATFORM := altos
@@ -46,7 +47,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=-nostdinc -mlittle-endian -mthumb -mcpu=cortex-m3 -ffreestanding -nostdlib
+PLATFORM_FLAGS=-nostdinc -mlittle-endian -mthumb -mcpu=$(CPU) -ffreestanding -nostdlib
 CFLAGS := -fno-builtin -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
@@ -62,6 +63,10 @@ install: install-hdr
 install-hdr:
        +make CPU=$(FIRSTCPU) install-hdr-$(FIRSTCPU)
 
+clean:
+       +for i in $(CPUS); do make CPU=$$i clean-$$i; rm -rf build-$$i; done
+       rm -f pdclib.a
+
 check: all testdrivers regtestdrivers
        @echo
        @echo "========================"
@@ -108,7 +113,7 @@ regtestdrivers: $(REGFILES)
 
 -include $(DEPFILES) $(TSTDEPFILES) $(REGDEPFILES)
 
-clean: $(BUILD)
+clean-$(CPU): $(BUILD)
        -@$(RM) $(wildcard $(OBJFILES) $(DEPFILES) $(TSTFILES) $(TSTDEPFILES) $(REGFILES) $(REGDEPFILES) $(PDCLIB) pdclib.tgz scanf_testdata_*)
 
 srcdist:
@@ -170,4 +175,4 @@ help:
        @$(CC) $(CFLAGS) -MMD -MP -DTEST -DREGTEST $< -o $@
 
 $(BUILD):
-       mkdir -p $(BUILD)
\ No newline at end of file
+       mkdir -p $(BUILD)