[coreboot-gerrit] New patch to review for coreboot: build system: strip quotes from CONFIG_CBFS_PREFIX in a single location

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Mon Nov 30 22:46:55 CET 2015


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12578

-gerrit

commit d5ee1944c33315e23e3bbe0d4ef83f98a86f0e11
Author: Patrick Georgi <pgeorgi at chromium.org>
Date:   Mon Nov 30 22:44:53 2015 +0100

    build system: strip quotes from CONFIG_CBFS_PREFIX in a single location
    
    Instead of having to remember to strip the quotes everywhere so that
    string comparisons (of which there are a few) match up, do it right at
    the beginning.
    
    Fixes building the image with a .config where CONFIG_CBFS_PREFIX
    contains quotes.
    
    Change-Id: I4d63341cd9f0bc5e313883ef7b5ca6486190c124
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
---
 Makefile.inc                | 16 ++++++++++------
 src/arch/arm64/Makefile.inc |  4 ++--
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/Makefile.inc b/Makefile.inc
index 4eebc71..e68ee6e 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -16,6 +16,10 @@
 GIT:=$(shell [ -d "$(top)/.git" ] && command -v git)
 
 #######################################################################
+# normalize Kconfig variables in a central place
+CONFIG_CBFS_PREFIX:=$(call strip_quotes,$(CONFIG_CBFS_PREFIX))
+
+#######################################################################
 # misleadingly named, this is the coreboot version
 export KERNELVERSION := $(strip $(if $(GIT),\
 	$(shell git describe --dirty --always || git describe),\
@@ -31,7 +35,7 @@ export MAINBOARDDIR
 ## Final build results, which CBFSTOOL uses to create the final
 ## rom image file, are placed under $(objcbfs).
 ## These typically have suffixes .debug .elf .bin and .map
-export objcbfs := $(obj)/cbfs/$(call strip_quotes,$(CONFIG_CBFS_PREFIX))
+export objcbfs := $(obj)/cbfs/$(CONFIG_CBFS_PREFIX)
 
 ## Based on the active configuration, Makefile conditionally collects
 ## the required assembly includes and saves them in a file.
@@ -189,10 +193,10 @@ endef
 # arg1: base file name
 # arg2: y or n for including in cbfs. defaults to y
 define asl_template
-$(call strip_quotes,$(CONFIG_CBFS_PREFIX))/$(1).aml-file = $(obj)/$(1).aml
-$(call strip_quotes,$(CONFIG_CBFS_PREFIX))/$(1).aml-type = raw
-$(call strip_quotes,$(CONFIG_CBFS_PREFIX))/$(1).aml-compression = none
-cbfs-files-$(if $(2),$(2),y) += $(call strip_quotes,$(CONFIG_CBFS_PREFIX))/$(1).aml
+$(CONFIG_CBFS_PREFIX)/$(1).aml-file = $(obj)/$(1).aml
+$(CONFIG_CBFS_PREFIX)/$(1).aml-type = raw
+$(CONFIG_CBFS_PREFIX)/$(1).aml-compression = none
+cbfs-files-$(if $(2),$(2),y) += $(CONFIG_CBFS_PREFIX)/$(1).aml
 $(obj)/$(1).aml: $(src)/mainboard/$(MAINBOARDDIR)/$(1).asl $(obj)/config.h
 	@printf "    IASL       $$(subst $(top)/,,$$(@))\n"
 	$(CC_ramstage) -x assembler-with-cpp -E -MMD -MT $$(@) $$(CPPFLAGS_ramstage) -D__ACPI__ -P -include $(src)/include/kconfig.h -I$(obj) -I$(src) -I$(src)/include -I$(src)/arch/$(ARCHDIR-$(ARCH-ramstage-y))/include -I$(src)/mainboard/$(MAINBOARDDIR) $$< -o $$@
@@ -622,7 +626,7 @@ prebuilt-files = $(foreach file,$(cbfs-files), $(call extract_nth,1,$(file)))
 # Add all cbfs files to image of the form: CONFIG_CBFS_PREFIX/<filename>
 prebuild-files = \
 	$(foreach file,$(cbfs-files), \
-	       $(if $(filter $(call strip_quotes, $(CONFIG_CBFS_PREFIX))/%,\
+	       $(if $(filter $(CONFIG_CBFS_PREFIX)/%,\
 	           $(call extract_nth,2,$(file))), \
 	       $(if $(call extract_nth,6,$(file)),$(cbfs-add-cmd) -a $(call extract_nth,6,$(file)) &&,\
 	       $(cbfs-add-cmd) $(if $(call extract_nth,5,$(file)),-b $(call extract_nth,5,$(file))) &&)))
diff --git a/src/arch/arm64/Makefile.inc b/src/arch/arm64/Makefile.inc
index 1cbc9a4..b1e20dc 100644
--- a/src/arch/arm64/Makefile.inc
+++ b/src/arch/arm64/Makefile.inc
@@ -168,7 +168,7 @@ $(BL31):
 
 .PHONY: $(BL31)
 
-BL31_CBFS := $(call strip_quotes,$(CONFIG_CBFS_PREFIX))/bl31
+BL31_CBFS := $(CONFIG_CBFS_PREFIX)/bl31
 $(BL31_CBFS)-file := $(BL31)
 $(BL31_CBFS)-type := stage
 $(BL31_CBFS)-compression := $(CBFS_COMPRESS_FLAG)
@@ -177,7 +177,7 @@ cbfs-files-y += $(BL31_CBFS)
 ifeq ($(CONFIG_ARM64_USE_SECURE_OS),y)
 
 SECURE_OS_FILE := $(CONFIG_ARM64_SECURE_OS_FILE)
-SECURE_OS_FILE_CBFS := $(call strip_quotes,$(CONFIG_CBFS_PREFIX))/secure_os
+SECURE_OS_FILE_CBFS := $(CONFIG_CBFS_PREFIX)/secure_os
 $(SECURE_OS_FILE_CBFS)-file := $(SECURE_OS_FILE)
 $(SECURE_OS_FILE_CBFS)-type := stage
 cbfs-files-y += $(SECURE_OS_FILE_CBFS)



More information about the coreboot-gerrit mailing list