summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@chromium.org>2016-01-28 22:34:50 +0100
committerPatrick Georgi <pgeorgi@google.com>2016-01-29 17:20:08 +0100
commit1bf5e6409678d04fd15f9625460078853118521c (patch)
tree95e73fc2022879f4f0a373fc0d95d5e0d76f0e85
parentefe7ff0f81902f59784b798fa54568cb03b68e78 (diff)
downloadcoreboot-1bf5e6409678d04fd15f9625460078853118521c.tar.xz
build system: allow modifying cbfstool options for files-in-regions
By implementing a more complex options-for-region function, special needs for certain files in certain regions can be dealt with. Change-Id: I2e1e08d5357b717011c41675f76908bf2319f91d Signed-off-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-on: https://review.coreboot.org/13505 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com>
-rw-r--r--Makefile.inc14
1 files changed, 11 insertions, 3 deletions
diff --git a/Makefile.inc b/Makefile.inc
index 8b6910942a..122b83a124 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -645,6 +645,13 @@ extract_nth=$(subst *,$(spc),$(patsubst -%-,%,$(word $(1), $(subst |,- -,-$(2)-)
# multiple CBFSes in fmap regions, override it.
regions-for-file ?= COREBOOT
+# options-for-region
+# $(call options-for-region,$(filename),$(region),$(options))
+#
+# Returns potentially modified options, depending on file and region.
+# Default is to return it unmodified
+options-for-region ?= $(3)
+
ifeq ($(CONFIG_CBFS_AUTOGEN_ATTRIBUTES),y)
cbfs-autogen-attributes=-g
endif
@@ -660,9 +667,10 @@ define cbfs-add-cmd-for-region
$(if $(call extract_nth,4,$(1)),-c $(call extract_nth,4,$(1))) \
$(cbfs-autogen-attributes) \
-r $(2) \
- $(if $(call extract_nth,6,$(1)),-a $(call extract_nth,6,$(file)), \
- $(if $(call extract_nth,5,$(file)),-b $(call extract_nth,5,$(file)))) \
- $(call extract_nth,7,$(1))
+ $(call options-for-region,$(call extract_nth,2,$(1)),$(2), \
+ $(if $(call extract_nth,6,$(1)),-a $(call extract_nth,6,$(file)), \
+ $(if $(call extract_nth,5,$(file)),-b $(call extract_nth,5,$(file)))) \
+ $(call extract_nth,7,$(1)))
endef
# Empty line before endef is necessary so cbfs-add-cmd-for-region ends in a