server/s/build

39 lines
700 B
Plaintext
Raw Normal View History

2014-04-11 18:50:12 +02:00
#!/bin/sh
ROOT=`pwd`
2014-04-11 18:50:12 +02:00
while [ ! -d $ROOT/.git ]; do
ROOT=`dirname $ROOT`
2014-04-11 18:50:12 +02:00
done
2015-07-11 23:25:09 +02:00
[ -z "$CC" ] && CC=clang
[ -z "$BUILD" ] && BUILD=Debug
[ -z "$JOBS" ] && [ "" != "which nproc" ] && 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"
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 03:08:29 +02:00
git submodule update
2015-07-12 01:04:39 +02:00
if [ -z `which tolua` ]; then
echo "build tolua"
cd $ROOT/tolua ; make
2015-07-12 01:04:39 +02:00
fi
echo "build eressea"
2015-07-11 23:25:09 +02:00
cd $ROOT/$BUILD
make $MAKEOPTS && make test
cd $OLDPWD