forked from amadvance/advancemame
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.usr
389 lines (334 loc) · 9.2 KB
/
Makefile.usr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
#############################################################################
# Manual user configuration
#
# If you use the ./configure script you don't need to edit this file.
#
# Installation prefix (only for Unix):
prefix=/usr/local
# Uncomment the host operating system.
# The available choices are linux, dos, windows.
#
# The unix host uses:
# SVGALIB, Frame Buffer, SDL for the video
# tty, SDL for the text
# ALSA, OSS, SDL for the sound
# SVGALIB, KEVENT, KRAW, SDL for the keyboard
# SVGALIB, JEVENT, JRAW, SDL for the joystick
# SVGALIB, MEVENT, MRAW, SDL for the mouse
# pthread for the Multiprocessor support
#
# The dos host uses:
# SVGALINE, VBELINE, VGALINE, VBE for the video
# VGALINE for the text
# SEAL, Allegro and VSYNC for the sound
# Allegro for the keyboard
# Allegro for the joystick
# Allegro for the mouse
# none for the Multiprocessor support (no Multiprocessor support)
#
# The windows host uses:
# SVGAWIN, SDL for the video
# SDL for the text
# SDL for the sound
# SDL for the keyboard
# JLGRAWINPUT, SDL for the joystick
# MRAWINPUT, MCPN, SDL for the mouse
# none for the Multiprocessor support (no Multiprocessor support)
#
#CONF_HOST=linux
#CONF_HOST=dos
#CONF_HOST=windows
# Uncomment and set to "no" to disable some libraries:
#CONF_LIB_DIRECT=yes
#CONF_LIB_SVGALIB=no
#CONF_LIB_SVGAWIN=no
#CONF_LIB_SDL=yes
#CONF_LIB_FREETYPE=yes
#CONF_LIB_FB=yes
#CONF_LIB_ALSA=yes
#CONF_LIB_OSS=yes
#CONF_LIB_PTHREAD=yes
#CONF_LIB_SLANG=yes
#CONF_LIB_NCURSES=yes
#CONF_LIB_KRAW=yes
#CONF_LIB_JRAW=yes
#CONF_LIB_MRAW=yes
#CONF_LIB_KEVENT=yes
#CONF_LIB_JEVENT=yes
#CONF_LIB_MEVENT=yes
#CONF_LIB_MRAWINPUT=yes
#CONF_LIB_JLGRAWINPUT=yes
#CONF_LIB_MCPN=yes
# Select the optimization flags: (optimized build for Pentium by default)
# Optimized build for Pentium IV
#CONF_CFLAGS_OPT=-O2 -fomit-frame-pointer -march=pentium4 -Wall -Wno-sign-compare -Wno-unused
# Optimized build for K6, K6-II, K6-III
#CONF_CFLAGS_OPT=-O2 -fomit-frame-pointer -march=k6 -Wall -Wno-sign-compare -Wno-unused
# Optimized build for Duron, Athlon, Athlon XP, Athlon MP
#CONF_CFLAGS_OPT=-O2 -fomit-frame-pointer -march=athlon -Wall -Wno-sign-compare -Wno-unused
# Select the optimization linker flags: (optimized link by default)
# Optimized build
#CONF_LDFLAGS=-s
# Uncomment and set to "yes" to compile the MAME debugger (default no):
#CONF_DEBUGGER=no
# Uncomment and set to "yes" to enable the debug code (default no):
#CONF_DEBUG=no
#############################################################################
# Completing manual configuration with defaults
#
# Automatic BUILD environment detection
ifndef CONF_BUILD
UNAME := $(shell uname)
ifneq (,$(findstring Linux,$(UNAME)))
CONF_BUILD=linux
else
ifneq (,$(findstring DOS,$(UNAME)))
CONF_BUILD=dos
else
CONF_BUILD=windows
endif
endif
endif
# Automatic HOST environment detection
ifndef CONF_HOST
CONF_HOST=$(CONF_BUILD)
endif
# Automatic libraries and other options setting
ifndef CONF_LIB_ZLIB
ifeq ($(CONF_HOST),dos)
CONF_LIB_ZLIB=no
else
CONF_LIB_ZLIB=yes
endif
endif
ifndef CONF_LIB_EXPAT
ifeq ($(CONF_HOST),dos)
CONF_LIB_EXPAT=no
else
CONF_LIB_EXPAT=yes
endif
endif
ifndef CONF_LIB_DIRECT
ifeq ($(CONF_HOST),windows)
CONF_LIB_DIRECT=no
else
CONF_LIB_DIRECT=yes
endif
endif
ifndef CONF_LIB_SVGALIB
CONF_LIB_SVGALIB=no
endif
ifndef CONF_LIB_FB
CONF_LIB_FB=yes
endif
ifndef CONF_LIB_ALSA
CONF_LIB_ALSA=yes
endif
ifndef CONF_LIB_OSS
CONF_LIB_OSS=no
endif
ifndef CONF_LIB_SDL
CONF_LIB_SDL=yes
endif
ifndef CONF_LIB_FREETYPE
CONF_LIB_FREETYPE=yes
endif
ifndef CONF_LIB_SVGAWIN
CONF_LIB_SVGAWIN=no
endif
ifndef CONF_LIB_PTHREAD
CONF_LIB_PTHREAD=yes
endif
ifndef CONF_LIB_SLANG
CONF_LIB_SLANG=yes
endif
ifndef CONF_LIB_NCURSES
CONF_LIB_NCURSES=yes
endif
ifndef CONF_LIB_KRAW
CONF_LIB_KRAW=yes
endif
ifndef CONF_LIB_JRAW
CONF_LIB_JRAW=yes
endif
ifndef CONF_LIB_MRAW
CONF_LIB_MRAW=yes
endif
ifndef CONF_LIB_KEVENT
CONF_LIB_KEVENT=yes
endif
ifndef CONF_LIB_JEVENT
CONF_LIB_JEVENT=yes
endif
ifndef CONF_LIB_MEVENT
CONF_LIB_MEVENT=yes
endif
ifndef CONF_LIB_MRAWINPUT
CONF_LIB_MRAWINPUT=yes
endif
ifndef CONF_LIB_JLGRAWINPUT
CONF_LIB_JLGRAWINPUT=yes
endif
ifndef CONF_LIB_MCPN
CONF_LIB_MCPN=yes
endif
ifndef CONF_CFLAGS_ARCH
CONF_CFLAGS_ARCH = -DUSE_LSB -DUSE_ASM_INLINE -DUSE_ASM_EMUMIPS3
endif
ifndef CONF_CFLAGS_OPT
CONF_CFLAGS_OPT = -march=i686 -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-strict-overflow -fno-merge-constants -Wall -Wno-sign-compare -Wno-unused
endif
ifndef CONF_LDFLAGS
CONF_LDFLAGS=-s
endif
ifndef CONF_LIBS
CONF_LIBS=-lm
endif
ifndef CONF_DEBUGGER
CONF_DEBUGGER=no
endif
ifndef CONF_DEBUG
CONF_DEBUG=no
endif
ifndef CONF_DEFS
CONF_DEFS=
endif
srcdir=.
datadir=${prefix}/share
sysconfdir=${prefix}/etc
bindir=${prefix}/bin
mandir=${prefix}/man
docdir=${prefix}/share/doc
#############################################################################
# Extra configuration common for ./configure and manual
#
# Enable the creation of the map files
ifndef CONF_MAP
CONF_MAP=no
endif
# Name of the architecture. Used in the distribution file names.
ifndef CONF_ARCH
CONF_ARCH=blend
endif
#############################################################################
# Tools configuration for manual
#
MD = -@mkdir -p
RM = @rm -f
ECHO = @echo
# No installation with the manual configuration
INSTALL = false
ifeq ($(CONF_HOST),linux)
LN_S = @ln -s
EXE =
ASMFLAGS = -f elf
CFLAGS_FOR_BUILD += -O0 -DUSE_COMPILER_GNUC -DUSE_OBJ_ELF -DUSE_OS_UNIX
endif
ifeq ($(CONF_HOST),dos)
LN_S = @cp -p
EXE = .exe
ASMFLAGS = -f coff
CFLAGS_FOR_BUILD += -O0 -DUSE_COMPILER_GNUC -DUSE_OBJ_COFF -DUSE_OS_DOS
endif
ifeq ($(CONF_HOST),windows)
LN_S = @cp -p
EXE = .exe
ASMFLAGS = -f coff
CFLAGS_FOR_BUILD += -O0 -DUSE_COMPILER_GNUC -DUSE_OBJ_COFF -DUSE_OS_WINDOWS
endif
ifeq ($(CONF_BUILD),linux)
ASM = @nasm
EXE_FOR_BUILD =
CC_FOR_BUILD = @gcc
LD_FOR_BUILD = @gcc
CXX_FOR_BUILD = @g++
LDXX_FOR_BUILD = @g++
ifeq ($(CONF_HOST),linux)
AR = @ar
CC = @gcc
CXX = @g++
LD = @gcc
LDXX = @g++
SDLCFLAGS = $(shell sdl-config --cflags)
SDLLIBS = $(shell sdl-config --libs)
FREETYPECFLAGS = $(shell freetype-config --cflags)
FREETYPELIBS = $(shell freetype-config --libs)
NCURSESCFLAGS = $(shell ncurses6-config --cflags)
NCURSESLIBS = $(shell ncurses6-config --libs)
endif
ifeq ($(CONF_HOST),dos)
# Probably you need to changes these to cross compile:
CROSSTARGET = i586-pc-msdosdjgpp
CROSSDIR = /usr/local/djgpp
AR = @$(CROSSDIR)/bin/$(CROSSTARGET)-ar
CC = @$(CROSSDIR)/bin/$(CROSSTARGET)-gcc
CXX = @$(CROSSDIR)/bin/$(CROSSTARGET)-g++
LD = @$(CROSSDIR)/bin/$(CROSSTARGET)-gcc
LDXX = @$(CROSSDIR)/bin/$(CROSSTARGET)-g++
FREETYPECFLAGS = -I$(CROSSDIR)/$(CROSSTARGET)/include/freetype2 -I$(CROSSDIR)/include
FREETYPELIBS = -L$(CROSSDIR)/lib -lfreetype -lz
endif
ifeq ($(CONF_HOST),windows)
# Probably you need to changes these to cross compile:
CROSSTARGET = i686-w64-mingw32.static
CROSSDIR = /usr/local/mxe/usr
AR = @$(CROSSDIR)/bin/$(CROSSTARGET)-ar
CC = @$(CROSSDIR)/bin/$(CROSSTARGET)-gcc
CXX = @$(CROSSDIR)/bin/$(CROSSTARGET)-g++
LD = @$(CROSSDIR)/bin/$(CROSSTARGET)-gcc
LDXX = @$(CROSSDIR)/bin/$(CROSSTARGET)-g++
RC = @$(CROSSDIR)/bin/$(CROSSTARGET)-windres
# SDL1
#SDLCFLAGS = -I$(CROSSDIR)/$(CROSSTARGET)/include/SDL -I$(CROSSDIR)/$(CROSSTARGET)/include
#SDLLIBS = -L$(CROSSDIR)/$(CROSSTARGET)/lib -lmingw32 -lSDL -lwinmm -mwindows -liconv -lm -luser32 -lgdi32 -lwinmm -ldxguid
# SDL2
SDLCFLAGS = -I$(CROSSDIR)/$(CROSSTARGET)/include/SDL2 -Dmain=SDL_main
SDLLIBS = -L$(CROSSDIR)/$(CROSSTARGET)/lib -lmingw32 -lSDL2main -lSDL2 -mwindows -Wl,--no-undefined -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -static-libgcc
FREETYPECFLAGS = -I$(CROSSDIR)/$(CROSSTARGET)/include/freetype2
FREETYPELIBS = -L$(CROSSDIR)/$(CROSSTARGET)/lib -lfreetype -lz -lbz2 -lpng16 -lz -lharfbuzz -lcairo -lgobject-2.0 -lfontconfig -lglib-2.0 -lusp10 -lmsimg32 -lgdi32 -lpixman-1 -L/usr/local/mxe/usr/i686-w64-mingw32.static/lib/../lib -lffi -lexpat -lfreetype -lbz2 -lpng16 -lz -lws2_32 -lole32 -lwinmm -lshlwapi -L/usr/local/mxe/usr/i686-w64-mingw32.static/lib -lpcre -lintl -liconv -lharfbuzz_too -lglib-2.0 -lws2_32 -lole32 -lwinmm -lshlwapi -lpcre -lintl -liconv
endif
endif
ifeq ($(CONF_BUILD),dos)
ASM = @nasm
EXE_FOR_BUILD = .exe
CC_FOR_BUILD = @gcc
LD_FOR_BUILD = @gcc
CXX_FOR_BUILD = @gxx
LDXX_FOR_BUILD = @gxx
AR = @ar
CC = @gcc
CXX = @gxx
LD = @gcc
LDXX = @gxx
FREETYPECFLAGS = "-IC:\DJGPP\INCLUDE" "-IC:\DJGPP\INCLUDE\FREETYPE2"
FREETYPELIBS = "-LC:\DJGPP\LIB" -lfreetype -lz
endif
ifeq ($(CONF_BUILD),windows)
ASM = @nasmw
EXE_FOR_BUILD = .exe
CC_FOR_BUILD = @gcc
LD_FOR_BUILD = @gcc "-LC:\MINGW\LIB"
CXX_FOR_BUILD = @g++
LDXX_FOR_BUILD = @g++ "-LC:\MINGW\LIB"
AR = @ar
CC = @gcc
CXX = @g++
LD = @gcc
LDXX = @g++
RC = @windres
# The "" are required, otherwise the backslash are removed
SDLCFLAGS = "-IC:\MINGW\INCLUDE" "-IC:\MINGW\INCLUDE\SDL"
SDLLIBS = "-LC:\MINGW\LIB" -lmingw32 -lSDL -mwindows
FREETYPECFLAGS = "-IC:\MINGW\INCLUDE" "-IC:\MINGW\INCLUDE\FREETYPE2"
FREETYPELIBS = -lfreetype -lz
endif
# No installation with the manual configuration
INSTALL_PROGRAM_DIR = false
INSTALL_MAN_DIR = false
INSTALL_DATA_DIR = false
INSTALL_PROGRAM = false
INSTALL_MAN = false
INSTALL_DATA = false
#############################################################################
# Root makefile
include root.mak