annotate Makefile.cross-mingw @ 2418:8abdd95139d6

Build system cleanups: reordering, more comments.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 14 Jan 2020 03:01:00 +0200
parents 69a5af2eb1ea
children 71f04d8e791e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2418
8abdd95139d6 Build system cleanups: reordering, more comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 2414
diff changeset
1 ###
8abdd95139d6 Build system cleanups: reordering, more comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 2414
diff changeset
2 ### For Win32/Win64 version cross-compilation via MinGW
8abdd95139d6 Build system cleanups: reordering, more comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 2414
diff changeset
3 ### compiler suite under Linux/Unix
8abdd95139d6 Build system cleanups: reordering, more comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 2414
diff changeset
4 ###
0
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 #
2354
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
6 # This Makefile assumes that you have MinGW installed under /usr
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
7 # the way Debian MinGW packages do. It also assumes that you have
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
8 # built/installed libogg, Tremor, libpng16, SDL2 ad SDL2_ttf under
2418
8abdd95139d6 Build system cleanups: reordering, more comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 2414
diff changeset
9 # __ /usr/local __ (not /usr!) in similar fashion.
2354
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
10 #
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
11 # For differing configurations you will have to either edit this
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
12 # file or alternatively provide make parameters, e.g.
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
13 #
2355
b436ecd76fa0 Change MINGW_PREFIX to BINTOOL_PREFIX.
Matti Hamalainen <ccr@tnsp.org>
parents: 2354
diff changeset
14 # make -f Makefile.cross-mingw MINGW=64 BINTOOL_PREFIX=foo-bar-zoo
2354
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
15 #
1166
f29fa5b6b748 Add dmMemset().
Matti Hamalainen <ccr@tnsp.org>
parents: 1156
diff changeset
16
2350
dbdce9a20d14 Add Makefile variable MINGW which determines which Windows target (x86-32 or 64bit) will be built.
Matti Hamalainen <ccr@tnsp.org>
parents: 1557
diff changeset
17 ifeq ($(MINGW),64)
2355
b436ecd76fa0 Change MINGW_PREFIX to BINTOOL_PREFIX.
Matti Hamalainen <ccr@tnsp.org>
parents: 2354
diff changeset
18 BINTOOL_PREFIX ?= x86_64-w64-mingw32-
2354
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
19 MINGW_SYS_PATH ?= /usr/x86_64-w64-mingw32
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
20 MINGW_LOCAL_PATH ?= /usr/local/x86_64-w64-mingw32
2350
dbdce9a20d14 Add Makefile variable MINGW which determines which Windows target (x86-32 or 64bit) will be built.
Matti Hamalainen <ccr@tnsp.org>
parents: 1557
diff changeset
21 OBJPATH ?= ./obj/win64/
dbdce9a20d14 Add Makefile variable MINGW which determines which Windows target (x86-32 or 64bit) will be built.
Matti Hamalainen <ccr@tnsp.org>
parents: 1557
diff changeset
22 else
2355
b436ecd76fa0 Change MINGW_PREFIX to BINTOOL_PREFIX.
Matti Hamalainen <ccr@tnsp.org>
parents: 2354
diff changeset
23 BINTOOL_PREFIX ?= i686-w64-mingw32-
2354
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
24 MINGW_SYS_PATH ?= /usr/i686-w64-mingw32
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
25 MINGW_LOCAL_PATH ?= /usr/local/i686-w64-mingw32
2350
dbdce9a20d14 Add Makefile variable MINGW which determines which Windows target (x86-32 or 64bit) will be built.
Matti Hamalainen <ccr@tnsp.org>
parents: 1557
diff changeset
26 OBJPATH ?= ./obj/win32/
dbdce9a20d14 Add Makefile variable MINGW which determines which Windows target (x86-32 or 64bit) will be built.
Matti Hamalainen <ccr@tnsp.org>
parents: 1557
diff changeset
27 endif
886
6abb6c25d8ed Reorder for clarity.
Matti Hamalainen <ccr@tnsp.org>
parents: 879
diff changeset
28
877
4a2ed354ab4c Use ?= in the Makefiles to accept preset values.
Matti Hamalainen <ccr@tnsp.org>
parents: 841
diff changeset
29 DMLIB ?= ./
4a2ed354ab4c Use ?= in the Makefiles to accept preset values.
Matti Hamalainen <ccr@tnsp.org>
parents: 841
diff changeset
30 BINPATH ?= ./exe/
2357
21d8eb203e2a s/EXEEXT/BINEXT/g
Matti Hamalainen <ccr@tnsp.org>
parents: 2355
diff changeset
31 BINEXT ?= .exe
2355
b436ecd76fa0 Change MINGW_PREFIX to BINTOOL_PREFIX.
Matti Hamalainen <ccr@tnsp.org>
parents: 2354
diff changeset
32 CC = $(BINTOOL_PREFIX)gcc
b436ecd76fa0 Change MINGW_PREFIX to BINTOOL_PREFIX.
Matti Hamalainen <ccr@tnsp.org>
parents: 2354
diff changeset
33 AR = $(BINTOOL_PREFIX)ar
b436ecd76fa0 Change MINGW_PREFIX to BINTOOL_PREFIX.
Matti Hamalainen <ccr@tnsp.org>
parents: 2354
diff changeset
34 RANLIB = $(BINTOOL_PREFIX)ranlib
1156
622a469932b1 Change direct assignments to ?=, so that those Makefile variables can be
Matti Hamalainen <ccr@tnsp.org>
parents: 1141
diff changeset
35 RM ?= rm
0
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36
2354
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
37 SDL_CFLAGS ?= $(shell $(MINGW_LOCAL_PATH)/bin/sdl2-config --cflags)
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
38 SDL_LDFLAGS ?= $(shell $(MINGW_LOCAL_PATH)/bin/sdl2-config --libs)
424
e88b2993801c Fix build for Win32.
Matti Hamalainen <ccr@tnsp.org>
parents: 112
diff changeset
39
1156
622a469932b1 Change direct assignments to ?=, so that those Makefile variables can be
Matti Hamalainen <ccr@tnsp.org>
parents: 1141
diff changeset
40 SDL_TTF_CFLAGS ?=
1557
5e5f75b45f8d Initial port to SDL2. Many things will not work now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1432
diff changeset
41 SDL_TTF_LDFLAGS ?= -lSDL2_ttf
840
a9d0d35476ae Add flag variables for SDL_ttf.
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
42
2354
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
43 TREMOR_CFLAGS ?= -I$(MINGW_LOCAL_PATH)/include/tremor
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
44 TREMOR_LDFLAGS ?= $(MINGW_LOCAL_PATH)/lib/libvorbisidec.a $(MINGW_LOCAL_PATH)/lib/libogg.a
0
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45
2354
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
46 LIBPNG_CFLAGS ?= -I$(MINGW_LOCAL_PATH)/include
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
47 LIBPNG_LDFLAGS ?= $(MINGW_LOCAL_PATH)/lib/libpng.a
424
e88b2993801c Fix build for Win32.
Matti Hamalainen <ccr@tnsp.org>
parents: 112
diff changeset
48
1156
622a469932b1 Change direct assignments to ?=, so that those Makefile variables can be
Matti Hamalainen <ccr@tnsp.org>
parents: 1141
diff changeset
49 ZLIB_CFLAGS ?=
2354
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
50 #ZLIB_LDFLAGS ?= $(MINGW_LOCAL_PATH)/lib/libz.a
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
51 ZLIB_LDFLAGS ?= $(MINGW_SYS_PATH)/lib/libz.a
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
52
1432
a9516570cc26 Improve build, so that we can build the tools and tests with minimal
Matti Hamalainen <ccr@tnsp.org>
parents: 1398
diff changeset
53 TOOL_LDFLAGS ?= -mconsole -lmingw32
0
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54
1
6e169d87d963 Improve buildsystem to support more flexible builds.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
55 include $(DMLIB)Makefile.gen