annotate Makefile.cross-mingw @ 2547:71f04d8e791e

Implement a simple shell script for finding C64 chargen ROM image file (if any can be found) for *NIX builds and note the existence of the DM_DEF_CHARGEN define in MinGW Makefile with an example.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 18 Oct 2021 16:58:02 +0300
parents 8abdd95139d6
children 8ab923fe23ef
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
2547
71f04d8e791e Implement a simple shell script for finding C64 chargen ROM image file
Matti Hamalainen <ccr@tnsp.org>
parents: 2418
diff changeset
17 # NOTE! If you want to define the default path for C64 chargen
71f04d8e791e Implement a simple shell script for finding C64 chargen ROM image file
Matti Hamalainen <ccr@tnsp.org>
parents: 2418
diff changeset
18 # ROM image file, you can set it with this define. Do take note of
71f04d8e791e Implement a simple shell script for finding C64 chargen ROM image file
Matti Hamalainen <ccr@tnsp.org>
parents: 2418
diff changeset
19 # the somewhat peculiar quotation and escape of backlash '\', these
71f04d8e791e Implement a simple shell script for finding C64 chargen ROM image file
Matti Hamalainen <ccr@tnsp.org>
parents: 2418
diff changeset
20 # are REQUIRED.
71f04d8e791e Implement a simple shell script for finding C64 chargen ROM image file
Matti Hamalainen <ccr@tnsp.org>
parents: 2418
diff changeset
21 CFLAGS += -DDM_DEF_CHARGEN='"C:\\VICE-3.5\\C64\\chargen"'
71f04d8e791e Implement a simple shell script for finding C64 chargen ROM image file
Matti Hamalainen <ccr@tnsp.org>
parents: 2418
diff changeset
22
71f04d8e791e Implement a simple shell script for finding C64 chargen ROM image file
Matti Hamalainen <ccr@tnsp.org>
parents: 2418
diff changeset
23
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
24 ifeq ($(MINGW),64)
2355
b436ecd76fa0 Change MINGW_PREFIX to BINTOOL_PREFIX.
Matti Hamalainen <ccr@tnsp.org>
parents: 2354
diff changeset
25 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
26 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
27 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
28 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
29 else
2355
b436ecd76fa0 Change MINGW_PREFIX to BINTOOL_PREFIX.
Matti Hamalainen <ccr@tnsp.org>
parents: 2354
diff changeset
30 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
31 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
32 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
33 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
34 endif
886
6abb6c25d8ed Reorder for clarity.
Matti Hamalainen <ccr@tnsp.org>
parents: 879
diff changeset
35
877
4a2ed354ab4c Use ?= in the Makefiles to accept preset values.
Matti Hamalainen <ccr@tnsp.org>
parents: 841
diff changeset
36 DMLIB ?= ./
4a2ed354ab4c Use ?= in the Makefiles to accept preset values.
Matti Hamalainen <ccr@tnsp.org>
parents: 841
diff changeset
37 BINPATH ?= ./exe/
2357
21d8eb203e2a s/EXEEXT/BINEXT/g
Matti Hamalainen <ccr@tnsp.org>
parents: 2355
diff changeset
38 BINEXT ?= .exe
2355
b436ecd76fa0 Change MINGW_PREFIX to BINTOOL_PREFIX.
Matti Hamalainen <ccr@tnsp.org>
parents: 2354
diff changeset
39 CC = $(BINTOOL_PREFIX)gcc
b436ecd76fa0 Change MINGW_PREFIX to BINTOOL_PREFIX.
Matti Hamalainen <ccr@tnsp.org>
parents: 2354
diff changeset
40 AR = $(BINTOOL_PREFIX)ar
b436ecd76fa0 Change MINGW_PREFIX to BINTOOL_PREFIX.
Matti Hamalainen <ccr@tnsp.org>
parents: 2354
diff changeset
41 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
42 RM ?= rm
0
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43
2354
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
44 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
45 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
46
1156
622a469932b1 Change direct assignments to ?=, so that those Makefile variables can be
Matti Hamalainen <ccr@tnsp.org>
parents: 1141
diff changeset
47 SDL_TTF_CFLAGS ?=
1557
5e5f75b45f8d Initial port to SDL2. Many things will not work now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1432
diff changeset
48 SDL_TTF_LDFLAGS ?= -lSDL2_ttf
840
a9d0d35476ae Add flag variables for SDL_ttf.
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
49
2354
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
50 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
51 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
52
2354
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
53 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
54 LIBPNG_LDFLAGS ?= $(MINGW_LOCAL_PATH)/lib/libpng.a
424
e88b2993801c Fix build for Win32.
Matti Hamalainen <ccr@tnsp.org>
parents: 112
diff changeset
55
1156
622a469932b1 Change direct assignments to ?=, so that those Makefile variables can be
Matti Hamalainen <ccr@tnsp.org>
parents: 1141
diff changeset
56 ZLIB_CFLAGS ?=
2354
289b8ae493ab A bit more work on the MinGW 32/64bit build stuff.
Matti Hamalainen <ccr@tnsp.org>
parents: 2350
diff changeset
57 #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
58 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
59
1432
a9516570cc26 Improve build, so that we can build the tools and tests with minimal
Matti Hamalainen <ccr@tnsp.org>
parents: 1398
diff changeset
60 TOOL_LDFLAGS ?= -mconsole -lmingw32
0
32250b436bca Initial re-import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
61
1
6e169d87d963 Improve buildsystem to support more flexible builds.
Matti Hamalainen <ccr@tnsp.org>
parents: 0
diff changeset
62 include $(DMLIB)Makefile.gen