2014-04-11 18:50:12 +02:00
|
|
|
#!/bin/sh
|
|
|
|
ROOT=$(pwd)
|
|
|
|
while [ ! -d $ROOT/.git ]; do
|
|
|
|
ROOT=$(dirname $ROOT)
|
|
|
|
done
|
|
|
|
|
2015-07-11 23:25:09 +02:00
|
|
|
[ -z "$CC" ] && CC=clang
|
|
|
|
[ -z "$BUILD" ] && BUILD=Debug
|
2014-04-12 05:25:21 +02:00
|
|
|
|
2014-04-12 04:40:48 +02:00
|
|
|
[ -z "$JOBS" ] && JOBS=$(nproc)
|
|
|
|
DISTCC=`which distcc`
|
|
|
|
if [ ! -z "$DISTCC" ] ; then
|
|
|
|
JOBS=`distcc -j`
|
|
|
|
if [ -z "$JOBS" ] ; then
|
|
|
|
JOBS=1
|
|
|
|
elif [ $JOBS -gt 1 ] ; then
|
|
|
|
CC="$DISTCC $CC"
|
|
|
|
MAKEOPTS=-j$JOBS
|
|
|
|
fi
|
|
|
|
fi
|
2015-07-11 23:25:09 +02:00
|
|
|
echo "Building with CC=$CC and $JOBS jobs"
|
2014-04-12 04:40:48 +02:00
|
|
|
|
2015-07-11 23:25:09 +02:00
|
|
|
if [ ! -d $ROOT/$BUILD ]; then
|
|
|
|
echo "cannot find build directory $BUILD in $ROOT. did you run cmake-init?"
|
2014-04-11 18:50:12 +02:00
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2015-07-12 01:04:39 +02:00
|
|
|
if [ -z `which tolua` ]; then
|
2015-07-11 20:48:54 +02:00
|
|
|
echo "build tolua"
|
2015-07-11 17:48:35 +02:00
|
|
|
cd $ROOT/tolua ; make
|
2015-07-12 01:04:39 +02:00
|
|
|
fi
|
|
|
|
|
2015-07-11 20:48:54 +02:00
|
|
|
echo "build eressea"
|
2015-07-11 23:25:09 +02:00
|
|
|
cd $ROOT/$BUILD
|
2014-04-12 04:40:48 +02:00
|
|
|
make $MAKEOPTS && make test
|
2014-07-03 06:35:16 +02:00
|
|
|
cd $OLDPWD
|