-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
41 lines (37 loc) · 1.02 KB
/
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
# 1 compile and install, use command:
# bash build.sh
#
# 2 remove all build files, use command:
# bash build.sh clean
#
# 3 remove all build files and build from scratch, use command:
# bash build.sh clean_build
func=default_build
if [ -n "$1" ]; then
func=$1
fi
base_dir=`cd $(dirname $0); pwd -P`
root_dir=$base_dir/..
source $base_dir/../mazu_dev/env_setup.sh x86_64
build_dir=$base_dir/build
if [ "$func" == "clean" -o "$func" == "clean_build" ]; then
if [ -d $build_dir ]; then
echo "remove build directory"
rm $build_dir -rf
fi
if [ -d $NIO_INSTALL_PREFIX ]; then
echo "remove install files"
rm $NIO_INSTALL_PREFIX/*/planner/* -rf
if [[ -e $NIO_INSTALL_PREFIX/lib/libplanner_* ]]; then
rm $NIO_INSTALL_PREFIX/lib/libplanner_*
fi
fi
fi
if [ "$func" == "clean_build" -o "$func" == "default_build" ]; then
if [ ! -d $build_dir ]; then
echo "make build path"
mkdir -p $build_dir
fi
cd $build_dir && cmake .. -DCMAKE_TOOLCHAIN_FILE=$PNC_CMAKE_TC_FILE
make -j8 && make install
fi