[Cryptech-Commits] [sw/stm32] 02/11: Split includes from CFLAGS, because they don't make sense to libhal and libtfm.

git at cryptech.is git at cryptech.is
Mon Nov 16 21:43:04 UTC 2015


This is an automated email from the git hooks/post-receive script.

paul at psgd.org pushed a commit to branch master
in repository sw/stm32.

commit 506d3c20f1dac68695793353de065191e2144026
Author: Paul Selkirk <paul at psgd.org>
Date:   Tue Nov 10 17:28:40 2015 -0500

    Split includes from CFLAGS, because they don't make sense to libhal and libtfm.
---
 Makefile | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index e05586c..e98134a 100644
--- a/Makefile
+++ b/Makefile
@@ -52,8 +52,11 @@ CFLAGS += -std=c99
 vpath %.c src self-test
 vpath %.a $(STD_PERIPH_LIB)
 
-CFLAGS += -I include -I $(STD_PERIPH_LIB) -I $(STD_PERIPH_LIB)/CMSIS/Device/ST/STM32F4xx/Include
-CFLAGS += -I $(STD_PERIPH_LIB)/CMSIS/Include -I $(STD_PERIPH_LIB)/STM32F4xx_HAL_Driver/Inc
+IFLAGS += -I include -I $(STD_PERIPH_LIB) -I $(STD_PERIPH_LIB)/CMSIS/Device/ST/STM32F4xx/Include
+IFLAGS += -I $(STD_PERIPH_LIB)/CMSIS/Include -I $(STD_PERIPH_LIB)/STM32F4xx_HAL_Driver/Inc
+
+%.o: %.c
+	$(CC) -c $(CFLAGS) $(IFLAGS) -o $@ $<
 
 OBJS = $(patsubst %.s,%.o, $(patsubst %.c,%.o, $(SRCS)))
 
@@ -97,7 +100,7 @@ CFLAGS += -I libhal
 
 # .mo extension for files with main() that need to be wrapped as __main()
 %.mo: %.c
-	$(CC) -c $(CFLAGS) -Dmain=__main -o $@ $<
+	$(CC) -c $(CFLAGS) $(IFLAGS) -Dmain=__main -o $@ $<
 
 vpath %.c libc libhal/utils
 %.bin: %.mo main.o syscalls.o printf.o gettimeofday.o $(OBJS) $(LIBS)
@@ -107,7 +110,7 @@ vpath %.c libc libhal/utils
 	$(OBJDUMP) -St $*.elf >$*.lst
 	$(SIZE) $*.elf
 
-.SECONDARY: $(OBJS) *.mo main.o syscalls.o
+.SECONDARY: $(OBJS) *.mo main.o syscalls.o printf.o gettimeofday.o
 
 clean:
 	find ./ -name '*~' | xargs rm -f
@@ -122,4 +125,4 @@ distclean: clean
 	$(MAKE) -C $(STD_PERIPH_LIB) clean
 	$(MAKE) -C thirdparty/libtfm clean
 	$(MAKE) -C libhal clean
-
+	$(MAKE) -C libc clean



More information about the Commits mailing list