diff options
-rw-r--r-- | Makefile | 123 | ||||
-rwxr-xr-x | cross-make-mingw64.sh | 2 |
2 files changed, 47 insertions, 78 deletions
@@ -17,12 +17,6 @@ ifeq ($(COMPILE_PLATFORM),darwin) COMPILE_ARCH=$(shell uname -p | sed -e s/i.86/x86/) endif -ifeq ($(COMPILE_PLATFORM),mingw32) - ifeq ($(COMPILE_ARCH),x86_64) - COMPILE_ARCH=x64 - endif -endif - ifndef BUILD_STANDALONE BUILD_STANDALONE = endif @@ -57,6 +51,20 @@ PLATFORM=$(COMPILE_PLATFORM) endif export PLATFORM +ifeq ($(COMPILE_ARCH),i386) + COMPILE_ARCH=x86 +endif +ifeq ($(COMPILE_ARCH),i86pc) + COMPILE_ARCH=x86 +endif + +ifeq ($(COMPILE_ARCH),amd64) + COMPILE_ARCH=x86_64 +endif +ifeq ($(COMPILE_ARCH),x64) + COMPILE_ARCH=x86_64 +endif + ifeq ($(COMPILE_ARCH),powerpc) COMPILE_ARCH=ppc endif @@ -64,11 +72,20 @@ ifeq ($(COMPILE_ARCH),powerpc64) COMPILE_ARCH=ppc64 endif +ifeq ($(COMPILE_ARCH),axp) + COMPILE_ARCH=alpha +endif + ifndef ARCH ARCH=$(COMPILE_ARCH) endif export ARCH +ifndef FILE_ARCH +FILE_ARCH=$(ARCH) +endif +export FILE_ARCH + ifneq ($(PLATFORM),$(COMPILE_PLATFORM)) CROSS_COMPILING=1 else @@ -280,9 +297,6 @@ MKDIR=mkdir ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu")) - ifeq ($(ARCH),axp) - ARCH=alpha - else ifeq ($(ARCH),x86_64) LIB=lib64 else @@ -294,7 +308,6 @@ ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu")) endif endif endif - endif BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes \ -pipe -DUSE_ICON @@ -485,12 +498,13 @@ ifeq ($(PLATFORM),mingw32) endif endif - ifeq ($(ARCH),x64) + ifeq ($(ARCH),x86_64) OPTIMIZEVM = -O3 -fno-omit-frame-pointer \ -falign-loops=2 -funroll-loops -falign-jumps=2 -falign-functions=2 \ -fstrength-reduce OPTIMIZE = $(OPTIMIZEVM) --fast-math HAVE_VM_COMPILED = true + FILE_ARCH=x64 endif ifeq ($(ARCH),x86) OPTIMIZEVM = -O3 -march=i586 -fno-omit-frame-pointer \ @@ -520,7 +534,7 @@ ifeq ($(PLATFORM),mingw32) ifneq ($(USE_CURL_DLOPEN),1) ifeq ($(USE_LOCAL_HEADERS),1) CLIENT_CFLAGS += -DCURL_STATICLIB - ifeq ($(ARCH),x64) + ifeq ($(ARCH),x86_64) CLIENT_LIBS += $(LIBSDIR)/win64/libcurl.a else CLIENT_LIBS += $(LIBSDIR)/win32/libcurl.a @@ -544,7 +558,7 @@ ifeq ($(PLATFORM),mingw32) ifeq ($(USE_LOCAL_HEADERS),1) CLIENT_CFLAGS += -I$(SDLHDIR)/include - ifeq ($(ARCH), x86) + ifeq ($(ARCH),x86) CLIENT_LIBS += $(LIBSDIR)/win32/libSDLmain.a \ $(LIBSDIR)/win32/libSDL.dll.a RENDERER_LIBS += $(LIBSDIR)/win32/libSDLmain.a \ @@ -614,12 +628,15 @@ ifeq ($(PLATFORM),freebsd) BASE_CFLAGS += -m32 endif endif - ifeq ($(ARCH),amd64) + ifeq ($(ARCH),x86_64) ifeq ($(CROSS_COMPILING),1) BASE_CFLAGS += -m64 endif endif + ifeq ($(ARCH),x86_64) + FILE_ARCH=amd64 + endif else # ifeq freebsd ############################################################################# @@ -666,6 +683,9 @@ ifeq ($(PLATFORM),openbsd) endif endif + ifeq ($(ARCH),x86_64) + FILE_ARCH=amd64 + endif else # ifeq openbsd ############################################################################# @@ -674,7 +694,6 @@ else # ifeq openbsd ifeq ($(PLATFORM),netbsd) - ARCH=x86 LIBS=-lm SHLIBEXT=so SHLIBCFLAGS=-fPIC @@ -683,12 +702,15 @@ ifeq ($(PLATFORM),netbsd) BASE_CFLAGS = -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes - ifneq ($(ARCH),x86) + ifeq ($(ARCH),x86) HAVE_VM_COMPILED=true endif BUILD_CLIENT = 0 + ifeq ($(ARCH),x86_64) + FILE_ARCH=amd64 + endif else # ifeq netbsd ############################################################################# @@ -730,11 +752,7 @@ ifeq ($(PLATFORM),sunos) MKDIR=gmkdir COPYDIR="/usr/local/share/games/tremulous" - ifneq (,$(findstring i86pc,$(shell uname -m))) - ARCH=x86 - else #default to sparc - ARCH=sparc - endif + ARCH=sparc ifneq ($(ARCH),x86) ifneq ($(ARCH),sparc) @@ -812,11 +830,11 @@ ifeq ($(USE_FREETYPE),1) endif ifndef FULLBINEXT - FULLBINEXT=.$(ARCH)$(BINEXT) + FULLBINEXT=.$(FILE_ARCH)$(BINEXT) endif ifndef SHLIBNAME - SHLIBNAME=$(ARCH).$(SHLIBEXT) + SHLIBNAME=$(FILE_ARCH).$(SHLIBEXT) endif ifneq ($(BUILD_SERVER),0) @@ -1065,6 +1083,7 @@ targets: makedirs @echo "Building $(CLIENTBIN) in $(B):" @echo " PLATFORM: $(PLATFORM)" @echo " ARCH: $(ARCH)" + @echo " FILE_ARCH: $(FILE_ARCH)" @echo " VERSION: $(VERSION)" @echo " COMPILE_PLATFORM: $(COMPILE_PLATFORM)" @echo " COMPILE_ARCH: $(COMPILE_ARCH)" @@ -1559,16 +1578,6 @@ ifeq ($(ARCH),x86_64) $(B)/client/snapvector.o \ $(B)/client/ftola.o endif -ifeq ($(ARCH),amd64) - Q3OBJ += \ - $(B)/client/snapvector.o \ - $(B)/client/ftola.o -endif -ifeq ($(ARCH),x64) - Q3OBJ += \ - $(B)/client/snapvector.o \ - $(B)/client/ftola.o - endif ifeq ($(USE_VOIP),1) ifeq ($(USE_INTERNAL_SPEEX),1) @@ -1778,26 +1787,11 @@ Q3OBJ += \ endif ifeq ($(HAVE_VM_COMPILED),true) - ifeq ($(ARCH),x86) + ifneq ($(findstring $(ARCH),x86 x86_64),) Q3OBJ += \ $(B)/client/vm_x86.o endif - ifeq ($(ARCH),x86_64) - Q3OBJ += \ - $(B)/client/vm_x86.o - endif - ifeq ($(ARCH),amd64) - Q3OBJ += \ - $(B)/client/vm_x86.o - endif - ifeq ($(ARCH),x64) - Q3OBJ += \ - $(B)/client/vm_x86.o - endif - ifeq ($(ARCH),ppc) - Q3OBJ += $(B)/client/vm_powerpc.o $(B)/client/vm_powerpc_asm.o - endif - ifeq ($(ARCH),ppc64) + ifneq ($(findstring $(ARCH),ppc ppc64),) Q3OBJ += $(B)/client/vm_powerpc.o $(B)/client/vm_powerpc_asm.o endif ifeq ($(ARCH),sparc) @@ -1920,16 +1914,6 @@ ifeq ($(ARCH),x86_64) $(B)/ded/snapvector.o \ $(B)/ded/ftola.o endif -ifeq ($(ARCH),amd64) - Q3DOBJ += \ - $(B)/ded/snapvector.o \ - $(B)/ded/ftola.o -endif -ifeq ($(ARCH),x64) - Q3DOBJ += \ - $(B)/ded/snapvector.o \ - $(B)/ded/ftola.o -endif ifeq ($(USE_INTERNAL_ZLIB),1) Q3DOBJ += \ @@ -1942,26 +1926,11 @@ Q3DOBJ += \ endif ifeq ($(HAVE_VM_COMPILED),true) - ifeq ($(ARCH),x86) + ifneq ($(findstring $(ARCH),x86 x86_64),) Q3DOBJ += \ $(B)/ded/vm_x86.o endif - ifeq ($(ARCH),x86_64) - Q3DOBJ += \ - $(B)/ded/vm_x86.o - endif - ifeq ($(ARCH),amd64) - Q3DOBJ += \ - $(B)/ded/vm_x86.o - endif - ifeq ($(ARCH),x64) - Q3DOBJ += \ - $(B)/ded/vm_x86.o - endif - ifeq ($(ARCH),ppc) - Q3DOBJ += $(B)/ded/vm_powerpc.o $(B)/ded/vm_powerpc_asm.o - endif - ifeq ($(ARCH),ppc64) + ifneq ($(findstring $(ARCH),ppc ppc64),) Q3DOBJ += $(B)/ded/vm_powerpc.o $(B)/ded/vm_powerpc_asm.o endif ifeq ($(ARCH),sparc) diff --git a/cross-make-mingw64.sh b/cross-make-mingw64.sh index 16c3d5da..778e20d4 100755 --- a/cross-make-mingw64.sh +++ b/cross-make-mingw64.sh @@ -30,6 +30,6 @@ if [ "X$WINDRES" = "X" -o "X$CC" = "X" ]; then fi export PLATFORM=mingw32 -export ARCH=x64 +export ARCH=x86_64 exec make $* |