build: add WIN64 target for building with MinGW-64

The main win targets all build, though there's a few warnings to be fixed.
SDL not working yet - might just need to rebuild the library, but might
also need to point to a different sdl2-config binary?

Signed-off-by: Kevin Shanahan <kmshanah@disenchant.net>
This commit is contained in:
Kevin Shanahan 2013-03-16 08:49:29 +10:30
parent e3fc6defa1
commit a5d8cd8a32

View File

@ -106,7 +106,7 @@ USE_XF86DGA ?= Y
endif
endif
ifeq ($(TARGET_OS),WIN32)
ifneq (,$(findstring $(TARGET_OS),WIN32 WIN64))
EXT = .exe
CD_TARGET ?= win
VID_TARGET ?= win
@ -121,13 +121,23 @@ endif
ifeq ($(TARGET_OS),WIN32)
EXT = .exe
ifneq ($(HOST_OS),WIN32)
TARGET ?= $(MINGW_CROSS_GUESS)
TARGET ?= $(MINGW32_CROSS_GUESS)
CC = $(TARGET)-gcc
STRIP = $(TARGET)-strip
WINDRES = $(TARGET)-windres
endif
else
EXT =
ifeq ($(TARGET_OS),WIN64)
EXT=.exe
ifneq ($(HOST_OS),WIN64)
TARGET ?= $(MINGW64_CROSS_GUESS)
CC = $(TARGET)-gcc
STRIP = $(TARGET)-strip
WINDRES = $(TARGET)-windres
endif
else
EXT=
endif
endif
# ============================================================================
@ -177,7 +187,7 @@ OGLBASE ?= $(OGLBASE_GUESS)
# i486-mingw32 (Arch).
# ------------------------------------------------------------------------
MINGW_CROSS_GUESS := $(shell \
MINGW32_CROSS_GUESS := $(shell \
if which i486-mingw32-gcc > /dev/null 2>&1; then \
echo i486-mingw32; \
elif which i586-mingw32msvc-gcc > /dev/null 2>&1; then \
@ -186,6 +196,13 @@ MINGW_CROSS_GUESS := $(shell \
echo i386-mingw32msvc; \
fi)
MINGW64_CROSS_GUESS := $(shell \
if which x86_64-w64-mingw32-gcc > /dev/null 2>&1; then \
echo x86_64-w64-mingw32; \
else \
echo x86_64-w64-mingw32; \
fi)
# --------------------------------
# GCC version and option checking
# --------------------------------
@ -646,7 +663,7 @@ endif
# Target OS Options
# ----------------------------------------------------------------------------
ifeq ($(TARGET_OS),WIN32)
ifneq (,$(findstring $(TARGET_OS),WIN32 WIN64))
COMMON_CPPFLAGS += -DWIN32_LEAN_AND_MEAN
COMMON_OBJS += net_wins.o sys_win.o
CL_OBJS += winquake.res