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)
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
# 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=
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