mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 17:44:19 +00:00
Merge "feat(build): add ability to define platform specific defaults" into integration
This commit is contained in:
commit
d7890a5f2b
2 changed files with 10 additions and 2 deletions
8
Makefile
8
Makefile
|
@ -32,6 +32,12 @@ include ${MAKE_HELPERS_DIRECTORY}common.mk
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
include ${MAKE_HELPERS_DIRECTORY}defaults.mk
|
include ${MAKE_HELPERS_DIRECTORY}defaults.mk
|
||||||
|
include ${MAKE_HELPERS_DIRECTORY}plat_helpers.mk
|
||||||
|
|
||||||
|
# To be able to set platform specific defaults
|
||||||
|
ifneq ($(PLAT_DEFAULTS_MAKEFILE_FULL),)
|
||||||
|
include ${PLAT_DEFAULTS_MAKEFILE_FULL}
|
||||||
|
endif
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Configure the toolchains used to build TF-A and its tools
|
# Configure the toolchains used to build TF-A and its tools
|
||||||
|
@ -42,7 +48,6 @@ include ${MAKE_HELPERS_DIRECTORY}toolchain.mk
|
||||||
# Assertions enabled for DEBUG builds by default
|
# Assertions enabled for DEBUG builds by default
|
||||||
ENABLE_ASSERTIONS := ${DEBUG}
|
ENABLE_ASSERTIONS := ${DEBUG}
|
||||||
ENABLE_PMF := ${ENABLE_RUNTIME_INSTRUMENTATION}
|
ENABLE_PMF := ${ENABLE_RUNTIME_INSTRUMENTATION}
|
||||||
PLAT := ${DEFAULT_PLAT}
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Checkpatch script options
|
# Checkpatch script options
|
||||||
|
@ -407,7 +412,6 @@ include common/backtrace/backtrace.mk
|
||||||
################################################################################
|
################################################################################
|
||||||
# Generic definitions
|
# Generic definitions
|
||||||
################################################################################
|
################################################################################
|
||||||
include ${MAKE_HELPERS_DIRECTORY}plat_helpers.mk
|
|
||||||
|
|
||||||
ifeq (${BUILD_BASE},)
|
ifeq (${BUILD_BASE},)
|
||||||
BUILD_BASE := ./build
|
BUILD_BASE := ./build
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
ifndef PLAT_HELPERS_MK
|
ifndef PLAT_HELPERS_MK
|
||||||
PLAT_HELPERS_MK := $(lastword $(MAKEFILE_LIST))
|
PLAT_HELPERS_MK := $(lastword $(MAKEFILE_LIST))
|
||||||
|
|
||||||
|
PLAT:= ${DEFAULT_PLAT}
|
||||||
ifeq (${PLAT},)
|
ifeq (${PLAT},)
|
||||||
$(error "Error: Unknown platform. Please use PLAT=<platform name> to specify the platform")
|
$(error "Error: Unknown platform. Please use PLAT=<platform name> to specify the platform")
|
||||||
endif
|
endif
|
||||||
|
@ -18,15 +19,18 @@ ifndef PLAT_HELPERS_MK
|
||||||
# TF_PLATFORM_ROOT can be overridden for when building tools directly
|
# TF_PLATFORM_ROOT can be overridden for when building tools directly
|
||||||
TF_PLATFORM_ROOT ?= plat/
|
TF_PLATFORM_ROOT ?= plat/
|
||||||
PLAT_MAKEFILE := platform.mk
|
PLAT_MAKEFILE := platform.mk
|
||||||
|
PLAT_DEFAULTS_MAKEFILE := platform_defaults.mk
|
||||||
|
|
||||||
# Generate the platforms list by recursively searching for all directories
|
# Generate the platforms list by recursively searching for all directories
|
||||||
# under /plat containing a PLAT_MAKEFILE. Append each platform with a `|`
|
# under /plat containing a PLAT_MAKEFILE. Append each platform with a `|`
|
||||||
# char and strip out the final '|'.
|
# char and strip out the final '|'.
|
||||||
ALL_PLATFORM_MK_FILES := $(call rwildcard,${TF_PLATFORM_ROOT},${PLAT_MAKEFILE})
|
ALL_PLATFORM_MK_FILES := $(call rwildcard,${TF_PLATFORM_ROOT},${PLAT_MAKEFILE})
|
||||||
|
ALL_PLATFORM_MK_DEF_FILES := $(call rwildcard,${TF_PLATFORM_ROOT},${PLAT_DEFAULTS_MAKEFILE})
|
||||||
ALL_PLATFORM_DIRS := $(patsubst %/,%,$(dir ${ALL_PLATFORM_MK_FILES}))
|
ALL_PLATFORM_DIRS := $(patsubst %/,%,$(dir ${ALL_PLATFORM_MK_FILES}))
|
||||||
ALL_PLATFORMS := $(sort $(notdir ${ALL_PLATFORM_DIRS}))
|
ALL_PLATFORMS := $(sort $(notdir ${ALL_PLATFORM_DIRS}))
|
||||||
|
|
||||||
PLAT_MAKEFILE_FULL := $(filter %/${PLAT}/${PLAT_MAKEFILE},${ALL_PLATFORM_MK_FILES})
|
PLAT_MAKEFILE_FULL := $(filter %/${PLAT}/${PLAT_MAKEFILE},${ALL_PLATFORM_MK_FILES})
|
||||||
|
PLAT_DEFAULTS_MAKEFILE_FULL := $(filter %/${PLAT}/${PLAT_DEFAULTS_MAKEFILE},${ALL_PLATFORM_MK_DEF_FILES})
|
||||||
PLATFORM_LIST := $(subst ${space},|,${ALL_PLATFORMS})
|
PLATFORM_LIST := $(subst ${space},|,${ALL_PLATFORMS})
|
||||||
ifeq ($(PLAT_MAKEFILE_FULL),)
|
ifeq ($(PLAT_MAKEFILE_FULL),)
|
||||||
$(error "Error: Invalid platform. The following platforms are available: ${PLATFORM_LIST}")
|
$(error "Error: Invalid platform. The following platforms are available: ${PLATFORM_LIST}")
|
||||||
|
|
Loading…
Add table
Reference in a new issue