-
Notifications
You must be signed in to change notification settings - Fork 133
/
build.sh
executable file
·55 lines (43 loc) · 942 Bytes
/
build.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
52
53
54
55
#!/usr/bin/env bash
#building trantor
function build_trantor() {
#Saving current directory
current_dir="${PWD}"
#The folder we will build
build_dir='./build'
if [ -d $build_dir ]; then
echo "Deleted folder: ${build_dir}"
rm -rf $build_dir
fi
#Creating building folder
echo "Created building folder: ${build_dir}"
mkdir $build_dir
echo "Entering folder: ${build_dir}"
cd $build_dir
echo "Start building trantor ..."
if [ $1 -eq 1 ]; then
cmake .. -DBUILD_TESTING=on
else
cmake ..
fi
#If errors then exit
if [ "$?" != "0" ]; then
exit -1
fi
make
#If errors then exit
if [ "$?" != "0" ]; then
exit -1
fi
echo "Installing ..."
sudo make install
#Reback current directory
cd $current_dir
exit 0
#Ok!
}
if [ "$1" = "-t" ]; then
build_trantor 1
else
build_trantor 0
fi