2013-02-18 02:29:15 +01:00
|
|
|
#!/bin/sh
|
2014-02-17 19:50:57 +01:00
|
|
|
git submodule update --init
|
2013-02-18 02:29:15 +01:00
|
|
|
MACHINE=`uname -m`
|
|
|
|
BIN_DIR="build-$MACHINE-Debug"
|
|
|
|
[ -z "$CC" ] && [ ! -z `which gcc` ] && CC="gcc"
|
|
|
|
[ -z "$CC" ] && [ ! -z `which tcc` ] && CC="tcc"
|
|
|
|
[ -z "$CC" ] && [ ! -z `which cc` ] && CC="cc"
|
2014-02-17 19:50:57 +01:00
|
|
|
[ -z "$JOBS" ] && JOBS=$(nproc)
|
2013-02-18 02:29:15 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
echo "Building with $CC and $JOBS jobs"
|
|
|
|
|
|
|
|
mkdir -p $BIN_DIR
|
|
|
|
cd $BIN_DIR
|
|
|
|
CC="$CC" cmake .. -DCMAKE_MODULE_PATH=$PWD/../cmake/Modules -DCMAKE_BUILD_TYPE=Debug
|
|
|
|
make -j$JOBS
|
|
|
|
make test
|
2013-02-18 02:41:04 +01:00
|
|
|
cd ..
|
|
|
|
for GAME in game* ; do
|
|
|
|
cd $GAME
|
|
|
|
ln -sf ../$BIN_DIR/server/server
|
|
|
|
./server -e run_tests
|
|
|
|
cd ..
|
|
|
|
done
|