diff --git a/library/Makefile b/library/Makefile index 8195e2423a..fc0cffb5c7 100644 --- a/library/Makefile +++ b/library/Makefile @@ -16,9 +16,6 @@ include $(MBEDTLS_PATH)/framework/exported.make include $(MBEDTLS_PATH)/scripts/crypto-common.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 - # List the generated files without running a script, so that this # works with no tooling dependencies when GEN_FILES is disabled. GENERATED_FILES := \ @@ -46,10 +43,14 @@ LDFLAGS ?= # ../tf-psa-crypto/drivers/builtin/include for public headers and ., # ../tf-psa-crypto/core and ../tf-psa-crypto/drivers/builtin/src for # private headers. -LOCAL_CFLAGS = $(WARNING_CFLAGS) -I. -I../tf-psa-crypto/core \ +LOCAL_CFLAGS = $(WARNING_CFLAGS) -I. \ + -I../tf-psa-crypto/core \ -I../tf-psa-crypto/drivers/builtin/src \ - -I../include -I../tf-psa-crypto/include \ - -I../tf-psa-crypto/drivers/builtin/include -D_FILE_OFFSET_BITS=64 + -I../include \ + -I../tf-psa-crypto/include \ + -I../tf-psa-crypto/drivers/builtin/include \ + $(THIRDPARTY_INCLUDES) \ + -D_FILE_OFFSET_BITS=64 LOCAL_LDFLAGS = ifdef DEBUG @@ -123,11 +124,6 @@ OBJS_CRYPTO = $(patsubst %.c, %.o,$(wildcard $(TF_PSA_CRYPTO_CORE_PATH)/*.c $(TF GENERATED_OBJS_CRYPTO = $(TF_PSA_CRYPTO_CORE_PATH)/psa_crypto_driver_wrappers_no_static.o OBJS_CRYPTO := $(filter-out $(GENERATED_OBJS_CRYPTO),$(OBJS_CRYPTO)) OBJS_CRYPTO += $(GENERATED_OBJS_CRYPTO) - -THIRDPARTY_DIR := $(MBEDTLS_PATH)/tf-psa-crypto/drivers -include $(MBEDTLS_PATH)/tf-psa-crypto/drivers/everest/Makefile.inc -include $(MBEDTLS_PATH)/tf-psa-crypto/drivers/p256-m/Makefile.inc -LOCAL_CFLAGS+=$(THIRDPARTY_INCLUDES) OBJS_CRYPTO+=$(THIRDPARTY_CRYPTO_OBJECTS) OBJS_X509= \ diff --git a/scripts/common.make b/scripts/common.make index 9be3b2db53..f3754e587c 100644 --- a/scripts/common.make +++ b/scripts/common.make @@ -47,11 +47,6 @@ LOCAL_LDFLAGS = ${MBEDTLS_TEST_OBJS} \ -lmbedcrypto$(SHARED_SUFFIX) endif -THIRDPARTY_DIR = $(MBEDTLS_PATH)/tf-psa-crypto/drivers -include $(THIRDPARTY_DIR)/everest/Makefile.inc -include $(THIRDPARTY_DIR)/p256-m/Makefile.inc -LOCAL_CFLAGS+=$(THIRDPARTY_INCLUDES) - ifdef PSASIM MBEDLIBS=$(PSASIM_PATH)/client_libs/libmbedcrypto.a \ $(PSASIM_PATH)/client_libs/libmbedx509.a \ diff --git a/scripts/crypto-common.make b/scripts/crypto-common.make index 5a79bc482b..315f14df10 100644 --- a/scripts/crypto-common.make +++ b/scripts/crypto-common.make @@ -23,3 +23,12 @@ ifeq (,$(wildcard $(TF_PSA_CRYPTO_PATH)/core/psa_crypto.c)) $(error $$(TF_PSA_CRYPTO_PATH)/core/psa_crypto.c not found) endif +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 + +# Gather information about crypto drivers that are separate from the main +# "builtin" driver (historically located in /3rdparty in Mbed TLS 2.x/3.x). +THIRDPARTY_DIR := $(TF_PSA_CRYPTO_PATH)/drivers +THIRDPARTY_INCLUDES = +include $(TF_PSA_CRYPTO_PATH)/drivers/everest/Makefile.inc +include $(TF_PSA_CRYPTO_PATH)/drivers/p256-m/Makefile.inc