-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·73 lines (55 loc) · 961 Bytes
/
build.sh
File metadata and controls
executable file
·73 lines (55 loc) · 961 Bytes
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
#!/bin/bash
set -e
PROJ_ROOT=$PWD
BUILD_ROOT=$PROJ_ROOT
echo -e "\033[31m Current Build Root: $BUILD_ROOT \033[0m"
BIN_PATH=$BUILD_ROOT/bin
if [ -d $BIN_PATH ];then
cd $BIN_PATH
rm -rf *
cd ..
else
mkdir -p $BIN_PATH
fi
INC_PATH=$BUILD_ROOT/inc
if [ -d $INC_PATH ];then
cd $INC_PATH
rm -rf *
cd ..
else
mkdir -p $INC_PATH
fi
#cp without path
#find ./src/ -name "*.h" |xargs -i cp {} ./inc/
DEST_PATH="./inc/"
headers=`find . -name *.h`
#echo $headers
for file in $headers
do
#echo $file
temp=${file#*/}
temp=${temp#*/}
dstfile=$DEST_PATH$temp
dstpath=${dstfile%/*}
#echo $dstpath
[ -d $dstpath ] || mkdir -p $dstpath
cp -R $file $dstfile
done
LIB_PATH=$BUILD_ROOT/lib
if [ -d $LIB_PATH ];then
cd $LIB_PATH
rm -rf *
cd ..
else
mkdir -p $LIB_PATH
fi
BUILD_PATH=$BUILD_ROOT/build
if [ -d $BUILD_PATH ];then
cd $BUILD_PATH
rm -rf *
else
mkdir -p $BUILD_PATH
cd $BUILD_PATH
fi
cmake $PROJ_ROOT
make -j4