-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild-Linux.sh
More file actions
66 lines (61 loc) · 1.23 KB
/
build-Linux.sh
File metadata and controls
66 lines (61 loc) · 1.23 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
Build()
{
echo "Building Archetype:"
echo "Create build directory"
mkdir -p build && cd build
echo "Build make files"
cmake ../drivers/archetype .
echo "Build the project"
make
echo
echo "To use Archetype run build/archetype"
echo
}
Clean()
{
DIRECTORY=./build
if [ ! -d "$DIRECTORY" ]; then
echo "build directory does not exist."
else
read -r -p "Delete build directory? [y/N] " response
case "$response" in
[yY][eE][sS]|[yY])
echo "Deleting build directory"
rm -rf $DIRECTORY
;;
*)
echo "Deleting cancelled"
;;
esac
fi
}
Help()
{
# Display Help
echo "Build archetype for Linux."
echo
echo "Syntax: "$0" [-b|c|h]"
echo "options:"
echo "b Build the project."
echo "c Clean the project (deleted build directory)."
echo "h Print this Help."
echo
}
while getopts ":bch" option; do
case $option in
h) # display Help
Help
exit;;
b) # build
Build
exit;;
c) # delete build directory
Clean
exit;;
*)
Help
exit;;
esac
done
Help