aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2016-03-21 17:21:57 +0100
committerKarel Kočí <cynerd@email.cz>2016-03-21 17:21:57 +0100
commit147cb7f0e67d1f3c3274effa5476607e24664182 (patch)
tree5fa946410242505705026f69d84105264f0de5e5
parente88e18295becfb18efc278d1fab7fbe0021cb2dd (diff)
downloadavr-ioe-147cb7f0e67d1f3c3274effa5476607e24664182.tar.gz
avr-ioe-147cb7f0e67d1f3c3274effa5476607e24664182.tar.bz2
avr-ioe-147cb7f0e67d1f3c3274effa5476607e24664182.zip
Small updates in makefile depedencies
-rw-r--r--Makefile9
1 files changed, 4 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 4f8da62..c17404b 100644
--- a/Makefile
+++ b/Makefile
@@ -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: