mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-05-10 00:49:04 +08:00
In library, with make, only require the framework for generated files
This way, `make lib` will work in the absence of the framework, as long as generated files are present. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
f9bbe0de4c
commit
48230e84cb
14
Makefile
14
Makefile
@ -2,7 +2,19 @@ DESTDIR=/usr/local
|
|||||||
PREFIX=mbedtls_
|
PREFIX=mbedtls_
|
||||||
PERL ?= perl
|
PERL ?= perl
|
||||||
|
|
||||||
include framework/exported.make
|
ifneq (,$(filter-out lib library/%,$(or $(MAKECMDGOALS),all)))
|
||||||
|
ifeq (,$(wildcard 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 framework/exported.make
|
||||||
|
endif
|
||||||
|
|
||||||
.SILENT:
|
.SILENT:
|
||||||
|
|
||||||
|
@ -2,15 +2,25 @@ ifndef MBEDTLS_PATH
|
|||||||
MBEDTLS_PATH := ..
|
MBEDTLS_PATH := ..
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq (,$(wildcard $(MBEDTLS_PATH)/framework/exported.make))
|
GENERATED_FILES := \
|
||||||
define error_message
|
error.c version_features.c \
|
||||||
|
ssl_debug_helpers_generated.c \
|
||||||
|
psa_crypto_driver_wrappers.h \
|
||||||
|
psa_crypto_driver_wrappers_no_static.c
|
||||||
|
|
||||||
|
ifneq ($(GENERATED_FILES),$(wildcard $(GENERATED_FILES)))
|
||||||
|
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.
|
$(MBEDTLS_PATH)/framework/exported.make not found.
|
||||||
Run `git submodule update --init` to fetch the submodule contents.
|
Run `git submodule update --init` to fetch the submodule contents.
|
||||||
This is a fatal error
|
This is a fatal error
|
||||||
endef
|
endef
|
||||||
$(error $(error_message))
|
$(error $(error_message))
|
||||||
|
endif
|
||||||
|
include $(MBEDTLS_PATH)/framework/exported.make
|
||||||
endif
|
endif
|
||||||
include $(MBEDTLS_PATH)/framework/exported.make
|
|
||||||
|
|
||||||
# Also see "include/mbedtls/mbedtls_config.h"
|
# Also see "include/mbedtls/mbedtls_config.h"
|
||||||
|
|
||||||
@ -327,11 +337,6 @@ libmbedcrypto.dll: $(OBJS_CRYPTO)
|
|||||||
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) -o $@ -c $<
|
$(CC) $(LOCAL_CFLAGS) $(CFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
.PHONY: generated_files
|
.PHONY: generated_files
|
||||||
GENERATED_FILES = \
|
|
||||||
error.c version_features.c \
|
|
||||||
ssl_debug_helpers_generated.c \
|
|
||||||
psa_crypto_driver_wrappers.h \
|
|
||||||
psa_crypto_driver_wrappers_no_static.c
|
|
||||||
generated_files: $(GENERATED_FILES)
|
generated_files: $(GENERATED_FILES)
|
||||||
|
|
||||||
# See root Makefile
|
# See root Makefile
|
||||||
|
Loading…
x
Reference in New Issue
Block a user