From 3b913d2ec9c3b875521aa43e5b5147ffdaceeb9f Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 19 Aug 2010 14:33:10 +0000 Subject: [PATCH] reworked makefile a little bit to support DX9 renderer, add D3D=1 to your make line to use it now WIN32RELEASE and WIN64RELEASE do something useful (correct options for 32bit and 64bit compiles) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10400 d7cf8633-e32d-0410-b094-e92efae38249 --- makefile | 32 ++++++++++++++++++++++++-------- makefile.inc | 6 ++---- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/makefile b/makefile index 32b30e4c..e3b6957e 100644 --- a/makefile +++ b/makefile @@ -159,6 +159,30 @@ endif endif # Win32 configuration +ifeq ($(WIN32RELEASE), 1) +# TARGET=i686-pc-mingw32 +# CC=$(TARGET)-g++ +# WINDRES=$(TARGET)-windres + CPUOPTIMIZATIONS+=-march=i686 -DUSE_WSPIAPI_H + LDFLAGS_WINCOMMON+=-Wl,--large-address-aware +endif + +ifeq ($(WIN64RELEASE), 1) +# TARGET=x86_64-pc-mingw32 +# CC=$(TARGET)-g++ +# WINDRES=$(TARGET)-windres +endif + +ifeq ($(D3D), 1) + CPUOPTIMIZATIONS+=-DSUPPORTD3D -DSUPPORTDIRECTX + CFLAGS_WARNINGS=-Wall + LDFLAGS_WINCOMMON=-ld3d9 +else + CFLAGS_WARNINGS=-Wall -Wold-style-definition -Wstrict-prototypes -Wsign-compare -Wdeclaration-after-statement + LDFLAGS_WINCOMMON= +endif + + ifeq ($(DP_MAKE_TARGET), mingw) DEFAULT_SNDAPI=WIN OBJ_CD=$(OBJ_WINCD) @@ -183,14 +207,6 @@ ifeq ($(DP_MAKE_TARGET), mingw) EXE_SDLNEXUIZ=$(EXE_WINSDLNEXUIZ) endif -ifeq ($(WIN32RELEASE), 1) - CPUOPTIMIZATIONS=-march=i686 -DSUPPORTDIRECTX -DUSE_WSPIAPI_H -endif - -ifeq ($(WIN64RELEASE), 1) - CPUOPTIMIZATIONS= -endif - ##### Sound configuration ##### ifndef DP_SOUND_API diff --git a/makefile.inc b/makefile.inc index aeac6e31..747f8359 100644 --- a/makefile.inc +++ b/makefile.inc @@ -178,7 +178,7 @@ OBJ_SDL= builddate.c sys_sdl.o vid_sdl.o $(OBJ_SND_COMMON) snd_sdl.o cd_sdl.o $( # Compilation -CFLAGS_COMMON=$(CFLAGS_MAKEDEP) $(CFLAGS_PRELOAD) $(CFLAGS_FS) $(CFLAGS_CG) -Wall -Wold-style-definition -Wstrict-prototypes -Wsign-compare -Wdeclaration-after-statement +CFLAGS_COMMON=$(CFLAGS_MAKEDEP) $(CFLAGS_PRELOAD) $(CFLAGS_FS) $(CFLAGS_CG) $(CFLAGS_WARNINGS) CFLAGS_DEBUG=-ggdb CFLAGS_PROFILE=-g -pg -ggdb -fprofile-arcs CFLAGS_RELEASE= @@ -290,9 +290,7 @@ OBJ_WINCD=cd_win.o OBJ_WGL= builddate.c sys_win.o vid_wgl.o $(OBJ_SND_WIN) $(OBJ_WINCD) $(OBJ_COMMON) # Link -# Note that Windows Vista users may need --large-address-aware because Vista seems to map over 500MB of application address space for its own purposes, which is a significant chunk taken out of the default 2GB address space, this option raises the limit to 4GB (or 3GB on Vista 32 and older versions of Windows). -# if using mingw64 you need to use LDFLAGS_WINCOMMON= on the commandline to get rid of this, otherwise it produces a compile error -LDFLAGS_WINCOMMON=-Wl,--large-address-aware +# see LDFLAGS_WINCOMMON in makefile LDFLAGS_WINCL=$(LDFLAGS_WINCOMMON) -mwindows -lwinmm -luser32 -lgdi32 -ldxguid -ldinput -lcomctl32 -lws2_32 LDFLAGS_WINSV=$(LDFLAGS_WINCOMMON) -mconsole -lwinmm -lws2_32 LDFLAGS_WINSDL=$(LDFLAGS_WINCOMMON) $(SDLCONFIG_LIBS) $(LIB_SND_MODPLUG) -lwinmm -lws2_32 -- 2.39.2