From d13d041ed090bec4324687c4c154b2e66f7d0429 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 10 Dec 2025 18:23:21 +0100 Subject: [PATCH] Check for the framework submodule before anything else If we don't have submodules, we can't do anything. Signed-off-by: Gilles Peskine --- library/Makefile | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/library/Makefile b/library/Makefile index 6d43b85e18..c0d37fdb8d 100644 --- a/library/Makefile +++ b/library/Makefile @@ -2,6 +2,18 @@ ifndef MBEDTLS_PATH MBEDTLS_PATH := .. endif +ifeq (,$(wildcard $(MBEDTLS_PATH)/framework/exported.make)) + # Use the define keyword to get a multi-line message. + # GNU make appends ". Stop.", so tweak the ending of our message accordingly. + define error_message +$(MBEDTLS_PATH)/framework/exported.make not found. +Run `git submodule update --init` to fetch the submodule contents. +This is a fatal error + endef + $(error $(error_message)) +endif +include $(MBEDTLS_PATH)/framework/exported.make + TF_PSA_CRYPTO_CORE_PATH = $(MBEDTLS_PATH)/tf-psa-crypto/core TF_PSA_CRYPTO_DRIVERS_BUILTIN_SRC_PATH = $(MBEDTLS_PATH)/tf-psa-crypto/drivers/builtin/src @@ -24,18 +36,6 @@ GENERATED_FILES += \ $(TF_PSA_CRYPTO_CORE_PATH)/tf_psa_crypto_config_check_final.h \ $(TF_PSA_CRYPTO_CORE_PATH)/tf_psa_crypto_config_check_user.h -ifeq (,$(wildcard $(MBEDTLS_PATH)/framework/exported.make)) - # Use the define keyword to get a multi-line message. - # GNU make appends ". Stop.", so tweak the ending of our message accordingly. - define error_message -$(MBEDTLS_PATH)/framework/exported.make not found. -Run `git submodule update --init` to fetch the submodule contents. -This is a fatal error - endef - $(error $(error_message)) -endif -include $(MBEDTLS_PATH)/framework/exported.make - # Also see "include/mbedtls/mbedtls_config.h" CFLAGS ?= -O2