mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-13 02:39:34 +00:00
62 lines
1.9 KiB
Bash
Executable file
62 lines
1.9 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=ON \
|
|
-DWITH_STATIC=ON \
|
|
-DWITH_STATIC_DRIVERS=ON \
|
|
-DWITH_STATIC_EXTERNAL=ON \
|
|
-DWITH_SYMBOLS=ON \
|
|
-DWITH_LUA52=ON \
|
|
-DWITH_RYZOM_PATCH=ON \
|
|
-DWITH_RYZOM_CUSTOM_PATCH_SERVER=ON \
|
|
${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
|