diff --git a/scripts/all-core.sh b/scripts/all-core.sh index 4652fe405..3c8471c3c 100644 --- a/scripts/all-core.sh +++ b/scripts/all-core.sh @@ -179,6 +179,7 @@ pre_initialize_variables () { config_files="$CRYPTO_CONFIG_H $CONFIG_TEST_DRIVER_H" fi + export TF_PSA_CRYPTO_ROOT_DIR # Files that are clobbered by some jobs will be backed up. Use a different # suffix from auxiliary scripts so that all.sh and auxiliary scripts can @@ -228,6 +229,8 @@ pre_initialize_variables () { : ${CLANG_EARLIEST:="clang-earliest"} : ${GCC_LATEST:="gcc-latest"} : ${GCC_EARLIEST:="gcc-earliest"} + export OUT_OF_SOURCE_DIR + # if MAKEFLAGS is not set add the -j option to speed up invocations of make if [ -z "${MAKEFLAGS+set}" ]; then export MAKEFLAGS="-j$(all_sh_nproc)" diff --git a/scripts/apidoc_full.sh b/scripts/apidoc_full.sh index 34daf37b5..f125b7b73 100755 --- a/scripts/apidoc_full.sh +++ b/scripts/apidoc_full.sh @@ -12,7 +12,13 @@ set -eu -CONFIG_H='include/mbedtls/mbedtls_config.h' +. $(dirname "$0")/project_detection.sh + +if in_mbedtls_repo; then + CONFIG_H='include/mbedtls/mbedtls_config.h' +elif in_tf_psa_crypto_repo; then + CONFIG_H='include/psa/crypto_config.h' +fi if [ -r $CONFIG_H ]; then :; else echo "$CONFIG_H not found" >&2 @@ -22,7 +28,13 @@ fi CONFIG_BAK=${CONFIG_H}.bak cp -p $CONFIG_H $CONFIG_BAK -scripts/config.py realfull -make apidoc - -mv $CONFIG_BAK $CONFIG_H +if in_mbedtls_repo; then + scripts/config.py realfull + make apidoc + mv $CONFIG_BAK $CONFIG_H +elif in_tf_psa_crypto_repo; then + cd $OUT_OF_SOURCE_DIR + cmake -DCMAKE_BUILD_TYPE:String=Check -DGEN_FILES=ON "$TF_PSA_CRYPTO_ROOT_DIR" + make tfpsacrypto-apidoc + mv $TF_PSA_CRYPTO_ROOT_DIR/$CONFIG_BAK $TF_PSA_CRYPTO_ROOT_DIR/$CONFIG_H +fi diff --git a/scripts/doxygen.sh b/scripts/doxygen.sh index 8c37b20de..a3c7b150f 100755 --- a/scripts/doxygen.sh +++ b/scripts/doxygen.sh @@ -8,8 +8,10 @@ # Abort on errors (and uninitialised variables) set -eu -if [ -d library -a -d include -a -d tests ]; then :; else - echo "Must be run from Mbed TLS root" >&2 +. $(dirname "$0")/project_detection.sh + +if in_mbedtls_repo || in_tf_psa_crypto_repo; then :; else + echo "Must be run from Mbed TLS root or TF-PSA-Crypto root" >&2 exit 1 fi @@ -28,5 +30,11 @@ if grep -E "(warning|error):" doc.filtered; then exit 1; fi -make apidoc_clean +if in_mbedtls_repo; then + make apidoc_clean +elif in_tf_psa_crypto_repo; then + cd $TF_PSA_CRYPTO_ROOT_DIR + rm -rf $OUT_OF_SOURCE_DIR +fi + rm -f doc.out doc.err doc.filtered