Build from submodule by default (make, cmake)
Adapt tests in all.sh:
- tests with submodule enabled (default) no longer need to enable it
explicitly, and no longer need runtime tests, as those are now handled by
all other test cases in this script
- tests with submodule disabled (old default) now need to disable it
explicitly, and execute some runtime tests, as those are no longer tested
anywhere else in this script
Adapt documentation in Readme: remove the section "building with submodule"
and replace it with a new section before the other building sections.
Purposefully don't document how to build not from the submodule, as that
option is going away soon.
diff --git a/Makefile b/Makefile
index 3833185..6a3b818 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,7 @@
+# build crypto form submodule unless explicitly disabled
+USE_CRYPTO_SUBMODULE ?= 1
+
DESTDIR=/usr/local
PREFIX=mbedtls_
@@ -31,7 +34,7 @@
mkdir -p $(DESTDIR)/lib
cp -RP library/libmbedtls.* $(DESTDIR)/lib
cp -RP library/libmbedx509.* $(DESTDIR)/lib
-ifdef USE_CRYPTO_SUBMODULE
+ifneq ($(USE_CRYPTO_SUBMODULE), 0)
mkdir -p $(DESTDIR)/include/psa
cp -rp crypto/include/psa $(DESTDIR)/include
cp -RP crypto/library/libmbedcrypto.* $(DESTDIR)/lib
@@ -53,7 +56,7 @@
rm -f $(DESTDIR)/lib/libmbedtls.*
rm -f $(DESTDIR)/lib/libmbedx509.*
rm -f $(DESTDIR)/lib/libmbedcrypto.*
-ifdef USE_CRYPTO_SUBMODULE
+ifneq ($(USE_CRYPTO_SUBMODULE), 0)
$(MAKE) -C crypto uninstall
endif
@@ -97,7 +100,7 @@
$(MAKE) -C library clean
$(MAKE) -C programs clean
$(MAKE) -C tests clean
-ifdef USE_CRYPTO_SUBMODULE
+ifneq ($(USE_CRYPTO_SUBMODULE), 0)
$(MAKE) -C crypto clean
endif
ifndef WINDOWS