Some platforms like the stm32mp, support PLATFORM_FLAVOR to be
empty and extract the information from other variables, e.g.
CFG_EMBED_DTB_SOURCE_FILE.

Support this use case by skipping appending of -$(OPTEE_PLATFORM_FLAVOUR)
to the PLATFORM= variable whenever empty.

Signed-off-by: Ahmad Fatoum <[email protected]>
---
 rules/optee.make | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/rules/optee.make b/rules/optee.make
index 11ec68a0ef0e..a3735dc0f605 100644
--- a/rules/optee.make
+++ b/rules/optee.make
@@ -33,12 +33,16 @@ OPTEE_DEVPKG        := NO
 OPTEE_WRAPPER_BLACKLIST := \
        $(PTXDIST_LOWLEVEL_WRAPPER_BLACKLIST)
 
+OPTEE_PLATFORM         := $(call remove_quotes,$(PTXCONF_OPTEE_PLATFORM))
+OPTEE_PLATFORM_FLAVOUR := $(call 
remove_quotes,$(PTXCONF_OPTEE_PLATFORM_FLAVOUR))
+OPTEE_PLATFORM_FLAVOUR := $(if 
$(OPTEE_PLATFORM_FLAVOUR),-$(OPTEE_PLATFORM_FLAVOUR))
+
 OPTEE_CONF_TOOL := NO
 OPTEE_MAKE_ENV += \
        PATH=$(CROSS_PATH) \
        CROSS_COMPILE=$(COMPILER_PREFIX) \
        $(call ptx/ifdef,PTXCONF_ARCH_ARM64,CFG_ARM64_core=y) \
-       PLATFORM=$(call remove_quotes,$(PTXCONF_OPTEE_PLATFORM))-$(call 
remove_quotes,$(PTXCONF_OPTEE_PLATFORM_FLAVOUR)) \
+       PLATFORM=$(OPTEE_PLATFORM)$(OPTEE_PLATFORM_FLAVOUR) \
        $(call remove_quotes,$(PTXCONF_OPTEE_CFG))
 
 # ----------------------------------------------------------------------------
-- 
2.39.2


Reply via email to