Mathias Krause ([email protected]) just uploaded a new patch set to 
gerrit, which you can find at http://review.coreboot.org/744

-gerrit

commit 2bc5424a1d455622e8168e4c30873f9fff1a15ac
Author: Mathias Krause <[email protected]>
Date:   Tue Mar 6 13:14:47 2012 +0100

    makefile: avoid unnecessary rebuilds
    
    The make target libpayload is a phony target which makes filo and all
    the object files get rebuild on every make invokation. Avoid this by
    lifting the dependencies and rebuild, i.e. relink filo only when
    libpayload has changed.
    
    Also, when building libpayload as a prerequisite, use $(obj) as DESTDIR,
    as the user might want to use a different build directory then $(src)/build.
    
    Change-Id: Ifa42362ba1d8c88c9996d645314cfdbdf2994759
    Signed-off-by: Mathias Krause <[email protected]>
---
 Makefile |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/Makefile b/Makefile
index 3461614..3b4a468 100644
--- a/Makefile
+++ b/Makefile
@@ -118,18 +118,19 @@ all: prepare $(obj)/version.h $(TARGET)
 HAVE_LIBPAYLOAD := $(wildcard $(LIBPAYLOAD))
 ifneq ($(strip $(HAVE_LIBPAYLOAD)),)
 libpayload:
-       @printf "Found Libpayload $(LIBPAYLOAD).\n"
+       @printf "Found libpayload as $(LIBPAYLOAD)\n"
 else
-libpayload: $(src)/$(LIB_CONFIG)
-       printf "building libpayload.\n"
+libpayload: $(LIBPAYLOAD)
+$(LIBPAYLOAD): $(src)/$(LIB_CONFIG)
+       @printf "Building libpayload...\n"
        $(MAKE) -C $(LIBCONFIG_PATH) obj=$(obj)/libpayload-build distclean
        cp lib.config $(LIBCONFIG_PATH)/.config
        mkdir -p $(LIBCONFIG_PATH)/build
        $(MAKE) -C $(LIBCONFIG_PATH) obj=$(obj)/libpayload-build oldconfig
-       $(MAKE) -C $(LIBCONFIG_PATH) obj=$(obj)/libpayload-build 
DESTDIR=$(src)/build install
+       $(MAKE) -C $(LIBCONFIG_PATH) obj=$(obj)/libpayload-build DESTDIR=$(obj) 
install
 endif
 
-$(obj)/filo: $(OBJS) libpayload
+$(obj)/filo: $(OBJS) $(LIBPAYLOAD)
        printf "  LD      $(subst $(shell pwd)/,,$(@))\n"
        $(LD) -N -T $(ARCHDIR-y)/ldscript -o $@ $(OBJS) $(LIBPAYLOAD) $(LIBGCC)
 
@@ -142,7 +143,7 @@ include util/kconfig/Makefile
 $(KCONFIG_AUTOHEADER): $(src)/.config
        $(MAKE) silentoldconfig
 
-$(OBJS): $(KCONFIG_AUTOHEADER) libpayload
+$(OBJS): $(KCONFIG_AUTOHEADER) | libpayload
 $(obj)/%.o: $(src)/%.c
        printf "  CC      $(subst $(shell pwd)/,,$(@))\n"
        $(CC) -MMD $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
@@ -177,5 +178,4 @@ distclean: clean
 
 FORCE:
 
-.PHONY: $(PHONY) prepare clean distclean FORCE
-
+.PHONY: $(PHONY) prepare clean distclean libpayload FORCE

-- 
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to