Merge pull request #5237 from davidhorstmann-arm/demo-out-of-tree

This commit is contained in:
Dave Rodgman 2023-05-19 21:27:24 +01:00 committed by GitHub
commit 7f97675b64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 2 deletions

View File

@ -17,9 +17,27 @@
set -e -u
program="${0%/*}"/key_ladder_demo
program_name="key_ladder_demo"
program="${0%/*}/$program_name"
files_to_clean=
if [ ! -e "$program" ]; then
# Look for programs in the current directory and the directories above it
for dir in "." ".." "../.."; do
program="$dir/programs/psa/$program_name"
if [ -e "$program" ]; then
break
fi
done
if [ ! -e "$program" ]; then
echo "Could not find $program_name executable"
echo "If building out-of-tree, this script must be run" \
"from the project build directory."
exit 1
fi
fi
run () {
echo
echo "# $1"

View File

@ -20,8 +20,29 @@
set -e -u
program_name="dlopen"
program_dir="${0%/*}"
program="$program_dir/dlopen"
program="$program_dir/$program_name"
if [ ! -e "$program" ]; then
# Look for programs in the current directory and the directories above it
for dir in "." ".." "../.."; do
program_dir="$dir/programs/test"
program="$program_dir/$program_name"
if [ -e "$program" ]; then
break
fi
done
if [ ! -e "$program" ]; then
echo "Could not find $program_name program"
echo "Make sure that Mbed TLS is built as a shared library." \
"If building out-of-tree, this script must be run" \
"from the project build directory."
exit 1
fi
fi
top_dir="$program_dir/../.."
library_dir="$top_dir/library"