-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompile.sh
More file actions
executable file
·74 lines (63 loc) · 1.07 KB
/
compile.sh
File metadata and controls
executable file
·74 lines (63 loc) · 1.07 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
67
68
69
70
71
72
73
74
#!/bin/bash
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
RST='\033[0m'
BLINK='\033[5m'
BOLD='\033[1m'
WD=$(pwd)
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd ${DIR}/build
FILE=${DIR}/build/Makefile
if [ -f "$FILE" ]; then
echo ""
echo ""
echo -e "${BLUE}${BOLD}cleaning...${RST}"
make clean
fi
echo ""
echo ""
echo -e "${BLUE}${BOLD}running cmake...${RST}"
cmake ..
CMAKE=$?
if [ $CMAKE -ne 0 ]; then
cd ${WD}
echo""
echo""
echo -e "${RED}${BOLD}cmake failed!!${RST}"
echo""
echo""
fi
echo ""
echo ""
echo -e "${BLUE}${BOLD}running make...${RST}"
make
MAKE=$?
if [ $MAKE -ne 0 ]; then
cd ${WD}
echo""
echo""
echo -e "${RED}${BOLD}make failed!!${RST}"
echo""
echo""
fi
#make install
#INSTA=$?
#if [ $INSTA -ne 0 ]; then
# cd ${WD}
# echo""
# echo""
# echo -e "${RED}${BOLD}make install failed!!${RST}"
# echo""
# echo""
#fi
cd ${WD}
echo ""
echo ""
if [ $CMAKE -ne 0 ] || [ $MAKE -ne 0 ]; then
echo -e "${RED}${BOLD}${BLINK}FAILED!${RST}"
else
echo -e "${GREEN}${BOLD}${BLINK}SUCCESS!${RST}"
fi
echo ""
echo ""