Mercurial > hg > dmlib
annotate Makefile.cross-mingw @ 2350:dbdce9a20d14
Add Makefile variable MINGW which determines which Windows target (x86-32 or 64bit) will be built.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 05 Dec 2019 00:19:50 +0200 |
parents | 5e5f75b45f8d |
children | 289b8ae493ab |
rev | line source |
---|---|
0 | 1 # |
879 | 2 # For Win32/Win64 version cross-compilation via MinGW |
3 # compiler suite under Linux/Unix | |
0 | 4 # |
1166 | 5 |
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
|
6 ifeq ($(MINGW),64) |
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
|
7 MINGW_PREFIX ?= x86_64-w64-mingw32- |
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
|
8 MINGW_PATH ?= /usr/x86_64-w64-mingw32 |
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
|
9 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
|
10 else |
886 | 11 MINGW_PREFIX ?= i686-w64-mingw32- |
12 MINGW_PATH ?= /usr/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
|
13 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
|
14 endif |
886 | 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 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
|
17 DMLIB ?= ./ |
4a2ed354ab4c
Use ?= in the Makefiles to accept preset values.
Matti Hamalainen <ccr@tnsp.org>
parents:
841
diff
changeset
|
18 BINPATH ?= ./exe/ |
4a2ed354ab4c
Use ?= in the Makefiles to accept preset values.
Matti Hamalainen <ccr@tnsp.org>
parents:
841
diff
changeset
|
19 EXEEXT ?= .exe |
1168
3c4c270f51bc
Oops, these build system changes didn't fly. Often CC is set to "cc" by
Matti Hamalainen <ccr@tnsp.org>
parents:
1166
diff
changeset
|
20 CC = $(MINGW_PREFIX)gcc |
3c4c270f51bc
Oops, these build system changes didn't fly. Often CC is set to "cc" by
Matti Hamalainen <ccr@tnsp.org>
parents:
1166
diff
changeset
|
21 AR = $(MINGW_PREFIX)ar |
3c4c270f51bc
Oops, these build system changes didn't fly. Often CC is set to "cc" by
Matti Hamalainen <ccr@tnsp.org>
parents:
1166
diff
changeset
|
22 RANLIB = $(MINGW_PREFIX)ranlib |
1156
622a469932b1
Change direct assignments to ?=, so that those Makefile variables can be
Matti Hamalainen <ccr@tnsp.org>
parents:
1141
diff
changeset
|
23 RM ?= rm |
0 | 24 |
1557
5e5f75b45f8d
Initial port to SDL2. Many things will not work now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1432
diff
changeset
|
25 SDL_CFLAGS ?= $(shell $(MINGW_PATH)/bin/sdl2-config --cflags) |
5e5f75b45f8d
Initial port to SDL2. Many things will not work now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1432
diff
changeset
|
26 SDL_LDFLAGS ?= $(shell $(MINGW_PATH)/bin/sdl2-config --libs) |
424 | 27 |
1156
622a469932b1
Change direct assignments to ?=, so that those Makefile variables can be
Matti Hamalainen <ccr@tnsp.org>
parents:
1141
diff
changeset
|
28 SDL_TTF_CFLAGS ?= |
1557
5e5f75b45f8d
Initial port to SDL2. Many things will not work now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1432
diff
changeset
|
29 SDL_TTF_LDFLAGS ?= -lSDL2_ttf |
840
a9d0d35476ae
Add flag variables for SDL_ttf.
Matti Hamalainen <ccr@tnsp.org>
parents:
424
diff
changeset
|
30 |
1156
622a469932b1
Change direct assignments to ?=, so that those Makefile variables can be
Matti Hamalainen <ccr@tnsp.org>
parents:
1141
diff
changeset
|
31 TREMOR_CFLAGS ?= -I$(MINGW_PATH)/include/tremor |
1398
2791f790497d
Use $(shell ..) instead of backtics.
Matti Hamalainen <ccr@tnsp.org>
parents:
1168
diff
changeset
|
32 TREMOR_LDFLAGS ?= $(MINGW_PATH)/lib/libvorbisidec.a $(MINGW_PATH)/lib/libogg.a |
0 | 33 |
1156
622a469932b1
Change direct assignments to ?=, so that those Makefile variables can be
Matti Hamalainen <ccr@tnsp.org>
parents:
1141
diff
changeset
|
34 LIBPNG_CFLAGS ?= -I$(MINGW_PATH)/include |
622a469932b1
Change direct assignments to ?=, so that those Makefile variables can be
Matti Hamalainen <ccr@tnsp.org>
parents:
1141
diff
changeset
|
35 LIBPNG_LDFLAGS ?= $(MINGW_PATH)/lib/libpng.a |
424 | 36 |
1156
622a469932b1
Change direct assignments to ?=, so that those Makefile variables can be
Matti Hamalainen <ccr@tnsp.org>
parents:
1141
diff
changeset
|
37 ZLIB_CFLAGS ?= |
622a469932b1
Change direct assignments to ?=, so that those Makefile variables can be
Matti Hamalainen <ccr@tnsp.org>
parents:
1141
diff
changeset
|
38 ZLIB_LDFLAGS ?= $(MINGW_PATH)/lib/libz.a |
424 | 39 |
1432
a9516570cc26
Improve build, so that we can build the tools and tests with minimal
Matti Hamalainen <ccr@tnsp.org>
parents:
1398
diff
changeset
|
40 TOOL_LDFLAGS ?= -mconsole -lmingw32 |
0 | 41 |
1
6e169d87d963
Improve buildsystem to support more flexible builds.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
42 include $(DMLIB)Makefile.gen |