[coreboot-gerrit] New patch to review for coreboot: d47c1a8 WIP make: support absolute and relative obj= specs

Vadim Bendebury (vbendeb@chromium.org) gerrit at coreboot.org
Thu May 7 06:50:41 CEST 2015


Vadim Bendebury (vbendeb at chromium.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10127

-gerrit

commit d47c1a81acedbb077c9a94287579e9195acf1beb
Author: Vadim Bendebury <vbendeb at chromium.org>
Date:   Wed May 6 21:00:10 2015 -0700

    WIP make: support absolute and relative obj= specs
    
    When trying to build out of tree and specifying a relative path to a
    directory somewhere above the source code root, make fails as follows:
    
    $ make obj=../build/peppy
    ...
    No rule to make target
    `<full_path_to>/build/peppy/mainboard/google/peppy/static.c',
    needed by
    `<full_path_to>/build/peppy/mainboard/google/peppy/static.romstage.o'.
    Stop
    
    Invoking make using the full path to the build directory works fine:
    
    $ make obj=<full_path_to>/build/peppy
    
    Change-Id: If46b046108e906796fe84716e93bf341b3785f14
    Signed-off-by: Vadim Bendebury <vbendeb at chromium.org>
---
 Makefile | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 2ff4ebe..84eb777 100644
--- a/Makefile
+++ b/Makefile
@@ -43,9 +43,12 @@ include .xcompile
 export top := $(CURDIR)
 export src := src
 export srck := $(top)/util/kconfig
-export obj ?= build
+obj ?= build
+override obj := $(subst $(top)/,,$(obj))
+export obj
 export objutil ?= $(obj)/util
 export objk := $(objutil)/kconfig
+absobj := $(abspath $(obj))
 
 
 export KCONFIG_AUTOHEADER := $(obj)/config.h
@@ -184,8 +187,9 @@ includemakefiles= \
 	$(foreach class,$(classes-y), $(call add-class,$(class))) \
 	$(foreach class,$(classes), \
 		$(eval $(class)-srcs+= \
+			$$(subst $(absobj)/,$(obj)/, \
 			$$(subst $(top)/,, \
-			$$(abspath $$(subst $(dir $(1))/,/,$$(addprefix $(dir $(1)),$$($(class)-y))))))) \
+			$$(abspath $$(subst $(dir $(1))/,/,$$(addprefix $(dir $(1)),$$($(class)-y)))))))) \
 	$(foreach special,$(special-classes), \
 		$(foreach item,$($(special)-y), $(call $(special)-handler,$(dir $(1)),$(item)))) \
 	$(eval subdirs+=$$(subst $(CURDIR)/,,$$(abspath $$(addprefix $(dir $(1)),$$(subdirs-y)))))



More information about the coreboot-gerrit mailing list