]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
reworked makefile a little bit to support DX9 renderer, add D3D=1 to
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 19 Aug 2010 14:33:10 +0000 (14:33 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 19 Aug 2010 14:33:10 +0000 (14:33 +0000)
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
makefile.inc

index 32b30e4c28f9c4f7c9344642928c007ab642d9cc..e3b6957e8245e900fb596b369e181cc4117c2cd9 100644 (file)
--- 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
index aeac6e313e8549f22e2b46965b738e70625d73e0..747f835970226fc520571eac8db1170843725995 100644 (file)
@@ -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