|
12 | 12 |
|
13 | 13 | set -eu
|
14 | 14 |
|
15 |
| -CONFIG_H='include/mbedtls/mbedtls_config.h' |
| 15 | +. $(dirname "$0")/project_detection.sh |
16 | 16 |
|
17 |
| -if [ -r $CONFIG_H ]; then :; else |
18 |
| - echo "$CONFIG_H not found" >&2 |
| 17 | +CRYPTO_CONFIG_H='include/psa/crypto_config.h' |
| 18 | +if in_mbedtls_repo; then |
| 19 | + CONFIG_H='include/mbedtls/mbedtls_config.h' |
| 20 | + CRYPTO_CONFIG_H='tf-psa-crypto/include/psa/crypto_config.h' |
| 21 | + |
| 22 | + if [ -r $CONFIG_H ]; then :; else |
| 23 | + echo "$CONFIG_H not found" >&2 |
| 24 | + exit 1 |
| 25 | + fi |
| 26 | +fi |
| 27 | + |
| 28 | +if [ -r $CRYPTO_CONFIG_H ]; then :; else |
| 29 | + echo "$CRYPTO_CONFIG_H not found" >&2 |
19 | 30 | exit 1
|
20 | 31 | fi
|
21 | 32 |
|
22 |
| -CONFIG_BAK=${CONFIG_H}.bak |
23 |
| -cp -p $CONFIG_H $CONFIG_BAK |
| 33 | +CRYPTO_CONFIG_BAK=${CRYPTO_CONFIG_H}.bak |
| 34 | +cp -p $CRYPTO_CONFIG_H $CRYPTO_CONFIG_BAK |
24 | 35 |
|
25 |
| -scripts/config.py realfull |
26 |
| -make apidoc |
| 36 | +if in_mbedtls_repo; then |
| 37 | + CONFIG_BAK=${CONFIG_H}.bak |
| 38 | + cp -p $CONFIG_H $CONFIG_BAK |
| 39 | + scripts/config.py realfull |
| 40 | + make apidoc |
| 41 | + mv $CONFIG_BAK $CONFIG_H |
| 42 | +elif in_tf_psa_crypto_repo; then |
| 43 | + scripts/config.py realfull |
| 44 | + TF_PSA_CRYPTO_ROOT_DIR=$PWD |
| 45 | + TEMP_DIR=$(mktemp --directory) |
| 46 | + cd $TEMP_DIR |
| 47 | + cmake -DCMAKE_BUILD_TYPE:String=Check -DGEN_FILES=ON $TF_PSA_CRYPTO_ROOT_DIR |
| 48 | + make tfpsacrypto-apidoc |
| 49 | +fi |
27 | 50 |
|
28 |
| -mv $CONFIG_BAK $CONFIG_H |
| 51 | +mv $CRYPTO_CONFIG_BAK $CRYPTO_CONFIG_H |
0 commit comments