-
Notifications
You must be signed in to change notification settings - Fork 0
/
snap_script.sh
executable file
·45 lines (37 loc) · 1003 Bytes
/
snap_script.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
ROOT_DIR=$(dirname $(readlink -f "$BASH_SOURCE"))
set -e
## project, target
run_target()
{
ACTION_ROOT=`pwd`/$1
sed -i "s;export ACTION_ROOT=.*;export ACTION_ROOT=${ACTION_ROOT};" $SNAP_ROOT/snap_env.sh
make -C $SNAP_ROOT $2
}
usage()
{
echo "usage: $(basename $BASH_SOURCE) -p Project [-t Target] | [-h]]"
}
target=sim
project=Simple
while [ "$1" != "" ]; do
case $1 in
-p | --project ) shift
project=$1
;;
-t | --target ) shift
target=$1
;;
-h | --help ) usage
exit
;;
* ) usage
exit 1
esac
shift
done
# Test code to verify command line processing
echo "Project: $project"
echo "Target: $target"
echo "SNAP Root: $SNAP_ROOT"
run_target $project $target