crypto-client test: add mechanism to build crypto library for client and server
It includes changes to:
- tests/Makefile: build the library for client and server in different
folders. It mimica the libtestdriver1 behavior (without functions
renaming though).
- tests/scripts/all.sh: helper function to build for client and
server with some default configuration for each of them.
- crypto_spe.h: this is dummy file taken from the already existing
tests. It's just meant to pacify the compiler, not to provide
something useful. It will likely be changed in the future.
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
diff --git a/tests/Makefile b/tests/Makefile
index c2a0b84..ebe3d4a 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -173,6 +173,7 @@
rm -f include/test/instrument_record_status.h
rm -f include/alt-extra/*/*_alt.h
rm -rf libtestdriver1
+ rm -rf libpsaclient libpsaserver
rm -f ../library/libtestdriver1.a
else
if exist *.c del /Q /F *.c
@@ -246,3 +247,17 @@
echo " Gen $@"
sed <../include/psa/crypto.h >$@ -n 's/^psa_status_t \([A-Za-z0-9_]*\)(.*/#define \1(...) RECORD_STATUS("\1", \1(__VA_ARGS__))/p'
endif
+
+libpsaclient libpsaserver:
+ # Clone the library and include folder for client and server builds.
+ rm -Rf ./$@
+ mkdir ./$@
+ cp -Rf ../library ./$@
+ cp -Rf ../include ./$@
+ cp -Rf ../scripts ./$@
+ mkdir ./$@/3rdparty
+ touch ./$@/3rdparty/Makefile.inc
+ cp ./psa-client-server/psasim/include/crypto_spe.h ./$@/include/psa/
+
+ # Build the libraries.
+ $(MAKE) -C ./$@/library CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" libmbedcrypto.a libmbedx509.a libmbedtls.a