mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-26 16:56:19 +00:00
53 lines
1.7 KiB
Bash
Executable file
53 lines
1.7 KiB
Bash
Executable file
#!/bin/bash
|
|
# Script to build Khaganat binary (executed in docker)
|
|
#
|
|
# Copyright (C) 2017 AleaJactaEst
|
|
#
|
|
# This program is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
#
|
|
|
|
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
|