Mathias Krause (mathias.krause@secunet.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/745
-gerrit
commit 0c3a13b773ee21af4c1380c01bacc2d9d00f6784 Author: Mathias Krause mathias.krause@secunet.com Date: Tue Mar 6 13:26:48 2012 +0100
makefile: recreate version.h only when needed
Don't recreate version.h on each make invokation but only when needed, i.e. when the make variables have changed. Also make version.h a prerequisite for the object files to rebuild them when the version information changes.
Change-Id: I27a057be25902233ac0751db8061e9ad4cd50642 Signed-off-by: Mathias Krause mathias.krause@secunet.com --- Makefile | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile index 3b4a468..46a265f 100644 --- a/Makefile +++ b/Makefile @@ -112,8 +112,8 @@ TARGET = $(obj)/filo.elf
HAVE_LIBCONFIG := $(wildcard $(LIBCONFIG_PATH))
-all: prepare $(obj)/version.h $(TARGET)
+all: prepare $(TARGET)
HAVE_LIBPAYLOAD := $(wildcard $(LIBPAYLOAD)) ifneq ($(strip $(HAVE_LIBPAYLOAD)),) @@ -143,7 +143,7 @@ include util/kconfig/Makefile $(KCONFIG_AUTOHEADER): $(src)/.config $(MAKE) silentoldconfig
-$(OBJS): $(KCONFIG_AUTOHEADER) | libpayload +$(OBJS): $(KCONFIG_AUTOHEADER) $(obj)/version.h | libpayload $(obj)/%.o: $(src)/%.c printf " CC $(subst $(shell pwd)/,,$(@))\n" $(CC) -MMD $(CFLAGS) $(CPPFLAGS) -c -o $@ $< @@ -158,7 +158,8 @@ $(obj)/%.map: $(obj)/%
endif
-$(obj)/version.h: FORCE +$(obj)/version.h: Makefile + printf " GEN $(subst $(shell pwd)/,,$(@))\n" echo '#define PROGRAM_NAME "$(PROGRAM_NAME)"' > $@ echo '#define PROGRAM_VERSION "$(PROGRAM_VERSION)"' >> $@ echo '#define PROGRAM_VERSION_FULL "$(PROGRAM_VERSION) $(BUILD_INFO)"' >> $@ @@ -171,6 +172,7 @@ prepare: $(sort $(dir $(OBJS))) $(obj)/util/kconfig/lxdialog/
clean: rm -rf $(sort $(dir $(OBJS))) $(obj)/util + rm -rf $(obj)/version.h
distclean: clean rm -rf $(obj)