added support for cross-compiling to Windows 64-bit platform
authorHolger Schemel <info@artsoft.org>
Sun, 21 Jun 2020 13:20:54 +0000 (15:20 +0200)
committerHolger Schemel <info@artsoft.org>
Sun, 21 Jun 2020 13:21:12 +0000 (15:21 +0200)
Makefile
src/Makefile

index 9dbdfe2bb4c92df5776b0b0161e96f38aac8f894..8921819891e9c82403ee3783ffa9532df6ca810b 100644 (file)
--- 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
 
index e42d5370f7c73fb0b4170e001fe3a45b4d48cd72..b3a18b5e8376783f38f370f7d6a6201ae2cdd656 100644 (file)
@@ -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