mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-27 01:06:19 +00:00
41 lines
1.1 KiB
Bash
Executable file
41 lines
1.1 KiB
Bash
Executable file
#!/bin/bash
|
|
# Script to build Khaganat
|
|
# Copyright : GNU/AGPLv3
|
|
#
|
|
# Created : 1 AUG 2017
|
|
# Created by : AleaJactaEst
|
|
|
|
declare DIRBUILD="/opt/code/build/"
|
|
if [[ -n "$1" ]]
|
|
then
|
|
DIRBUILD="$1"
|
|
fi
|
|
declare LOGFILE="${DIRBUILD}/build.log"
|
|
|
|
function chrashed()
|
|
{
|
|
echo "$(date "+%Y/%m/%d %H:%M:%S") BUILD FAILED (code:$?)" >> $LOGFILE
|
|
exit 2
|
|
}
|
|
|
|
trap chrashed EXIT
|
|
|
|
mkdir -p ${DIRBUILD}/ || exit 2
|
|
|
|
if [[ -f ${DIRBUILD}/envi.sh ]]
|
|
then
|
|
echo "$(date "+%Y/%m/%d %H:%M:%S") LOAD ENVI" >> $LOGFILE
|
|
source ${DIRBUILD}/envi.sh
|
|
fi
|
|
|
|
echo "$(date "+%Y/%m/%d %H:%M:%S") BUILD START" >> $LOGFILE
|
|
|
|
cd ${DIRBUILD}; cmake -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_CLIENT=OFF -DWITH_NEL=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_DRIVER_OPENGL=OFF -DWITH_DRIVER_OPENAL=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_SOUND=OFF ${CMAKEOPTS} .. 1>>$LOGFILE 2>&1 || exit 2
|
|
|
|
cd ${DIRBUILD}; make $MAKEOPTS 1>>$LOGFILE 2>&1 || exit 2
|
|
|
|
echo "$(date "+%Y/%m/%d %H:%M:%S") PACKAGE" > $LOGFILE
|
|
cd ${DIRBUILD}; make package 1>>$LOGFILE 2>&1 || exit 2
|
|
|
|
trap '' EXIT
|
|
echo "$(date "+%Y/%m/%d %H:%M:%S") BUILD END" >> $LOGFILE
|