forked from chenxiaohui/tb-common-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
46 lines (40 loc) · 820 Bytes
/
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
42
43
44
45
46
#!/bin/bash
if [ -z $TBLIB_ROOT ]; then
echo "设置 TBLIB_ROOT 的环境变量"
exit;
fi
if [ ${TBLIB_ROOT#/} = ${TBLIB_ROOT} ]; then
echo "TBLIB_ROOT must be absolute path!!";
exit 1
fi
REAL_FILE=`readlink -f $0`
cd `dirname $REAL_FILE`
BASE_HOME="`pwd`"
cd $BASE_HOME/tbsys
if [ -z "$1" -o "$1" = 'make' ]; then
sh autogen.sh
CXXFLAGS='-O3 -Wall -D_NO_EXCEPTION' ./configure
make -j 8
fi
if [ -z "$1" -o "$1" = 'install' ]; then
make install
fi
if [ "$1" = 'clean' ]; then
make clean distclean
sh autogen.sh clean
fi
cd $BASE_HOME/tbnet
if [ -z "$1" -o "$1" = 'make' ]; then
sh autogen.sh
./configure
make -j 8
fi
if [ -z "$1" -o "$1" = 'install' ]; then
make install
fi
if [ "$1" = 'clean' ]; then
make clean distclean
sh autogen.sh clean
fi
echo
echo "安装在 $TBLIB_ROOT 目录下了"