]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/tools/all/xonotic.subr
./all compile-map: if no arguments are given, print usage info, otherwise take each...
[xonotic/xonotic.git] / misc / tools / all / xonotic.subr
index e18d7fe2f9d0c84efac34c9a7b95c6cd30ddc73b..93c198406ce751afc1cb8cf0d982b20990ad8571 100644 (file)
@@ -3,6 +3,26 @@ case "$cmd" in
        update-maps)
                misc/tools/xonotic-map-compiler-autobuild download
                ;;
+       compile-map)
+               if [ -n "$1" ] ; then
+                       msg "Usage: ./all compile-map mapname1 mapname2 mapname3"
+                       msg "For example: ./all compile-map dance xoylent"
+               fi
+               if [ ! -f "netradiant/install/q3map2.x86" ] ; then
+                       msg "q3map2 needed! Building netradiant..."
+                       cd netradiant
+                       make
+                       cd ../
+               fi
+               for mapfile in $@ ; do
+                               mapfile="data/xonotic-maps.pk3dir/maps/$1.map"
+                       if [ ! -f "$mapfile" ] ; then
+                               msg "ERROR, $mapfile not found!"
+                       else
+                               time misc/tools/xonotic-map-compiler_from_all $mapfile
+                       fi
+               done
+               ;;
        compile)
                cleand0=false
                cleandp=false
@@ -86,19 +106,19 @@ case "$cmd" in
                        for X in $1; do
                                case "$X" in
                                        sdl)
-                                               TARGETS="$TARGETS sdl-debug"
+                                               TARGETS="$TARGETS sdl-$debug"
                                                ;;
                                        agl)
-                                               TARGETS="$TARGETS cl-debug"
+                                               TARGETS="$TARGETS cl-$debug"
                                                if $snowleopardhack; then
                                                        export CC="$CC -arch i386"
                                                fi
                                                ;;
                                        glx|wgl)
-                                               TARGETS="$TARGETS cl-debug"
+                                               TARGETS="$TARGETS cl-$debug"
                                                ;;
                                        dedicated)
-                                               TARGETS="$TARGETS sv-debug"
+                                               TARGETS="$TARGETS sv-$debug"
                                                ;;
                                        *)
                                                BAD_TARGETS="$BAD_TARGETS $X"
@@ -122,6 +142,14 @@ case "$cmd" in
                        fi
                fi
 
+               # workaround ARM issue in DP's makefile.inc
+               case `uname -m` in
+                       x86_64|*86)
+                               ;;
+                       *)
+                               MAKEFLAGS="$MAKEFLAGS CFLAGS_SSE= CFLAGS_SSE2="
+                               ;;
+               esac
                
                if ! verbose $CC misc/tools/conftest.c -o conftest; then
                        msg ""
@@ -202,17 +230,21 @@ case "$cmd" in
                        verbose make $MAKEFLAGS
                fi
 
-               verbose cd "$d0/fteqcc"
+               verbose cd "$d0/gmqcc"
                if $cleanqcc; then
                        verbose make $MAKEFLAGS clean
                fi
-               verbose make $MAKEFLAGS
+               if [ -n "$WE_HATE_OUR_USERS" ]; then
+                       verbose make $MAKEFLAGS gmqcc.exe
+               else
+                       verbose make $MAKEFLAGS gmqcc
+               fi
 
                verbose cd "$d0/data/xonotic-data.pk3dir"
                if $cleanqc; then
-                       verbose make FTEQCC="../../../../fteqcc/fteqcc.bin" "$@" $MAKEFLAGS clean
+                       verbose make QCC="../../../../gmqcc/gmqcc" "$@" $MAKEFLAGS clean
                fi
-               verbose make FTEQCC="../../../../fteqcc/fteqcc.bin" "$@" $MAKEFLAGS
+               verbose make QCC="../../../../gmqcc/gmqcc" "$@" $MAKEFLAGS
                # 4 levels up: data, xonotic-data, qcsrc, server
 
                verbose cd "$d0/darkplaces"
@@ -244,11 +276,17 @@ case "$cmd" in
                        client=-sdl
                fi
                case "$1" in
-                       sdl|glx|agl|dedicated)
+                       dedicated)
+                               client=-$1
+                               shift
+                               ;;
+                       sdl|glx|agl)
+                               USE_RLWRAP=no
                                client=-$1
                                shift
                                ;;
                        wgl)
+                               USE_RLWRAP=no
                                client=
                                shift
                                ;;
@@ -276,11 +314,16 @@ case "$cmd" in
 
                if [ x"$USE_GDB" = x"yes" ]; then
                        set -- gdb --args "$@"
-               elif [ x"$USE_GDB" = x"core" ] && which gdb >/dev/null 2>&1; then
+                       USE_RLWRAP=no
+               elif [ x"$USE_GDB" = x"core" ]; then
                        set -- gdb --batch -x savecore.gdb --args "$@"
+                       USE_RLWRAP=no
                elif which catchsegv >/dev/null 2>&1; then
                        set -- catchsegv "$@"
                fi
+               if [ x"$USE_RLWRAP" != x"no" ] && which rlwrap >/dev/null 2>&1; then
+                       set -- rlwrap -A -g '^quit' -q "\"" -r -S ']' -w 100 "$@"
+               fi
                rm -f xonotic.core
                "$@" || true
                if [ -f xonotic.core ]; then