annotate Makefile.cross-mingw @ 490:ad647427303a

Improve build system.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 05 Dec 2019 02:24:44 +0200
parents 58b744131b86
children 76653f979a62
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
434
8c3b3d8009f6 Add Mingw/win32 cross-build Makefile.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 #
490
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
2 # For Win32/Win64 version cross-compilation via MinGW
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
3 # compiler suite under Linux/Unix
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
4 #
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
5 # This Makefile assumes that you have MinGW installed under /usr
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
6 # the way Debian MinGW packages do.
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
7 # For differing configurations you will have to either edit this
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
8 # file or alternatively provide make parameters, e.g.
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
9 #
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
10 # make -f Makefile.cross-mingw MINGW=64 BINTOOL_PREFIX=/opt/zoo/bar/
434
8c3b3d8009f6 Add Mingw/win32 cross-build Makefile.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 #
8c3b3d8009f6 Add Mingw/win32 cross-build Makefile.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12
490
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
13 ifeq ($(MINGW),64)
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
14 BINTOOL_PREFIX ?= x86_64-w64-mingw32-
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
15 MINGW_SYS_PATH ?= /usr/x86_64-w64-mingw32
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
16 MINGW_LOCAL_PATH ?= /usr/local/x86_64-w64-mingw32
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
17 OBJPATH ?= ./obj/win64/
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
18 else
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
19 BINTOOL_PREFIX ?= i686-w64-mingw32-
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
20 MINGW_SYS_PATH ?= /usr/i686-w64-mingw32
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
21 MINGW_LOCAL_PATH ?= /usr/local/i686-w64-mingw32
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
22 OBJPATH ?= ./obj/win32/
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
23 endif
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
24
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
25
434
8c3b3d8009f6 Add Mingw/win32 cross-build Makefile.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 # Miscellaneous
8c3b3d8009f6 Add Mingw/win32 cross-build Makefile.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 PREFIX =
8c3b3d8009f6 Add Mingw/win32 cross-build Makefile.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 BINPATH = ./
8c3b3d8009f6 Add Mingw/win32 cross-build Makefile.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 EXEEXT = .exe
8c3b3d8009f6 Add Mingw/win32 cross-build Makefile.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30
8c3b3d8009f6 Add Mingw/win32 cross-build Makefile.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 # Compiler flags and linker flags
490
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
32 CFLAGS += -I$(MINGW_LOCAL_PATH)/include/ \
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
33 -DHAVE_STRING_H \
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
34 -DTH_BYTEORDER=TH_LITTLE_ENDIAN \
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
35 -mconsole
457
85fa3d333556 Actually, revert the boolean changes .. meh.
Matti Hamalainen <ccr@tnsp.org>
parents: 453
diff changeset
36
490
ad647427303a Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 484
diff changeset
37 LDFLAGS += -L$(MINGW_LOCAL_PATH)/lib/
434
8c3b3d8009f6 Add Mingw/win32 cross-build Makefile.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38
8c3b3d8009f6 Add Mingw/win32 cross-build Makefile.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39
8c3b3d8009f6 Add Mingw/win32 cross-build Makefile.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40 ###
8c3b3d8009f6 Add Mingw/win32 cross-build Makefile.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 ### Stuff
8c3b3d8009f6 Add Mingw/win32 cross-build Makefile.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 ###
8c3b3d8009f6 Add Mingw/win32 cross-build Makefile.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43 #NOINST_TARGETS += $(ENDIANCHK_BIN) config.h
8c3b3d8009f6 Add Mingw/win32 cross-build Makefile.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 #THLIBS_DEP += config.h
8c3b3d8009f6 Add Mingw/win32 cross-build Makefile.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45
8c3b3d8009f6 Add Mingw/win32 cross-build Makefile.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46 include Makefile.gen
8c3b3d8009f6 Add Mingw/win32 cross-build Makefile.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47