diff options
author | Karel Kočí <cynerd@email.cz> | 2016-03-21 17:21:57 +0100 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2016-03-21 17:21:57 +0100 |
commit | 147cb7f0e67d1f3c3274effa5476607e24664182 (patch) | |
tree | 5fa946410242505705026f69d84105264f0de5e5 | |
parent | e88e18295becfb18efc278d1fab7fbe0021cb2dd (diff) | |
download | avr-ioe-147cb7f0e67d1f3c3274effa5476607e24664182.tar.gz avr-ioe-147cb7f0e67d1f3c3274effa5476607e24664182.tar.bz2 avr-ioe-147cb7f0e67d1f3c3274effa5476607e24664182.zip |
Small updates in makefile depedencies
-rw-r--r-- | Makefile | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -46,6 +46,7 @@ CFLAGS = $(shell echo $(CONFCFLAGS)) $(shell echo -DF_CPU=$(F_CPU)000L) \ -mmcu=$(MMCU) -Iinclude -imacros $(O)/build/config.h GCC = $(GNUTOOLCHAIN_PREFIX)gcc AR = $(GNUTOOLCHAIN_PREFIX)ar +CPP = $(GNUTOOLCHAIN_PREFIX)cpp $(O)/libioe.a: $(OBJ) @echo " AR $@" @@ -56,17 +57,15 @@ $(OBJ): $(O)/build/%.o: src/%.c @echo " CC $@" $(Q)$(GCC) $(CFLAGS) -c -o $@ $< -$(DEP): $(O)/build/%.d: src/%.c +$(DEP): $(O)/build/%.d: src/%.c $(O)/build/config.h $(Q)mkdir -p "$(@D)" @echo " DEP $@" - $(Q)$(GCC) -MM -MG -MT '$*.o $@' $(CFLAGS) -c -o $@ $< + $(Q)$(CPP) -MM -MG -MT '$(O)/build/$*.o $@' $(CFLAGS) -o $@ $< $(O)/build/config.h: $(CONFIG) $(Q)mkdir -p "$(@D)" @echo " GEN $@" - $(Q)grep -v "^#" $(CONFIG) | grep "CONFIG_" | sed 's/="\(.*\)"/=\1/;s/=/ /;s/^/#define /' > $@ -# This is not optimal because configuration change results to complete project -# rebuild instead of only rebuilding required files. + $(Q)grep -v "^#" $(CONFIG) | grep "CONFIG_" | sed -e 's/="\(.*\)"/=\1/;s/=/ /;s/^/#define /' > $@ else $(O)/libioe.a: |