Ditch 'historical compatibility' and use 'logic' instead
This commit is contained in:
parent
bba199e795
commit
8d70929d12
4 changed files with 38 additions and 63 deletions
40
Makefile
40
Makefile
|
@ -6,15 +6,15 @@
|
||||||
|
|
||||||
COMPILE_PLATFORM=$(shell uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]'|sed -e 's/\//_/g')
|
COMPILE_PLATFORM=$(shell uname|sed -e s/_.*//|tr '[:upper:]' '[:lower:]'|sed -e 's/\//_/g')
|
||||||
|
|
||||||
COMPILE_ARCH=$(shell uname -m | sed -e s/i.86/i386/)
|
COMPILE_ARCH=$(shell uname -m | sed -e s/i.86/x86/)
|
||||||
|
|
||||||
ifeq ($(COMPILE_PLATFORM),sunos)
|
ifeq ($(COMPILE_PLATFORM),sunos)
|
||||||
# Solaris uname and GNU uname differ
|
# Solaris uname and GNU uname differ
|
||||||
COMPILE_ARCH=$(shell uname -p | sed -e s/i.86/i386/)
|
COMPILE_ARCH=$(shell uname -p | sed -e s/i.86/x86/)
|
||||||
endif
|
endif
|
||||||
ifeq ($(COMPILE_PLATFORM),darwin)
|
ifeq ($(COMPILE_PLATFORM),darwin)
|
||||||
# Apple does some things a little differently...
|
# Apple does some things a little differently...
|
||||||
COMPILE_ARCH=$(shell uname -p | sed -e s/i.86/i386/)
|
COMPILE_ARCH=$(shell uname -p | sed -e s/i.86/x86/)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef BUILD_STANDALONE
|
ifndef BUILD_STANDALONE
|
||||||
|
@ -57,9 +57,6 @@ PLATFORM=$(COMPILE_PLATFORM)
|
||||||
endif
|
endif
|
||||||
export PLATFORM
|
export PLATFORM
|
||||||
|
|
||||||
ifeq ($(COMPILE_ARCH),i386)
|
|
||||||
COMPILE_ARCH=x86
|
|
||||||
endif
|
|
||||||
ifeq ($(COMPILE_ARCH),i86pc)
|
ifeq ($(COMPILE_ARCH),i86pc)
|
||||||
COMPILE_ARCH=x86
|
COMPILE_ARCH=x86
|
||||||
endif
|
endif
|
||||||
|
@ -87,19 +84,6 @@ ARCH=$(COMPILE_ARCH)
|
||||||
endif
|
endif
|
||||||
export ARCH
|
export ARCH
|
||||||
|
|
||||||
# For historical compatibility reasons on non-windows
|
|
||||||
# platforms output files use i386 instead of x86
|
|
||||||
ifeq ($(ARCH),x86)
|
|
||||||
ifneq ($(PLATFORM),mingw32)
|
|
||||||
FILE_ARCH=i386
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef FILE_ARCH
|
|
||||||
FILE_ARCH=$(ARCH)
|
|
||||||
endif
|
|
||||||
export FILE_ARCH
|
|
||||||
|
|
||||||
ifneq ($(PLATFORM),$(COMPILE_PLATFORM))
|
ifneq ($(PLATFORM),$(COMPILE_PLATFORM))
|
||||||
CROSS_COMPILING=1
|
CROSS_COMPILING=1
|
||||||
else
|
else
|
||||||
|
@ -524,7 +508,6 @@ ifeq ($(PLATFORM),mingw32)
|
||||||
-fstrength-reduce
|
-fstrength-reduce
|
||||||
OPTIMIZE = $(OPTIMIZEVM) --fast-math
|
OPTIMIZE = $(OPTIMIZEVM) --fast-math
|
||||||
HAVE_VM_COMPILED = true
|
HAVE_VM_COMPILED = true
|
||||||
FILE_ARCH=x64
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(ARCH),x86)
|
ifeq ($(ARCH),x86)
|
||||||
OPTIMIZEVM = -O3 -march=i586 -fno-omit-frame-pointer \
|
OPTIMIZEVM = -O3 -march=i586 -fno-omit-frame-pointer \
|
||||||
|
@ -653,10 +636,6 @@ ifeq ($(PLATFORM),freebsd)
|
||||||
BASE_CFLAGS += -m64
|
BASE_CFLAGS += -m64
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH),x86_64)
|
|
||||||
FILE_ARCH=amd64
|
|
||||||
endif
|
|
||||||
else # ifeq freebsd
|
else # ifeq freebsd
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
@ -702,10 +681,6 @@ ifeq ($(PLATFORM),openbsd)
|
||||||
CLIENT_LIBS += -lcurl
|
CLIENT_LIBS += -lcurl
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(ARCH),x86_64)
|
|
||||||
FILE_ARCH=amd64
|
|
||||||
endif
|
|
||||||
else # ifeq openbsd
|
else # ifeq openbsd
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
@ -727,10 +702,6 @@ ifeq ($(PLATFORM),netbsd)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
BUILD_CLIENT = 0
|
BUILD_CLIENT = 0
|
||||||
|
|
||||||
ifeq ($(ARCH),x86_64)
|
|
||||||
FILE_ARCH=amd64
|
|
||||||
endif
|
|
||||||
else # ifeq netbsd
|
else # ifeq netbsd
|
||||||
|
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
@ -850,11 +821,11 @@ ifeq ($(USE_FREETYPE),1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef FULLBINEXT
|
ifndef FULLBINEXT
|
||||||
FULLBINEXT=.$(FILE_ARCH)$(BINEXT)
|
FULLBINEXT=.$(ARCH)$(BINEXT)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef SHLIBNAME
|
ifndef SHLIBNAME
|
||||||
SHLIBNAME=$(FILE_ARCH).$(SHLIBEXT)
|
SHLIBNAME=$(ARCH).$(SHLIBEXT)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(BUILD_SERVER),0)
|
ifneq ($(BUILD_SERVER),0)
|
||||||
|
@ -1142,7 +1113,6 @@ targets: makedirs
|
||||||
@echo "Building $(CLIENTBIN) in $(B):"
|
@echo "Building $(CLIENTBIN) in $(B):"
|
||||||
@echo " PLATFORM: $(PLATFORM)"
|
@echo " PLATFORM: $(PLATFORM)"
|
||||||
@echo " ARCH: $(ARCH)"
|
@echo " ARCH: $(ARCH)"
|
||||||
@echo " FILE_ARCH: $(FILE_ARCH)"
|
|
||||||
@echo " VERSION: $(VERSION)"
|
@echo " VERSION: $(VERSION)"
|
||||||
@echo " COMPILE_PLATFORM: $(COMPILE_PLATFORM)"
|
@echo " COMPILE_PLATFORM: $(COMPILE_PLATFORM)"
|
||||||
@echo " COMPILE_ARCH: $(COMPILE_ARCH)"
|
@echo " COMPILE_ARCH: $(COMPILE_ARCH)"
|
||||||
|
|
|
@ -98,7 +98,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
#define PATH_SEP '\\'
|
#define PATH_SEP '\\'
|
||||||
|
|
||||||
#if defined( __WIN64__ )
|
#if defined( __WIN64__ )
|
||||||
#define ARCH_STRING "x64"
|
#define ARCH_STRING "x86_64"
|
||||||
#elif defined _M_ALPHA
|
#elif defined _M_ALPHA
|
||||||
#define ARCH_STRING "AXP"
|
#define ARCH_STRING "AXP"
|
||||||
#endif
|
#endif
|
||||||
|
@ -154,7 +154,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
#define ARCH_STRING "ppc"
|
#define ARCH_STRING "ppc"
|
||||||
#define Q3_BIG_ENDIAN
|
#define Q3_BIG_ENDIAN
|
||||||
#elif defined __i386__
|
#elif defined __i386__
|
||||||
#define ARCH_STRING "i386"
|
#define ARCH_STRING "x86"
|
||||||
#define Q3_LITTLE_ENDIAN
|
#define Q3_LITTLE_ENDIAN
|
||||||
#elif defined __x86_64__
|
#elif defined __x86_64__
|
||||||
#undef idx64
|
#undef idx64
|
||||||
|
@ -184,7 +184,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
#define PATH_SEP '/'
|
#define PATH_SEP '/'
|
||||||
|
|
||||||
#if defined __i386__
|
#if defined __i386__
|
||||||
#define ARCH_STRING "i386"
|
#define ARCH_STRING "x86"
|
||||||
#elif defined __x86_64__
|
#elif defined __x86_64__
|
||||||
#undef idx64
|
#undef idx64
|
||||||
#define idx64 1
|
#define idx64 1
|
||||||
|
@ -248,11 +248,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
#define PATH_SEP '/'
|
#define PATH_SEP '/'
|
||||||
|
|
||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
#define ARCH_STRING "i386"
|
#define ARCH_STRING "x86"
|
||||||
#elif defined __amd64__
|
#elif defined __amd64__
|
||||||
#undef idx64
|
#undef idx64
|
||||||
#define idx64 1
|
#define idx64 1
|
||||||
#define ARCH_STRING "amd64"
|
#define ARCH_STRING "x86_64"
|
||||||
#elif defined __axp__
|
#elif defined __axp__
|
||||||
#define ARCH_STRING "alpha"
|
#define ARCH_STRING "alpha"
|
||||||
#endif
|
#endif
|
||||||
|
@ -279,7 +279,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
#define PATH_SEP '/'
|
#define PATH_SEP '/'
|
||||||
|
|
||||||
#ifdef __i386__
|
#ifdef __i386__
|
||||||
#define ARCH_STRING "i386"
|
#define ARCH_STRING "x86"
|
||||||
#elif defined __sparc
|
#elif defined __sparc
|
||||||
#define ARCH_STRING "sparc"
|
#define ARCH_STRING "sparc"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -11,42 +11,42 @@ MPACKDIR=missionpack
|
||||||
|
|
||||||
BIN_OBJ="
|
BIN_OBJ="
|
||||||
build/release-darwin-x86_64/ioquake3.x86_64
|
build/release-darwin-x86_64/ioquake3.x86_64
|
||||||
build/release-darwin-i386/ioquake3.i386
|
build/release-darwin-x86/ioquake3.x86
|
||||||
build/release-darwin-ppc/ioquake3.ppc
|
build/release-darwin-ppc/ioquake3.ppc
|
||||||
"
|
"
|
||||||
BIN_DEDOBJ="
|
BIN_DEDOBJ="
|
||||||
build/release-darwin-x86_64/ioq3ded.x86_64
|
build/release-darwin-x86_64/ioq3ded.x86_64
|
||||||
build/release-darwin-i386/ioq3ded.i386
|
build/release-darwin-x86/ioq3ded.x86
|
||||||
build/release-darwin-ppc/ioq3ded.ppc
|
build/release-darwin-ppc/ioq3ded.ppc
|
||||||
"
|
"
|
||||||
BASE_OBJ="
|
BASE_OBJ="
|
||||||
build/release-darwin-x86_64/$BASEDIR/cgamex86_64.dylib
|
build/release-darwin-x86_64/$BASEDIR/cgamex86_64.dylib
|
||||||
build/release-darwin-i386/$BASEDIR/cgamei386.dylib
|
build/release-darwin-x86/$BASEDIR/cgamex86.dylib
|
||||||
build/release-darwin-ppc/$BASEDIR/cgameppc.dylib
|
build/release-darwin-ppc/$BASEDIR/cgameppc.dylib
|
||||||
build/release-darwin-x86_64/$BASEDIR/uix86_64.dylib
|
build/release-darwin-x86_64/$BASEDIR/uix86_64.dylib
|
||||||
build/release-darwin-i386/$BASEDIR/uii386.dylib
|
build/release-darwin-x86/$BASEDIR/uix86.dylib
|
||||||
build/release-darwin-ppc/$BASEDIR/uippc.dylib
|
build/release-darwin-ppc/$BASEDIR/uippc.dylib
|
||||||
build/release-darwin-x86_64/$BASEDIR/qagamex86_64.dylib
|
build/release-darwin-x86_64/$BASEDIR/qagamex86_64.dylib
|
||||||
build/release-darwin-i386/$BASEDIR/qagamei386.dylib
|
build/release-darwin-x86/$BASEDIR/qagamex86.dylib
|
||||||
build/release-darwin-ppc/$BASEDIR/qagameppc.dylib
|
build/release-darwin-ppc/$BASEDIR/qagameppc.dylib
|
||||||
"
|
"
|
||||||
MPACK_OBJ="
|
MPACK_OBJ="
|
||||||
build/release-darwin-x86_64/$MPACKDIR/cgamex86_64.dylib
|
build/release-darwin-x86_64/$MPACKDIR/cgamex86_64.dylib
|
||||||
build/release-darwin-i386/$MPACKDIR/cgamei386.dylib
|
build/release-darwin-x86/$MPACKDIR/cgamex86.dylib
|
||||||
build/release-darwin-ppc/$MPACKDIR/cgameppc.dylib
|
build/release-darwin-ppc/$MPACKDIR/cgameppc.dylib
|
||||||
build/release-darwin-x86_64/$MPACKDIR/uix86_64.dylib
|
build/release-darwin-x86_64/$MPACKDIR/uix86_64.dylib
|
||||||
build/release-darwin-i386/$MPACKDIR/uii386.dylib
|
build/release-darwin-x86/$MPACKDIR/uix86.dylib
|
||||||
build/release-darwin-ppc/$MPACKDIR/uippc.dylib
|
build/release-darwin-ppc/$MPACKDIR/uippc.dylib
|
||||||
build/release-darwin-x86_64/$MPACKDIR/qagamex86_64.dylib
|
build/release-darwin-x86_64/$MPACKDIR/qagamex86_64.dylib
|
||||||
build/release-darwin-i386/$MPACKDIR/qagamei386.dylib
|
build/release-darwin-x86/$MPACKDIR/qagamex86.dylib
|
||||||
build/release-darwin-ppc/$MPACKDIR/qagameppc.dylib
|
build/release-darwin-ppc/$MPACKDIR/qagameppc.dylib
|
||||||
"
|
"
|
||||||
RENDER_OBJ="
|
RENDER_OBJ="
|
||||||
build/release-darwin-x86_64/renderer_opengl1_x86_64.dylib
|
build/release-darwin-x86_64/renderer_opengl1_x86_64.dylib
|
||||||
build/release-darwin-i386/renderer_opengl1_i386.dylib
|
build/release-darwin-x86/renderer_opengl1_x86.dylib
|
||||||
build/release-darwin-ppc/renderer_opengl1_ppc.dylib
|
build/release-darwin-ppc/renderer_opengl1_ppc.dylib
|
||||||
build/release-darwin-x86_64/renderer_opengl2_x86_64.dylib
|
build/release-darwin-x86_64/renderer_opengl2_x86_64.dylib
|
||||||
build/release-darwin-i386/renderer_opengl2_i386.dylib
|
build/release-darwin-x86/renderer_opengl2_x86.dylib
|
||||||
build/release-darwin-ppc/renderer_opengl2_ppc.dylib
|
build/release-darwin-ppc/renderer_opengl2_ppc.dylib
|
||||||
"
|
"
|
||||||
|
|
||||||
|
@ -133,11 +133,11 @@ fi
|
||||||
|
|
||||||
echo;echo
|
echo;echo
|
||||||
|
|
||||||
# i386 client and server
|
# x86 client and server
|
||||||
if [ -d build/release-darwin-i386 ]; then
|
if [ -d build/release-darwin-x86 ]; then
|
||||||
rm -r build/release-darwin-i386
|
rm -r build/release-darwin-x86
|
||||||
fi
|
fi
|
||||||
(ARCH=i386 CC=gcc-4.0 CFLAGS=$X86_CFLAGS LDFLAGS=$X86_LDFLAGS make -j$NCPU) || exit 1;
|
(ARCH=x86 CC=gcc-4.0 CFLAGS=$X86_CFLAGS LDFLAGS=$X86_LDFLAGS make -j$NCPU) || exit 1;
|
||||||
|
|
||||||
echo;echo
|
echo;echo
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ echo "
|
||||||
</plist>
|
</plist>
|
||||||
" > $DESTDIR/$APPBUNDLE/Contents/Info.plist
|
" > $DESTDIR/$APPBUNDLE/Contents/Info.plist
|
||||||
|
|
||||||
# Make UB's from previous builds of i386, x86_64 and ppc binaries
|
# Make UB's from previous builds of x86, x86_64 and ppc binaries
|
||||||
lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY $BIN_OBJ
|
lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$BINARY $BIN_OBJ
|
||||||
lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$DEDBIN $BIN_DEDOBJ
|
lipo -create -o $DESTDIR/$APPBUNDLE/Contents/MacOS/$DEDBIN $BIN_DEDOBJ
|
||||||
|
|
||||||
|
|
|
@ -5,25 +5,30 @@
|
||||||
|
|
||||||
if [ $# -ne 1 ]; then
|
if [ $# -ne 1 ]; then
|
||||||
echo "Usage: $0 target_architecture"
|
echo "Usage: $0 target_architecture"
|
||||||
echo "Example: $0 i386"
|
echo "Example: $0 x86"
|
||||||
echo "other valid options are x86_64 or ppc"
|
echo "other valid options are x86_64 or ppc"
|
||||||
echo
|
echo
|
||||||
echo "If you don't know or care about architectures please consider using make-macosx-ub.sh instead of this script."
|
echo "If you don't know or care about architectures please consider using make-macosx-ub.sh instead of this script."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$1" == "i386" ]; then
|
if [ "$1" == "x86" ]; then
|
||||||
BUILDARCH=i386
|
BUILDARCH=x86
|
||||||
|
DARWIN_GCC_ARCH=i386
|
||||||
elif [ "$1" == "x86_64" ]; then
|
elif [ "$1" == "x86_64" ]; then
|
||||||
BUILDARCH=x86_64
|
BUILDARCH=x86_64
|
||||||
elif [ "$1" == "ppc" ]; then
|
elif [ "$1" == "ppc" ]; then
|
||||||
BUILDARCH=ppc
|
BUILDARCH=ppc
|
||||||
else
|
else
|
||||||
echo "Invalid architecture: $1"
|
echo "Invalid architecture: $1"
|
||||||
echo "Valid architectures are i386, x86_64 or ppc"
|
echo "Valid architectures are x86, x86_64 or ppc"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$DARWIN_GCC_ARCH" ]; then
|
||||||
|
DARWIN_GCC_ARCH=${BUILDARCH}
|
||||||
|
fi
|
||||||
|
|
||||||
CC=gcc-4.0
|
CC=gcc-4.0
|
||||||
APPBUNDLE=ioquake3.app
|
APPBUNDLE=ioquake3.app
|
||||||
BINARY=ioquake3.${BUILDARCH}
|
BINARY=ioquake3.${BUILDARCH}
|
||||||
|
@ -35,10 +40,10 @@ BASEDIR=baseq3
|
||||||
MPACKDIR=missionpack
|
MPACKDIR=missionpack
|
||||||
|
|
||||||
BIN_OBJ="
|
BIN_OBJ="
|
||||||
build/release-darwin-${BUILDARCH}/ioquake3.${BUILDARCH}
|
build/release-darwin-${BUILDARCH}/${BINARY}
|
||||||
"
|
"
|
||||||
BIN_DEDOBJ="
|
BIN_DEDOBJ="
|
||||||
build/release-darwin-${BUILDARCH}/ioq3ded.${BUILDARCH}
|
build/release-darwin-${BUILDARCH}/${DEDBIN}
|
||||||
"
|
"
|
||||||
BASE_OBJ="
|
BASE_OBJ="
|
||||||
build/release-darwin-${BUILDARCH}/$BASEDIR/cgame${BUILDARCH}.dylib
|
build/release-darwin-${BUILDARCH}/$BASEDIR/cgame${BUILDARCH}.dylib
|
||||||
|
@ -79,7 +84,7 @@ unset ARCH_LDFLAGS
|
||||||
|
|
||||||
if [ -d /Developer/SDKs/MacOSX10.5.sdk ]; then
|
if [ -d /Developer/SDKs/MacOSX10.5.sdk ]; then
|
||||||
ARCH_SDK=/Developer/SDKs/MacOSX10.5.sdk
|
ARCH_SDK=/Developer/SDKs/MacOSX10.5.sdk
|
||||||
ARCH_CFLAGS="-arch ${BUILDARCH} -isysroot /Developer/SDKs/MacOSX10.5.sdk \
|
ARCH_CFLAGS="-arch ${DARWIN_GCC_ARCH} -isysroot /Developer/SDKs/MacOSX10.5.sdk \
|
||||||
-DMAC_OS_X_VERSION_MIN_REQUIRED=1050"
|
-DMAC_OS_X_VERSION_MIN_REQUIRED=1050"
|
||||||
ARCH_LDFLAGS=" -mmacosx-version-min=10.5"
|
ARCH_LDFLAGS=" -mmacosx-version-min=10.5"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue