Skip to content

Commit

Permalink
build: Add optional argument for build dir path
Browse files Browse the repository at this point in the history
The additional optional argument is useful to allow
the end user to create multiple build directories
for various applications and/or variants.


Signed-off-by: Hugues Kamba Mpiana <[email protected]>
  • Loading branch information
hugueskamba committed Jan 9, 2024
1 parent 4862547 commit cfa5464
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions release_changes/202401091359.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build: Add custom build directory option
13 changes: 9 additions & 4 deletions tools/scripts/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2023 Arm Limited and/or its affiliates
# Copyright 2023-2024 Arm Limited and/or its affiliates
# <[email protected]>
# SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -66,10 +66,11 @@ function show_usage {
cat <<EOF
Usage: $0 [options] example
Download dependencies, apply patches and build an example.
Apply patches and build an example.
Options:
-h,--help Show this help
-p,--path Path to the build directory
-c,--clean Clean build
-t,--target Build target (corstone300 or corstone310)
--toolchain Compiler (GNU or ARMCLANG)
Expand All @@ -87,8 +88,8 @@ if [[ $# -eq 0 ]]; then
exit 1
fi

SHORT=t:,c,h,q
LONG=target:,toolchain:,clean,help,configure-only,certificate_path:,private_key_path:,integration-tests
SHORT=t:,c,h,q,p:
LONG=target:,toolchain:,clean,help,configure-only,certificate_path:,private_key_path:,integration-tests:,path:
OPTS=$(getopt -n build --options $SHORT --longoptions $LONG -- "$@")

eval set -- "$OPTS"
Expand All @@ -104,6 +105,10 @@ do
CLEAN=1
shift
;;
-p | --path )
BUILD_PATH=$2
shift 2
;;
-t | --target )
TARGET=$2
shift 2
Expand Down
10 changes: 7 additions & 3 deletions tools/scripts/run.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# Copyright 2023 Arm Limited and/or its affiliates
# Copyright 2023-2024 Arm Limited and/or its affiliates
# <[email protected]>
# SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -31,8 +31,8 @@ Examples:
EOF
}

SHORT=t:,f:,h
LONG=target:,fvp_type:,help
SHORT=t:,f:,h,p:
LONG=target:,fvp_type:,help,path:
OPTS=$(getopt -n run --options $SHORT --longoptions $LONG -- "$@")

eval set -- "$OPTS"
Expand All @@ -44,6 +44,10 @@ do
show_usage
exit 0
;;
-p | --path )
BUILD_PATH=$2
shift 2
;;
-t | --target )
TARGET=$2
shift 2
Expand Down

0 comments on commit cfa5464

Please sign in to comment.