-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathonekeybuild_linux_onlytest.sh
80 lines (64 loc) · 1.27 KB
/
onekeybuild_linux_onlytest.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
73
74
75
76
77
78
79
# @author EricYonng<120453674@qq.com>
# @brief one key build
#!/usr/bin/env bash
BUILD_PATH="build/gmake/"
SCRIPT_PATH="$(cd $(dirname $0); pwd)"
# ver:default debug
VER="debug"
if [ -n "$1" ]
then
if [ "$1" = "release" ]
then
VER="release"
# PATH=$PATH:${SCRIPT_PATH}/3rd/openssl/linux/lib/release/
# PATH=$PATH:${SCRIPT_PATH}/3rd/openssl/linux/lib/debug/
fi
fi
echo $PATH
# check param 1,2 if need clean
NEED_CLEAN=0
if [ -n "$1" ]
then
if [ "$1" = "clean" ]
then
NEED_CLEAN=1
fi
fi
if [ -n "$2" ]
then
if [ "$2" = "clean" ]
then
NEED_CLEAN=1
fi
fi
# give scripts right
# sudo chmod 777 $SCRIPT_PATH/*.sh
# run firstly
echo "run first scripts"
sh $SCRIPT_PATH/runfirstly_scripts.sh
# generate make files
echo "run linuxmakefile_build_onlytest"
sh $SCRIPT_PATH/linuxmakefile_build_onlytest.sh
# build
cd $SCRIPT_PATH/$BUILD_PATH
if [ $NEED_CLEAN = 1 ]
then
echo -e "clean $VER..."
sudo make clean config=$VER;
fi
echo -e "making $VER..."
sudo make -j4 config=$VER
if [ $? -ne 0 ]; then
echo "make fail..."
# quit build dir
cd $SCRIPT_PATH
exit 1
else
echo "make suc!"
# quit build dir
cd $SCRIPT_PATH
fi
# install default:opencoredump
echo "install_onlytest..."
sudo sh $SCRIPT_PATH/install_onlytest.sh $VER
echo "Done!"