From: havoc Date: Mon, 18 Jul 2016 03:23:15 +0000 (+0000) Subject: Refactor DP_MACHINE logic in makefile and makefile.inc because it was X-Git-Tag: xonotic-v0.8.2~37 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=71ee6de8313addbd9f091305f56c769c3336c0d1;p=xonotic%2Fdarkplaces.git Refactor DP_MACHINE logic in makefile and makefile.inc because it was broken on mingw. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12262 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=97ccfe67df97b42b26e36f1cd92c8dad52bac4a3 --- diff --git a/makefile b/makefile index 970064c5..59504d11 100644 --- a/makefile +++ b/makefile @@ -26,10 +26,24 @@ endif # ifneq ($(filter %BSD,$(DP_ARCH)),) endif # ifdef windir endif # ifndef DP_MAKE_TARGET -# If we're not on compiling for Win32, we need additional information -ifneq ($(DP_MAKE_TARGET), mingw) - DP_ARCH:=$(shell uname) +# If we're targeting an x86 CPU we want to enable DP_SSE (CFLAGS_SSE and SSE2) +ifeq ($(DP_MAKE_TARGET), mingw) + DP_SSE:=1 +else DP_MACHINE:=$(shell uname -m) + ifeq ($(DP_MACHINE),x86_64) + DP_SSE:=1 + else + ifeq ($(DP_MACHINE),i686) + DP_SSE:=1 + else + ifeq ($(DP_MACHINE),i386) + DP_SSE:=1 + else + DP_SSE:=0 + endif # ifeq ($(DP_MACHINE),i386) + endif # ifeq ($(DP_MACHINE),i686) + endif # ifeq ($(DP_MACHINE),x86_64) endif # Makefile name diff --git a/makefile.inc b/makefile.inc index 32417d17..2a59220e 100644 --- a/makefile.inc +++ b/makefile.inc @@ -180,23 +180,13 @@ CFLAGS_RELEASE= CFLAGS_RELEASE_PROFILE=-fbranch-probabilities CFLAGS_SDL=$(SDLCONFIG_CFLAGS) -ifeq ($(DP_MACHINE),x86_64) - CFLAGS_SSE=-msse - CFLAGS_SSE2=-msse2 -else -ifeq ($(DP_MACHINE),i686) - CFLAGS_SSE=-msse - CFLAGS_SSE2=-msse2 -else -ifeq ($(DP_MACHINE),i386) +ifeq ($(DP_SSE),1) CFLAGS_SSE=-msse CFLAGS_SSE2=-msse2 else CFLAGS_SSE= CFLAGS_SSE2= -endif # ifeq ($(DP_MACHINE),i386) -endif # ifeq ($(DP_MACHINE),i686) -endif # ifeq ($(DP_MACHINE),x86_64) +endif # ifeq ($(DP_SSE),1) OPTIM_DEBUG=$(CPUOPTIMIZATIONS) #OPTIM_RELEASE=-O2 -fno-strict-aliasing -ffast-math -funroll-loops $(CPUOPTIMIZATIONS)