summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2018-04-26 15:56:15 +0200
committerSandrine Bailleux <sandrine.bailleux@arm.com>2018-04-27 13:16:01 +0100
commit7b14fdc6f08d049781e7b097fd49d595c39c5358 (patch)
tree77c6237d0e4c5f09d0528c91d2b62f5e2cbad41b
parenta83d41d708a870a055216d430a2eaa5d7a4573d2 (diff)
Build: Refactor build options
No functional change, just making the Makefile more concise and aligned with the TF one. Change-Id: I03385e4957ea992bbcb55a8e21b70d6297f0c00d Signed-off-by: Sandrine Bailleux <sandrine.bailleux@arm.com>
-rw-r--r--Makefile59
1 files changed, 26 insertions, 33 deletions
diff --git a/Makefile b/Makefile
index 40f8336..fe36d89 100644
--- a/Makefile
+++ b/Makefile
@@ -167,46 +167,39 @@ TFTF_SOURCES := ${FRAMEWORK_SOURCES} \
${TESTS_SOURCES} \
${PLAT_SOURCES}
-# Define the AARCH32/AARCH64 flag based on the ARCH flag
-ifeq (${ARCH},aarch32)
- $(eval $(call add_define,AARCH32))
-else
- $(eval $(call add_define,AARCH64))
-endif
-
-# Process DEBUG flag
+################################################################################
+# Build options checks
+################################################################################
$(eval $(call assert_boolean,DEBUG))
-$(eval $(call add_define,DEBUG))
-
-# Process USE_NVM flag
-$(eval $(call assert_boolean,USE_NVM))
-$(eval $(call add_define,USE_NVM))
-
-# Process SHELL_COLOR flag
-$(eval $(call assert_boolean,SHELL_COLOR))
-$(eval $(call add_define,SHELL_COLOR))
-
-# Process LOG_LEVEL flag
-$(eval $(call add_define,LOG_LEVEL))
-
-# Process NEW_TEST_SESSION flag
+$(eval $(call assert_boolean,ENABLE_ASSERTIONS))
+$(eval $(call assert_boolean,FIRMWARE_UPDATE))
+$(eval $(call assert_boolean,FWU_BL_TEST))
$(eval $(call assert_boolean,NEW_TEST_SESSION))
-$(eval $(call add_define,NEW_TEST_SESSION))
+$(eval $(call assert_boolean,SHELL_COLOR))
+$(eval $(call assert_boolean,USE_NVM))
-# Process FIRMWARE_UPDATE flag
-$(eval $(call assert_boolean,FIRMWARE_UPDATE))
+################################################################################
+# Add definitions to the cpp preprocessor based on the current build options.
+# This is done after including the platform specific makefile to allow the
+# platform to overwrite the default options
+################################################################################
+$(eval $(call add_define,DEBUG))
+$(eval $(call add_define,ENABLE_ASSERTIONS))
$(eval $(call add_define,FIRMWARE_UPDATE))
-
-# Process FWU_BL_TEST flag
-$(eval $(call assert_boolean,FWU_BL_TEST))
$(eval $(call add_define,FWU_BL_TEST))
+$(eval $(call add_define,LOG_LEVEL))
+$(eval $(call add_define,NEW_TEST_SESSION))
+$(eval $(call add_define,PLAT_${PLAT}))
+$(eval $(call add_define,SHELL_COLOR))
+$(eval $(call add_define,USE_NVM))
-# Process ENABLE_ASSERTIONS flag
-$(eval $(call assert_boolean,ENABLE_ASSERTIONS))
-$(eval $(call add_define,ENABLE_ASSERTIONS))
+ifeq (${ARCH},aarch32)
+ $(eval $(call add_define,AARCH32))
+else
+ $(eval $(call add_define,AARCH64))
+endif
-# Process PLAT flag
-$(eval $(call add_define,PLAT_${PLAT}))
+################################################################################
ifeq (${FIRMWARE_UPDATE},1)
include fwu/ns_bl1u/ns_bl1u.mk