diff --git a/build.cfg b/build.cfg index 85b9ddc7..2f7f18ed 100644 --- a/build.cfg +++ b/build.cfg @@ -32,7 +32,7 @@ BUILD_IQMTOOL=1 BUILD_IMGTOOL=1 # Specify which engine revision to build, these are considered 'stable'; 0 = latest -BUILD_ENGINEREVISION=6224 +BUILD_ENGINEREVISION=6235 # Whether or not to run 'git pull' or 'svn up' before building a component BUILD_UPDATE=1 diff --git a/build_editor.sh b/build_editor.sh index 28394282..f7eef802 100755 --- a/build_editor.sh +++ b/build_editor.sh @@ -3,12 +3,14 @@ mv_wsfile() { - if [ -f "./build/$1" ]; then + if [ -f "./build/$1" ] +then cp -v "./build/$1" "../../bin/$1" fi } -if ! [ -x "$(command -v git)" ]; then +if ! [ -x "$(command -v git)" ] +then printf "'git' is not installed.\n" exit fi @@ -19,9 +21,11 @@ WS_MAKEFILE=./src/worldspawn/Makefile COMPILE_SYS=$(uname) # Check how many cores/processors we should use for building -if ! [ -x "$(command -v nproc)" ]; then +if ! [ -x "$(command -v nproc)" ] +then # check if we're on OpenBSD then - if ! [ -x "$(command -v sysctl)" ]; then + if ! [ -x "$(command -v sysctl)" ] +then BUILD_PROC=1 else BUILD_PROC=$(sysctl -n hw.ncpu) @@ -30,12 +34,14 @@ else BUILD_PROC=$(nproc) fi -if [ "$BUILD_DEBUG" -eq 1 ]; then +if [ "$BUILD_DEBUG" -eq 1 ] +then WS_CFLAGS="-g" fi # handle search directories and platform specific libraries -if [[ "$COMPILE_SYS" == "OpenBSD" ]]; then +if [ "$COMPILE_SYS" = "OpenBSD" ] +then WS_CFLAGS="$WS_CFLAGS -I/usr/local/include -I/usr/local/include/gtkglext-1.0 -I/usr/local/lib/gtkglext-1.0/include -I/usr/local/include/libxml2/" WS_LDFLAGS="$WS_LDFLAGS -L/usr/local/lib" WS_CC=cc @@ -49,8 +55,10 @@ fi mkdir -p ./bin -if [ -f "$WS_MAKEFILE" ]; then - if [ "$BUILD_UPDATE" -eq 1 ]; then +if [ -f "$WS_MAKEFILE" ] +then + if [ "$BUILD_UPDATE" -eq 1 ] + then printf "WorldSpawn is present, updating...\n" cd ./src/worldspawn/ git pull @@ -64,7 +72,8 @@ else cd ./worldspawn fi -if [ "$BUILD_CLEAN" -eq 1 ]; then +if [ "$BUILD_CLEAN" -eq 1 ] +then gmake clean fi diff --git a/build_engine.sh b/build_engine.sh index dbdfeb23..fd1251e4 100755 --- a/build_engine.sh +++ b/build_engine.sh @@ -1,7 +1,8 @@ #!/bin/sh . ./build.cfg -if ! [ -x "$(command -v svn)" ]; then +if ! [ -x "$(command -v svn)" ] +then printf "'svn' is not installed.\n" exit fi @@ -12,9 +13,11 @@ FTE_MAKEFILE=./src/engine/engine/Makefile COMPILE_SYS=$(uname) # Check how many cores/processors we should use for building -if ! [ -x "$(command -v nproc)" ]; then +if ! [ -x "$(command -v nproc)" ] +then # check if we're on OpenBSD then - if ! [ -x "$(command -v sysctl)" ]; then + if ! [ -x "$(command -v sysctl)" ] + then BUILD_PROC=1 else BUILD_PROC=$(sysctl -n hw.ncpu) @@ -23,7 +26,8 @@ else BUILD_PROC=$(nproc) fi -if [ "$BUILD_DEBUG" -eq 1 ]; then +if [ "$BUILD_DEBUG" -eq 1 ] + then MAKETARGET=gl-dbg OUTPUT=./debug else @@ -31,29 +35,29 @@ else OUTPUT=./release fi -if [ "$BUILD_SDL2" -eq 1 ]; then +if [ "$BUILD_SDL2" -eq 1 ] + then PLATFORM=SDL2 OUTPUT=$OUTPUT/fteqw-glsdl2 else - if [[ "$COMPILE_SYS" == "CYGWIN_NT-10.0" ]] || [[ "$COMPILE_SYS" == "CYGWIN_NT-6.1-WOW64" ]]; then - PLATFORM=win64 - OUTPUT=$OUTPUT/fteglqw64.exe - elif [[ "$COMPILE_SYS" == "CYGWIN_NT-6.1" ]] || [[ "$COMPILE_SYS" == "CYGWIN_NT-5.1" ]]; then - PLATFORM=win32 - OUTPUT=$OUTPUT/fteglqw32.exe - elif [[ "$COMPILE_SYS" == "OpenBSD" ]]; then + if [ "$COMPILE_SYS" = "OpenBSD" ] + then PLATFORM=bsd OUTPUT=$OUTPUT/fteqw-gl - elif [[ "$COMPILE_SYS" == "FreeBSD" ]]; then + elif [ "$COMPILE_SYS" = "FreeBSD" ] + then PLATFORM=bsd OUTPUT=$OUTPUT/fteqw-gl - elif [[ "$COMPILE_SYS" == "NetBSD" ]]; then + elif [ "$COMPILE_SYS" = "NetBSD" ] + then PLATFORM=bsd OUTPUT=$OUTPUT/fteqw-gl - elif [[ "$COMPILE_SYS" == "Linux" ]]; then + elif [ "$COMPILE_SYS" = "Linux" ] + then PLATFORM=linux64 OUTPUT=$OUTPUT/fteqw-gl64 - elif [[ "$COMPILE_SYS" == "GNU/Linux" ]]; then + elif [ "$COMPILE_SYS" = "GNU/Linux" ] + then PLATFORM=linux64 OUTPUT=$OUTPUT/fteqw-gl64 else @@ -64,12 +68,15 @@ fi mkdir -p ./bin -if [ -f "$FTE_MAKEFILE" ]; then - if [ "$BUILD_UPDATE" -eq 1 ]; then +if [ -f "$FTE_MAKEFILE" ] +then + if [ "$BUILD_UPDATE" -eq 1 ] + then printf "Engine is present, updating...\n" cd ./src/engine/ - if [ "$BUILD_ENGINEREVISION" == 0 ]; then + if [ "$BUILD_ENGINEREVISION" -eq 0 ] + then svn up else svn -r $BUILD_ENGINEREVISION up @@ -83,7 +90,8 @@ else printf "Engine is NOT present, cloning...\n" cd ./src/ - if [ "$BUILD_ENGINEREVISION" == 0 ]; then + if [ "$BUILD_ENGINEREVISION" -eq 0 ] + then svn checkout https://svn.code.sf.net/p/fteqw/code/trunk engine else svn -r $BUILD_ENGINEREVISION checkout https://svn.code.sf.net/p/fteqw/code/trunk engine @@ -91,12 +99,14 @@ else cd ./engine/engine fi -if [ "$BUILD_CLEAN" -eq 1 ]; then +if [ "$BUILD_CLEAN" -eq 1 ] +then gmake clean printf "Cleaned the build directory.\n\n" fi -if [ "$BUILD_ENGINE_DEPENDENCIES" -eq 1 ]; then +if [ "$BUILD_ENGINE_DEPENDENCIES" -eq 1 ] +then gmake -j $BUILD_PROC makelibs FTE_TARGET=$PLATFORM printf "Built the static dependencies successfully.\n\n" fi @@ -113,31 +123,36 @@ gmake -j $BUILD_PROC qcc-rel cp -v ./release/fteqcc ../../../bin/fteqcc printf "Built the QuakeC compiler successfully.\n\n" -if [ "$BUILD_IMGTOOL" -eq 1 ]; then +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_SOURCE" -eq 1 ]; then +if [ "$BUILD_SOURCE" -eq 1 ] +then gmake -j $BUILD_PROC plugins-rel CFLAGS=-DGLQUAKE NATIVE_PLUGINS="hl2" find ./release/ -name 'fteplug_hl2_*.so' -exec cp -prv '{}' '../../../bin/' ';' printf "Built the Source Engine plugin successfully.\n\n" fi -if [ "$BUILD_BULLET" -eq 1 ]; then +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_ODE" -eq 1 ]; then +if [ "$BUILD_ODE" -eq 1 ] +then gmake -j $BUILD_PROC plugins-rel NATIVE_PLUGINS="ode" find ./release/ -name 'fteplug_ode_*.so' -exec cp -prv '{}' '../../../bin/' ';' printf "Built the ode plugin successfully.\n\n" fi -if [ "$BUILD_FFMPEG" -eq 1 ]; then +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" diff --git a/build_game.sh b/build_game.sh index 6744e5bc..9bf3f7b5 100755 --- a/build_game.sh +++ b/build_game.sh @@ -15,10 +15,9 @@ fi set -e SCRPATH="$( cd "$( dirname $(readlink -nf $0) )" && pwd )" -PATH="$SCRPATH"/bin:"$PATH" +PATH="$SCRPATH/bin:$PATH" if [ -x "$(command -v fteqcc)" ]; then - # We want to compile a specific game if [ $# -gt 0 ]; then if [ "$BUILD_UPDATE" -eq 1 ]; then diff --git a/build_tools.sh b/build_tools.sh index a97e0475..eb98c2f6 100755 --- a/build_tools.sh +++ b/build_tools.sh @@ -1,7 +1,8 @@ #!/bin/sh . ./build.cfg -if ! [ -x "$(command -v git)" ]; then +if ! [ -x "$(command -v git)" ] +then printf "'git' is not installed.\n" exit fi @@ -12,9 +13,11 @@ VVM_MAKEFILE=./src/vvmtool/Makefile COMPILE_SYS=$(uname) # Check how many cores/processors we should use for building -if ! [ -x "$(command -v nproc)" ]; then +if ! [ -x "$(command -v nproc)" ] +then # check if we're on OpenBSD then - if ! [ -x "$(command -v sysctl)" ]; then + if ! [ -x "$(command -v sysctl)" ] + then BUILD_PROC=1 else BUILD_PROC=$(sysctl -n hw.ncpu) @@ -25,8 +28,10 @@ fi mkdir -p ./bin -if [ -f "$VVM_MAKEFILE" ]; then - if [ "$BUILD_UPDATE" -eq 1 ]; then +if [ -f "$VVM_MAKEFILE" ] +then + if [ "$BUILD_UPDATE" -eq 1 ] + then printf "vvmtool is present, updating...\n" cd ./src/vvmtool git pull @@ -40,7 +45,8 @@ else cd ./vvmtool fi -if [ "$BUILD_CLEAN" -eq 1 ]; then +if [ "$BUILD_CLEAN" -eq 1 ] +then gmake clean fi