-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sh
38 lines (35 loc) · 1 KB
/
setup.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
export E1039_ONLMON=$(dirname $(readlink -f $BASH_SOURCE))
DIR_BUILD=$E1039_ONLMON/build
DIR_INST=$E1039_ONLMON/inst
source /data2/e1039/this-e1039.sh
export LD_LIBRARY_PATH=$DIR_INST/lib:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=$DIR_INST/include:$ROOT_INCLUDE_PATH
function cmake-this {
if [ -e $DIR_BUILD ] ; then
echo "Clean up the build directory..."
\rm -rf $DIR_BUILD
fi
#if [ -e $DIR_INST ] ; then
# echo "Clean up the install directory..."
# \rm -rf $DIR_INST
#fi
mkdir -p $DIR_BUILD
echo "Run cmake..."
( cd $DIR_BUILD && cmake -DCMAKE_INSTALL_PREFIX=$DIR_INST $E1039_ONLMON/src )
local RET=$?
if [ $RET -eq 0 ] ; then
echo "OK. Run 'make-this' at any time/directory."
else
echo "NG. Need a fix."
fi
return $RET
}
function make-this {
local -r ARG=${1:-'install'}
if [ ! -e $DIR_BUILD/Makefile ] ; then
echo "The build directory is not ready. Complete 'cmake-this' first."
return 1
fi
( cd $DIR_BUILD && make $ARG )
return $?
}