-
Notifications
You must be signed in to change notification settings - Fork 36
/
clone.sh
51 lines (41 loc) · 1.17 KB
/
clone.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
46
47
48
49
50
51
#!/bin/bash
usage="Usage: bash $(basename "$0") [-h]
Clone the gem5 repository into the gem5 directory.
Clone the arm-gem5-rsk repository into the arm-gem5-rsk directory.
-h display this help and exit"
error="ERROR: already in the arm-gem5-rsk directory. Move this script to a different location."
gem5_git="https://github.com/gem5/gem5.git"
arm_gem5_rsk_git="https://github.com/arm-university/arm-gem5-rsk.git"
gem5_dest="gem5"
arm_gem5_rsk_dest="arm-gem5-rsk"
gem5_tag="v23.0.0.1"
git_clone()
{
local repo=$1
local dest=$2
if [ ! -e "$dest" ]; then
git clone "$repo" "$dest"
else
echo "Skipping $dest: Destionation already exists."
fi
echo
}
echo "ARM Research Starter Kit: System Modeling using gem5
Find more information at: https://www.arm.com/resources/research/enablement
..."
sleep 1
if [ ${PWD##*/} = "arm-gem5-rsk" ]; then
echo "$error"
exit 1
fi
if [ $# = 1 ] && [ $1 = "-h" ]; then
echo "$usage"
exit 0
else
git_clone "${gem5_git}" "${gem5_dest}"
git_clone "${arm_gem5_rsk_git}" "${arm_gem5_rsk_dest}"
(
cd "${gem5_dest}"
git checkout -b "${gem5_tag}" "tags/${gem5_tag}"
)
fi