Skip to content

Commit

Permalink
Adapt doxygen scripts to run for TF-PSA-Crypto
Browse files Browse the repository at this point in the history
This commit adapts the scripts apidoc_full.sh and doxygen.sh to run for
TF-PSA-Crypto out of source builds.

Signed-off-by: Harry Ramsey <[email protected]>
  • Loading branch information
Harry-Ramsey committed Feb 6, 2025
1 parent a0ae088 commit 7eea683
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 11 deletions.
36 changes: 28 additions & 8 deletions scripts/apidoc_full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,37 @@

set -eu

CONFIG_H='include/mbedtls/mbedtls_config.h'
. $(dirname "$0")/project_detection.sh

if [ -r $CONFIG_H ]; then :; else
echo "$CONFIG_H not found" >&2
CRYPTO_CONFIG_H='include/psa/crypto_config.h'
if in_mbedtls_repo; then
CONFIG_H='include/mbedtls/mbedtls_config.h'
CRYPTO_CONFIG_H='tf-psa-crypto/include/psa/crypto_config.h'

if [ -r $CONFIG_H ]; then :; else
echo "$CONFIG_H not found" >&2
exit 1
fi
fi

if [ -r $CRYPTO_CONFIG_H ]; then :; else
echo "$CRYPTO_CONFIG_H not found" >&2
exit 1
fi

CONFIG_BAK=${CONFIG_H}.bak
cp -p $CONFIG_H $CONFIG_BAK
CRYPTO_CONFIG_BAK=${CRYPTO_CONFIG_H}.bak
cp -p $CRYPTO_CONFIG_H $CRYPTO_CONFIG_BAK

scripts/config.py realfull
make apidoc
if in_mbedtls_repo; then
CONFIG_BAK=${CONFIG_H}.bak
cp -p $CONFIG_H $CONFIG_BAK
scripts/config.py realfull
make apidoc
mv $CONFIG_BAK $CONFIG_H
elif in_tf_psa_crypto_repo; then
scripts/config.py full
cmake -DCMAKE_BUILD_TYPE:String=Check -DGEN_FILES=ON .
make tfpsacrypto-apidoc
fi

mv $CONFIG_BAK $CONFIG_H
mv $CRYPTO_CONFIG_BAK $CRYPTO_CONFIG_H
11 changes: 8 additions & 3 deletions scripts/doxygen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -28,5 +30,8 @@ if grep -E "(warning|error):" doc.filtered; then
exit 1;
fi

make apidoc_clean
if in_mbedtls_repo; then
make apidoc_clean
fi

rm -f doc.out doc.err doc.filtered

0 comments on commit 7eea683

Please sign in to comment.