aboutsummaryrefslogtreecommitdiffstats
path: root/make_helpers
diff options
context:
space:
mode:
authorOlivier Deprez <olivier.deprez@arm.com>2020-09-21 08:28:50 +0000
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2020-09-21 08:28:50 +0000
commitc1a4b6b477c7b279ebca00deb0fc8981a3fff231 (patch)
tree2887954db4685ce1b2ce670e9f84ec13658d5018 /make_helpers
parent8c00bccebe780026907806ffd7a5a77049764c30 (diff)
parent327131c4c7e41d57aca9f54fd2706ae59d735aaa (diff)
downloadplatform_external_arm-trusted-firmware-c1a4b6b477c7b279ebca00deb0fc8981a3fff231.tar.gz
platform_external_arm-trusted-firmware-c1a4b6b477c7b279ebca00deb0fc8981a3fff231.tar.bz2
platform_external_arm-trusted-firmware-c1a4b6b477c7b279ebca00deb0fc8981a3fff231.zip
Merge "build_macros.mk: include assert and define loop macros" into integration
Diffstat (limited to 'make_helpers')
-rw-r--r--make_helpers/armv7-a-cpus.mk11
-rw-r--r--make_helpers/build_macros.mk19
2 files changed, 26 insertions, 4 deletions
diff --git a/make_helpers/armv7-a-cpus.mk b/make_helpers/armv7-a-cpus.mk
index 5571ab0f7..eec85cc1e 100644
--- a/make_helpers/armv7-a-cpus.mk
+++ b/make_helpers/armv7-a-cpus.mk
@@ -44,10 +44,13 @@ endif
# Defined if ARMv7 core supports the Generic Timer extension.
ifeq ($(filter yes,$(ARM_CORTEX_A7) $(ARM_CORTEX_A12) $(ARM_CORTEX_A15) $(ARM_CORTEX_A17)),yes)
-$(eval $(call add_define,ARMV7_SUPPORTS_LARGE_PAGE_ADDRESSING))
-$(eval $(call add_define,ARMV7_SUPPORTS_VIRTUALIZATION))
-$(eval $(call add_define,ARMV7_SUPPORTS_GENERIC_TIMER))
-$(eval $(call add_define,ARMV7_SUPPORTS_VFP))
+$(eval $(call add_defines,\
+ $(sort \
+ ARMV7_SUPPORTS_LARGE_PAGE_ADDRESSING \
+ ARMV7_SUPPORTS_VIRTUALIZATION \
+ ARMV7_SUPPORTS_GENERIC_TIMER \
+ ARMV7_SUPPORTS_VFP \
+)))
endif
ifeq ($(ARM_CORTEX_A5),yes)
diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk
index 1c3d14d05..613fca23f 100644
--- a/make_helpers/build_macros.mk
+++ b/make_helpers/build_macros.mk
@@ -44,6 +44,13 @@ define add_define
DEFINES += -D$(1)$(if $(value $(1)),=$(value $(1)),)
endef
+
+# Convenience function for addding multiple build definitions
+# $(eval $(call add_defines,FOO BOO))
+define add_defines
+ $(foreach def,$1,$(eval $(call add_define,$(def))))
+endef
+
# Convenience function for adding build definitions
# $(eval $(call add_define_val,FOO,BAR)) will have:
# -DFOO=BAR
@@ -57,6 +64,12 @@ define assert_boolean
$(if $(filter-out 0 1,$($1)),$(error $1 must be boolean))
endef
+# Convenience function for verifying options have boolean values
+# $(eval $(call assert_booleans,FOO BOO)) will assert FOO and BOO for 0 or 1 values
+define assert_booleans
+ $(foreach bool,$1,$(eval $(call assert_boolean,$(bool))))
+endef
+
0-9 := 0 1 2 3 4 5 6 7 8 9
# Function to verify that a given option $(1) contains a numeric value
@@ -67,6 +80,12 @@ $(foreach d,$(0-9),$(eval __numeric := $(subst $(d),,$(__numeric))))
$(if $(__numeric),$(error $(1) must be numeric))
endef
+# Convenience function for verifying options have numeric values
+# $(eval $(call assert_numerics,FOO BOO)) will assert FOO and BOO contain numeric values
+define assert_numerics
+ $(foreach num,$1,$(eval $(call assert_numeric,$(num))))
+endef
+
# CREATE_SEQ is a recursive function to create sequence of numbers from 1 to
# $(2) and assign the sequence to $(1)
define CREATE_SEQ