From: Hugo Locurcio Date: Fri, 20 Sep 2019 18:14:19 +0000 (+0200) Subject: Build an optimized release binary when using `./all compile` by default X-Git-Tag: xonotic-v0.8.5~119^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fmerge-requests%2F60%2Fhead;p=xonotic%2Fxonotic.git Build an optimized release binary when using `./all compile` by default This prevents players who download the source code to build and play from using an unoptimized debug build by forgetting to pass the `-r` switch. Compiling a debug build is now done by passing `-d`. The `-r` flag is still supported for compatibility with existing scripts. --- diff --git a/Makefile b/Makefile index 2c77a917..85fbe918 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -DESTDIR ?= +DESTDIR ?= PREFIX ?= /usr/local BINDIR ?= $(PREFIX)/bin LIBDIR ?= $(PREFIX)/lib/xonotic @@ -19,7 +19,7 @@ all: all-$(SUFFIX) .PHONY: all-git all-git: - ./all compile -r + ./all compile .PHONY: all-zip-binary all-zip-binary: diff --git a/misc/infrastructure/xonotic-map-screenshot.cron b/misc/infrastructure/xonotic-map-screenshot.cron index 688e2662..0c063752 100755 --- a/misc/infrastructure/xonotic-map-screenshot.cron +++ b/misc/infrastructure/xonotic-map-screenshot.cron @@ -8,7 +8,7 @@ set -e cd xonotic ./all clean -m -fU -D # like reclone but do not delete untracked, so q3map2.x86 compile stays -./all compile -r +./all compile export DRIVER=soft #export DRIVERFLAGS="+gl_texturecompression 1 -nofbo" #export DRIVERFLAGS="+gl_texturecompression 1" diff --git a/misc/tools/all/xonotic.subr b/misc/tools/all/xonotic.subr index b9ddd8a3..1d5d75cb 100644 --- a/misc/tools/all/xonotic.subr +++ b/misc/tools/all/xonotic.subr @@ -27,7 +27,7 @@ case "$cmd" in cleanqcc=false cleanqc=false compiled0= - debug=debug + debug=release if [ -z "$CC" ]; then export CC="gcc" fi @@ -53,8 +53,11 @@ case "$cmd" in cleanqc=true shift ;; - -r|-p) + -d|-p|-r) case "$1" in + -d) + debug=debug + ;; -p) debug=profile ;; @@ -384,7 +387,7 @@ case "$cmd" in fi ;; help) - $ECHO " $SELF compile [-c] [-qc] [-r|-p] [-0] [-1] [sdl|glx|dedicated]" + $ECHO " $SELF compile [-c] [-qc] [-d|-p|-r] [-0] [-1] [sdl|glx|dedicated]" $ECHO " $SELF update-maps" $ECHO " $SELF run [sdl|glx|dedicated] options..." $ECHO " $SELF compile-map mapname1 mapname2... (e.g. \"./all compile-map dance drain fuse\")" diff --git a/misc/tools/all/zsh_autocompletion/all/_all b/misc/tools/all/zsh_autocompletion/all/_all index 7cd8ec2e..f4a8e6db 100644 --- a/misc/tools/all/zsh_autocompletion/all/_all +++ b/misc/tools/all/zsh_autocompletion/all/_all @@ -54,10 +54,12 @@ case $state in "-1[don't compile d0_blind_id]" \ '-c[clean all before building]' \ '-qc[clean QuakeC binaries]' \ - - '(release)' \ - '-r[build in release mode]' \ + - '(debug)' \ + '-d[build in debug mode]' \ - '(profile)' \ - '-p[build in profile mode]' && ret=0 + '-p[build in profile mode]' \ + - '(release)' \ + '-r[build in release mode (default)]' && ret=0 ;; compile-map) diff --git a/misc/tools/the-big-benchmark/the-big-benchmark.sh b/misc/tools/the-big-benchmark/the-big-benchmark.sh index 07b3140e..580e4dbb 100755 --- a/misc/tools/the-big-benchmark/the-big-benchmark.sh +++ b/misc/tools/the-big-benchmark/the-big-benchmark.sh @@ -36,7 +36,7 @@ fi if [ -f ./all ]; then ./all clean -fU -m -r - ./all compile -r + ./all compile export USE_GDB=no set -- ./all run "$@" elif [ -z "$*" ]; then