build_game.sh: double check if we're in a git repo before updating a sub-module
This commit is contained in:
parent
60e7bcc520
commit
2256c8501c
4 changed files with 60 additions and 11 deletions
|
@ -8,6 +8,11 @@ mv_wsfile()
|
|||
fi
|
||||
}
|
||||
|
||||
if ! [ -x "$(command -v git)" ]; then
|
||||
printf "'git' is not installed.\n"
|
||||
exit
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
WS_MAKEFILE=./src/worldspawn/Makefile
|
||||
|
@ -190,3 +195,4 @@ mkdir -p ../../bin/platform.game/platform
|
|||
mv_wsfile platform.game/platform/entities.def
|
||||
mv_wsfile worldspawn
|
||||
mv_wsfile vmap
|
||||
printf "Built the editor successfully.\nInsert './worldspawn' to run.\n"
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
#!/bin/sh
|
||||
. ./build.cfg
|
||||
|
||||
if ! [ -x "$(command -v svn)" ]; then
|
||||
printf "'svn' is not installed.\n"
|
||||
exit
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
FTE_MAKEFILE=./src/engine/engine/Makefile
|
||||
|
@ -76,37 +82,49 @@ fi
|
|||
|
||||
if [ "$BUILD_CLEAN" -eq 1 ]; then
|
||||
gmake clean
|
||||
printf "Cleaned the build directory.\n\n"
|
||||
fi
|
||||
|
||||
if [ "$BUILD_ENGINE_DEPENDENCIES" -eq 1 ]; then
|
||||
gmake -j $BUILD_PROC makelibs FTE_TARGET=$PLATFORM
|
||||
printf "Built the static dependencies successfully.\n\n"
|
||||
fi
|
||||
|
||||
gmake -j $BUILD_PROC $MAKETARGET FTE_TARGET=$PLATFORM
|
||||
cp -v "$OUTPUT" ../../../bin/fteqw
|
||||
printf "Built the client engine successfully.\n\n"
|
||||
|
||||
gmake -j $BUILD_PROC sv-dbg
|
||||
cp -v ./debug/fteqw-sv ../../../bin/fteqw-sv
|
||||
printf "Built the dedicated server successfully.\n\n"
|
||||
|
||||
gmake -j $BUILD_PROC qcc-rel
|
||||
cp -v ./release/fteqcc ../../../bin/fteqcc
|
||||
printf "Built the QuakeC compiler successfully.\n\n"
|
||||
|
||||
|
||||
if [ "$BUILD_IQMTOOL" -eq 1 ]; then
|
||||
gmake -j $BUILD_PROC iqm-rel
|
||||
cp -v ./release/iqmtool ../../../bin/iqmtool
|
||||
printf "Built the iqmtool successfully.\n\n"
|
||||
fi
|
||||
|
||||
if [ "$BUILD_IMGTOOL" -eq 1 ]; then
|
||||
gmake -j $BUILD_PROC imgtool-rel
|
||||
cp -v ./release/imgtool ../../../bin/imgtool
|
||||
printf "Built the imgtool successfully.\n\n"
|
||||
fi
|
||||
|
||||
if [ "$BUILD_BULLET" -eq 1 ]; then
|
||||
gmake -j $BUILD_PROC plugins-rel NATIVE_PLUGINS="bullet"
|
||||
find ./release/ -name 'fteplug_bullet_*.so' -exec cp -prv '{}' '../../../bin/' ';'
|
||||
printf "Built the bullet plugin successfully.\n\n"
|
||||
fi
|
||||
|
||||
if [ "$BUILD_FFMPEG" -eq 1 ]; then
|
||||
gmake -j $BUILD_PROC plugins-rel NATIVE_PLUGINS="ffmpeg"
|
||||
find ./release/ -name 'fteplug_ffmpeg_*.so' -exec cp -prv '{}' '../../../bin/' ';'
|
||||
printf "Built the ffmpeg plugin successfully.\n\n"
|
||||
fi
|
||||
|
||||
printf "DONE. Built ALL components successfully.\n"
|
||||
|
|
|
@ -1,5 +1,14 @@
|
|||
#!/bin/sh
|
||||
. ./build.cfg
|
||||
|
||||
# if we're attempting to update the projects, check for git
|
||||
if [ "$BUILD_UPDATE" -eq 1 ]; then
|
||||
if ! [ -x "$(command -v git)" ]; then
|
||||
printf "'git' is not installed.\n"
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
set -e
|
||||
SCRPATH="$( cd "$( dirname $(readlink -nf $0) )" && pwd )"
|
||||
PATH="$SCRPATH"/bin:"$PATH"
|
||||
|
@ -32,8 +41,16 @@ if [ -f "$SCRPATH"/bin/fteqcc ]; then
|
|||
fi
|
||||
|
||||
find "$SCRPATH" -name Makefile | grep 'src\/Makefile' | grep -v engine | grep -v worldspawn | while read MFILE_N; do
|
||||
cd $(dirname $MFILE_N)
|
||||
git pull
|
||||
NEWDIR=$(dirname "$MFILE_N")
|
||||
cd "$NEWDIR"
|
||||
if [ -f "$NEWDIR/../.git/config" ]; then
|
||||
printf "Updating git repo inside $NEWDIR\n"
|
||||
if [ "$BUILD_UPDATE" -eq 1 ]; then
|
||||
set +e
|
||||
git pull
|
||||
set -e
|
||||
fi
|
||||
fi
|
||||
make
|
||||
cd ..
|
||||
export GAMEDIR=$(basename $PWD)
|
||||
|
|
26
make_dist.sh
26
make_dist.sh
|
@ -1,5 +1,14 @@
|
|||
#!/bin/sh
|
||||
|
||||
if ! [ -x "$(command -v zip)" ]; then
|
||||
printf "'zip' is not installed.\n"
|
||||
exit
|
||||
fi
|
||||
if ! [ -x "$(command -v tree)" ]; then
|
||||
printf "'tree' is not installed.\n"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ $# -lt 0 ]; then
|
||||
printf "At least supply the name of the mod/game dir you want to pack.\n"
|
||||
exit
|
||||
|
@ -38,6 +47,7 @@ find ./$GAME_DIR -name *.pk3dir | xargs -I @ sh -c 'echo `basename "@"`' | while
|
|||
cd "$OLD_DIR"
|
||||
mv "./$GAME_DIR/$PK3DIR/$PK3NAME.pk3" "./$BUILD_DIR/$GAME_DIR/$PK3NAME.pk3"
|
||||
done;
|
||||
|
||||
cp "./$GAME_DIR/progs.dat" "./$BUILD_DIR/$GAME_DIR/progs.dat"
|
||||
cp "./$GAME_DIR/csprogs.dat" "./$BUILD_DIR/$GAME_DIR/csprogs.dat"
|
||||
cp "./$GAME_DIR/menu.dat" "./$BUILD_DIR/$GAME_DIR/menu.dat"
|
||||
|
@ -66,14 +76,6 @@ else
|
|||
cp "./platform/menu.dat" "./$BUILD_DIR/platform/menu.dat"
|
||||
rm "./$BUILD_DIR/platform/test_maps.pk3"
|
||||
|
||||
# copy platform
|
||||
#cp -R ./platform ./$BUILD_DIR/platform
|
||||
#cp -R ./doc ./$BUILD_DIR/doc
|
||||
echo "version 2" > ./$BUILD_DIR/installed.lst
|
||||
echo "set updatemode \"1\"" >> ./$BUILD_DIR/installed.lst
|
||||
echo "set declined \"\"" >> ./$BUILD_DIR/installed.lst
|
||||
echo "sublist \"http://www.frag-net.com/dl/valve_packages\" \"\" \"enabled\"" >> ./$BUILD_DIR/installed.lst
|
||||
|
||||
# spray logos
|
||||
mkdir -p ./$BUILD_DIR/logos
|
||||
cp ./logos/README ./$BUILD_DIR/logos/README
|
||||
|
@ -84,7 +86,13 @@ else
|
|||
fi
|
||||
|
||||
tree ./$BUILD_DIR
|
||||
printf "ENTER to continue\n"
|
||||
printf "DONE, press ENTER to create .zip with gpg signature (or CTRL+C to cancel)\n"
|
||||
read cont
|
||||
zip -9 -r "$BUILD_DIR".zip "./$BUILD_DIR"
|
||||
|
||||
if ! [ -x "$(command -v gpg)" ]; then
|
||||
printf "'gpg' is not installed.\n"
|
||||
exit
|
||||
fi
|
||||
|
||||
gpg --output "./$BUILD_DIR.sig" --detach-sig "./$BUILD_DIR.zip"
|
||||
|
|
Loading…
Reference in a new issue