-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile.sh
executable file
·72 lines (59 loc) · 1.41 KB
/
compile.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
echo "\\ \\ \\"
echo " \\ \\ \\"
echo " \\ \\ \\"
response=''
if [ -x Multimap ]; then
response='n'
echo "Do you want to run the previous build? (y/n)"
read response
fi
if [ ! $response = '' ]; then
if [ $response = 'y' ]; then
./Multimap
fi
fi
if [ $response = 'n' -o ! -x Multimap ]; then
if [ -f ./Multimap ]; then
rm ./Multimap
fi
# File cleanup on start
find . -name '*.gcda' -print0 | xargs -0 rm
if [ -d CODE_COVERAGE ]; then
rm -rf CODE_COVERAGE/
fi
# Building the executable
cmake -DBUILD_SHARED_LIBS=ON .
make
# Running the executable if no error occured during building
if [ $? -eq 0 ]; then
echo "Whooo, no errors!"
echo -n $'\360\237\224\245 ' && echo -n $'\360\237\224\245 ' && echo $'\360\237\224\245'
echo "=============="
echo "Run here: "
./Multimap
# Printing the errors if there were any
else
echo "=============="
echo "Errors up here ^ "
echo
echo
fi
fi
# Building test coverage files (if wanted)
echo "Run ended, do you want test coverage? (y\n)"
read response
if [ $response = 'y' ]; then
./coverage.sh
fi
# File cleanup on exit
find . -name '*.gcda' -print0 | xargs -0 rm
if [ $? -eq 0 ]; then
echo
echo
echo "Task successfully ended"
echo
echo
fi
#Fire emoji
#echo $'\360\237\224\245'