Mercurial > hg > dmlib
annotate Makefile.cross-mingw @ 2403:6e86a048a760
Adjust help.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 12 Jan 2020 20:53:35 +0200 |
parents | 21d8eb203e2a |
children | 69a5af2eb1ea |
rev | line source |
---|---|
0 | 1 # |
879 | 2 # For Win32/Win64 version cross-compilation via MinGW |
3 # compiler suite under Linux/Unix | |
0 | 4 # |
2354
289b8ae493ab
A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents:
2350
diff
changeset
|
5 # 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
|
6 # 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
|
7 # built/installed libogg, Tremor, libpng16, SDL2 ad SDL2_ttf under |
289b8ae493ab
A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents:
2350
diff
changeset
|
8 # /usr/local in similar fashion. |
289b8ae493ab
A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents:
2350
diff
changeset
|
9 # |
289b8ae493ab
A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents:
2350
diff
changeset
|
10 # 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
|
11 # 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
|
12 # |
2355
b436ecd76fa0
Change MINGW_PREFIX to BINTOOL_PREFIX.
Matti Hamalainen <ccr@tnsp.org>
parents:
2354
diff
changeset
|
13 # 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
|
14 # |
1166 | 15 |
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
|
16 ifeq ($(MINGW),64) |
2355
b436ecd76fa0
Change MINGW_PREFIX to BINTOOL_PREFIX.
Matti Hamalainen <ccr@tnsp.org>
parents:
2354
diff
changeset
|
17 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
|
18 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
|
19 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
|
20 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
|
21 else |
2355
b436ecd76fa0
Change MINGW_PREFIX to BINTOOL_PREFIX.
Matti Hamalainen <ccr@tnsp.org>
parents:
2354
diff
changeset
|
22 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
|
23 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
|
24 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
|
25 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
|
26 endif |
886 | 27 |
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
|
28 DM_CFLAGS += -DDM_HAVE_MEMSET=1 |
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 | 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 | 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 | 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 | 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 | 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 |
424 | 53 |
1432
a9516570cc26
Improve build, so that we can build the tools and tests with minimal
Matti Hamalainen <ccr@tnsp.org>
parents:
1398
diff
changeset
|
54 TOOL_LDFLAGS ?= -mconsole -lmingw32 |
0 | 55 |
1
6e169d87d963
Improve buildsystem to support more flexible builds.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
56 include $(DMLIB)Makefile.gen |