From: Holger Schemel Date: Sun, 21 Jun 2020 13:20:54 +0000 (+0200) Subject: added support for cross-compiling to Windows 64-bit platform X-Git-Tag: 4.2.0.0~12 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=79d9ea719f6a44c452f394600c6076063d4c73de;p=rocksndiamonds.git added support for cross-compiling to Windows 64-bit platform --- diff --git a/Makefile b/Makefile index 9dbdfe2b..89218198 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,8 @@ MAKE = make # JOYSTICK = -DNO_JOYSTICK # path for cross-compiling (only needed for non-native Windows build) -CROSS_PATH_WIN32 = /usr/local/cross-tools/i386-mingw32msvc +CROSS_PATH_WIN32 = /usr/local/cross-tools/i686-w64-mingw32 +CROSS_PATH_WIN64 = /usr/local/cross-tools/x86_64-w64-mingw32 # ----------------------------------------------------------------------------- @@ -74,6 +75,9 @@ mac: cross-win32: @PATH=$(CROSS_PATH_WIN32)/bin:${PATH} $(MAKE_CMD) PLATFORM=cross-win32 +cross-win64: + @PATH=$(CROSS_PATH_WIN64)/bin:${PATH} $(MAKE_CMD) PLATFORM=cross-win64 + android-compile: @$(MAKE_CMD_ANDROID) compile @@ -162,6 +166,9 @@ dist-build-unix: dist-build-win32: @BUILD_DIST=TRUE $(MAKE) cross-win32 +dist-build-win64: + @BUILD_DIST=TRUE $(MAKE) cross-win64 + dist-build-macosx: @BUILD_DIST=TRUE $(MAKE) @@ -172,7 +179,10 @@ dist-package-unix: $(MAKE_DIST) package unix dist-package-win32: - $(MAKE_DIST) package win + $(MAKE_DIST) package win32 + +dist-package-win64: + $(MAKE_DIST) package win64 dist-package-macosx: $(MAKE_DIST) package mac @@ -184,7 +194,10 @@ dist-copy-package-unix: $(MAKE_DIST) copy-package unix dist-copy-package-win32: - $(MAKE_DIST) copy-package win + $(MAKE_DIST) copy-package win32 + +dist-copy-package-win64: + $(MAKE_DIST) copy-package win64 dist-copy-package-macosx: $(MAKE_DIST) copy-package mac @@ -196,7 +209,10 @@ dist-upload-unix: $(MAKE_DIST) upload unix dist-upload-win32: - $(MAKE_DIST) upload win + $(MAKE_DIST) upload win32 + +dist-upload-win64: + $(MAKE_DIST) upload win64 dist-upload-macosx: $(MAKE_DIST) upload mac @@ -207,18 +223,21 @@ dist-upload-android: dist-package-all: $(MAKE) dist-package-unix $(MAKE) dist-package-win32 + $(MAKE) dist-package-win64 $(MAKE) dist-package-macosx $(MAKE) dist-package-android dist-copy-package-all: $(MAKE) dist-copy-package-unix $(MAKE) dist-copy-package-win32 + $(MAKE) dist-copy-package-win64 $(MAKE) dist-copy-package-macosx $(MAKE) dist-copy-package-android dist-upload-all: $(MAKE) dist-upload-unix $(MAKE) dist-upload-win32 + $(MAKE) dist-upload-win64 $(MAKE) dist-upload-macosx $(MAKE) dist-upload-android diff --git a/src/Makefile b/src/Makefile index e42d5370..b3a18b5e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -19,6 +19,15 @@ ifndef PLATFORM # unknown platform -- default to Unix PLATFORM = unix endif +PLATFORM_BASE = $(PLATFORM) + +ifeq ($(PLATFORM),cross-win32) +PLATFORM_BASE = cross-win +endif +ifeq ($(PLATFORM),cross-win64) +PLATFORM_BASE = cross-win +endif + AR = ar RANLIB = ranlib ETAGS = etags @@ -48,7 +57,7 @@ ifeq ($(PLATFORM),unix) # compiling on Unix/Linux (generic) PROFILING_FLAGS = -pg endif -ifeq ($(PLATFORM),cross-win32) # cross-compiling to Windows +ifeq ($(PLATFORM_BASE),cross-win) # cross-compiling to Windows PROGNAME = ../$(PROGBASE).exe EXTRA_LDFLAGS = -lshfolder -lwsock32 endif @@ -200,7 +209,7 @@ AUTOCONF = conf_gfx.h conf_snd.h conf_mus.h ICONBASE = windows_icon ICON_BASEPATH = ../Special/Icons/windows_icons -ifeq ($(PLATFORM),cross-win32) +ifeq ($(PLATFORM_BASE),cross-win) ICON_PATH = $(ICON_BASEPATH)/$(EDITION) ICON = $(ICONBASE).o endif