]> git.xonotic.org Git - xonotic/xonotic.git/commitdiff
Build an optimized release binary when using `./all compile` by default 60/head
authorHugo Locurcio <hugo.locurcio@hugo.pro>
Fri, 20 Sep 2019 18:14:19 +0000 (20:14 +0200)
committerHugo Locurcio <hugo.locurcio@hugo.pro>
Fri, 27 Sep 2019 11:34:48 +0000 (13:34 +0200)
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.

Makefile
misc/infrastructure/xonotic-map-screenshot.cron
misc/tools/all/xonotic.subr
misc/tools/all/zsh_autocompletion/all/_all
misc/tools/the-big-benchmark/the-big-benchmark.sh

index 2c77a91754b6306b5345d31beb4ba23b9a42255e..85fbe91883680894b6d8c2e0e81e51d2287a92e1 100644 (file)
--- 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:
index 688e266236351e9cc927d8488382b43770f0fb8a..0c063752fad8ccc3c33085f9be10660b6cd218ee 100755 (executable)
@@ -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"
index b9ddd8a316b8793a68100919087d700153592b90..1d5d75cb57015ec2998cabfd73338383f4390945 100644 (file)
@@ -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\")"
index 7cd8ec2e924aaf0bda353af3ed0a12639aeceeee..f4a8e6dbbb18e7c450f5830699f44d156c94baf4 100644 (file)
@@ -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)
index 07b3140e4797ec0acb332355ae13b18184422008..580e4dbb531f978974e2c89e7b417c42f8c11e89 100755 (executable)
@@ -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