aboutsummaryrefslogtreecommitdiff
path: root/make_helpers
diff options
context:
space:
mode:
authorLeonardo Sandoval <leonardo.sandoval@linaro.org>2020-09-11 12:50:19 -0500
committerLeonardo Sandoval <leonardo.sandoval@linaro.org>2020-10-19 10:00:32 -0500
commit667fd7256f6afbb59308b19c919eee0fb30c55db (patch)
treea707b549a50d0afade297fb9695f071d872a44d7 /make_helpers
parent12c20464817a98348b06069c75a3cfe4dbc6f85d (diff)
downloadtf-a-tests-667fd7256f6afbb59308b19c919eee0fb30c55db.tar.gz
Makefile: place defaults values and macro defs in a separate folder
Although there are not many variable default values and macros definitions, for modularity and scalability, place these two into a separate folder. Change-Id: If916a69edda07aaeaa77d60ce482e002effd7f9f Signed-off-by: Leonardo Sandoval <leonardo.sandoval@linaro.org>
Diffstat (limited to 'make_helpers')
-rw-r--r--make_helpers/build_macros.mk30
-rw-r--r--make_helpers/defaults.mk44
2 files changed, 74 insertions, 0 deletions
diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk
new file mode 100644
index 000000000..0ac15051b
--- /dev/null
+++ b/make_helpers/build_macros.mk
@@ -0,0 +1,30 @@
+#
+# Copyright (c) 2015-2020, ARM Limited and Contributors. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+# Convenience function for adding build definitions
+# $(eval $(call add_define,BAR_DEFINES,FOO)) will have:
+# -DFOO if $(FOO) is empty; -DFOO=$(FOO) otherwise
+# inside the BAR_DEFINES variable.
+define add_define
+$(1) += -D$(2)$(if $(value $(2)),=$(value $(2)),)
+endef
+
+# Convenience function for verifying option has a boolean value
+# $(eval $(call assert_boolean,FOO)) will assert FOO is 0 or 1
+define assert_boolean
+$(and $(patsubst 0,,$(value $(1))),$(patsubst 1,,$(value $(1))),$(error $(1) must be boolean))
+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
+$(if $(word $(2), $($(1))),\
+ $(eval $(1) += $(words $($(1))))\
+ $(eval $(1) := $(filter-out 0,$($(1)))),\
+ $(eval $(1) += $(words $($(1))))\
+ $(call CREATE_SEQ,$(1),$(2))\
+)
+endef
diff --git a/make_helpers/defaults.mk b/make_helpers/defaults.mk
new file mode 100644
index 000000000..ca44b4753
--- /dev/null
+++ b/make_helpers/defaults.mk
@@ -0,0 +1,44 @@
+#
+# Copyright (c) 2018-2020, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+
+# Default, static values for build variables, listed in alphabetic order.
+# Dependencies between build options, if any, are handled in the top-level
+# Makefile, after this file is included. This ensures that the former is better
+# poised to handle dependencies, as all build variables would have a default
+# value by then.
+
+# The Target build architecture. Supported values are: aarch64, aarch32.
+ARCH := aarch64
+
+# ARM Architecture major and minor versions: 8.0 by default.
+ARM_ARCH_MAJOR := 8
+ARM_ARCH_MINOR := 0
+
+# Base commit to perform code check on
+BASE_COMMIT := origin/master
+
+# Debug/Release build
+DEBUG := 0
+
+# Build platform
+DEFAULT_PLAT := fvp
+
+# Whether the Firmware Update images (i.e. NS_BL1U and NS_BL2U images) should be
+# built. The platform makefile is free to override this value.
+FIRMWARE_UPDATE := 0
+
+# Enable FWU helper functions and inline tests in NS_BL1U and NS_BL2U images.
+FWU_BL_TEST := 1
+
+# Whether a new test session should be started every time or whether the
+# framework should try to resume a previous one if it was interrupted
+NEW_TEST_SESSION := 1
+
+# Use non volatile memory for storing results
+USE_NVM := 0
+
+# Build verbosity
+V := 0