changeset 490:ad647427303a

Improve build system.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 05 Dec 2019 02:24:44 +0200
parents 41c1d786ff08
children 76653f979a62
files Makefile.cross-mingw
diffstat 1 files changed, 27 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.cross-mingw	Mon Sep 23 19:47:11 2019 +0300
+++ b/Makefile.cross-mingw	Thu Dec 05 02:24:44 2019 +0200
@@ -1,17 +1,40 @@
 #
-# For win32 version cross-compilation with MinGW suite @ Linux
+# For Win32/Win64 version cross-compilation via MinGW
+# compiler suite under Linux/Unix
+#
+# This Makefile assumes that you have MinGW installed under /usr
+# the way Debian MinGW packages do.
+# For differing configurations you will have to either edit this
+# file or alternatively provide make parameters, e.g.
+#
+# make -f Makefile.cross-mingw MINGW=64 BINTOOL_PREFIX=/opt/zoo/bar/
 #
 
+ifeq ($(MINGW),64)
+BINTOOL_PREFIX ?= x86_64-w64-mingw32-
+MINGW_SYS_PATH ?= /usr/x86_64-w64-mingw32
+MINGW_LOCAL_PATH ?= /usr/local/x86_64-w64-mingw32
+OBJPATH ?= ./obj/win64/
+else
+BINTOOL_PREFIX ?= i686-w64-mingw32-
+MINGW_SYS_PATH ?= /usr/i686-w64-mingw32
+MINGW_LOCAL_PATH ?= /usr/local/i686-w64-mingw32
+OBJPATH ?= ./obj/win32/
+endif
+
+
 # Miscellaneous
-BINTOOL_PREFIX = i686-w64-mingw32-
 PREFIX =
 BINPATH = ./
-OBJPATH = obj/win32/
 EXEEXT = .exe
 
 # Compiler flags and linker flags
-CFLAGS += -DHAVE_STRING_H -DTH_BYTEORDER=TH_LITTLE_ENDIAN -mconsole
+CFLAGS += -I$(MINGW_LOCAL_PATH)/include/ \
+	 -DHAVE_STRING_H \
+	-DTH_BYTEORDER=TH_LITTLE_ENDIAN \
+	-mconsole
 
+LDFLAGS += -L$(MINGW_LOCAL_PATH)/lib/
 
 
 ###