forked from libretro/fbalpha
-
Notifications
You must be signed in to change notification settings - Fork 11
/
makefile.libretro_common
331 lines (306 loc) · 9.4 KB
/
makefile.libretro_common
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
FBA_BURN_DIR := $(MAIN_FBA_DIR)/burn
FBA_BURN_DRIVERS_DIR := $(MAIN_FBA_DIR)/burn/drv
FBA_BURNER_DIR := $(MAIN_FBA_DIR)/burner
FBA_CPU_DIR := $(MAIN_FBA_DIR)/cpu
FBA_GENERATED_DIR := $(MAIN_FBA_DIR)/dep/generated
FBA_INTERFACE_DIR := $(MAIN_FBA_DIR)/intf
FBA_LIB_DIR := $(MAIN_FBA_DIR)/dep/libs
FBA_SCRIPTS_DIR := $(MAIN_FBA_DIR)/dep/scripts
LIBRETRO_DIR := $(FBA_BURNER_DIR)/libretro
LIBRETRO_COMM_DIR := $(LIBRETRO_DIR)/libretro-common
ATARI_DIR := $(FBA_BURN_DRIVERS_DIR)/atari
CAPCOM_DIR := $(FBA_BURN_DRIVERS_DIR)/capcom
CPS3_DIR := $(FBA_BURN_DRIVERS_DIR)/cps3
GALAXIAN_DIR := $(FBA_BURN_DRIVERS_DIR)/galaxian
NEOGEO_DIR := $(FBA_BURN_DRIVERS_DIR)/neogeo
PGM_DIR := $(FBA_BURN_DRIVERS_DIR)/pgm
SNES_DIR := $(FBA_BURN_DRIVERS_DIR)/snes
SMS_DIR := $(FBA_BURN_DRIVERS_DIR)/sms
MD_DIR := $(FBA_BURN_DRIVERS_DIR)/megadrive
MIDWAY_DIR := $(FBA_BURN_DRIVERS_DIR)/midway
PCE_DIR := $(FBA_BURN_DRIVERS_DIR)/pce
M68K_DIR := $(FBA_CPU_DIR)/m68k
MIPS3_DIR := $(FBA_CPU_DIR)/mips3
MIPS3_X64_DYNAREC_DIR := $(FBA_CPU_DIR)/mips3/x64
TMS34010_DIR := $(FBA_CPU_DIR)/tms34010
ADSP2100_DIR := $(FBA_CPU_DIR)/adsp2100
BURN_BLACKLIST := $(FBA_CPU_DIR)/arm7/arm7exec.c \
$(FBA_CPU_DIR)/arm7/arm7core.c \
$(FBA_CPU_DIR)/adsp2100/2100ops.c \
$(FBA_CPU_DIR)/hd6309/6309tbl.c \
$(FBA_CPU_DIR)/hd6309/6309ops.c \
$(FBA_CPU_DIR)/konami/konamtbl.c \
$(FBA_CPU_DIR)/konami/konamops.c \
$(FBA_CPU_DIR)/m68k/m68k_in.c \
$(FBA_CPU_DIR)/m6800/6800ops.c \
$(FBA_CPU_DIR)/m6800/6800tbl.c \
$(FBA_CPU_DIR)/m6805/6805ops.c \
$(FBA_CPU_DIR)/m6809/6809ops.c \
$(FBA_CPU_DIR)/m6809/6809tbl.c \
$(FBA_CPU_DIR)/sh2/mksh2.cpp \
$(FBA_CPU_DIR)/sh2/mksh2-x86.cpp \
$(FBA_CPU_DIR)/m68k/m68kmake.c \
$(FBA_CPU_DIR)/m68k/m68kfpu.c \
$(FBA_BURNER_DIR)/wave_writer.cpp \
$(FBA_CPU_DIR)/m68k/m68kdasm.c \
$(FBA_LIBRETRO_DIR)/menu.cpp \
$(FBA_CPU_DIR)/sh2/mksh2.cpp \
$(FBA_BURNER_DIR)/sshot.cpp \
$(FBA_BURNER_DIR)/conc.cpp \
$(FBA_BURNER_DIR)/cong.cpp \
$(FBA_BURNER_DIR)/image.cpp \
$(FBA_BURNER_DIR)/misc.cpp \
$(FBA_BURNER_DIR)/state.cpp \
$(FBA_BURNER_DIR)/gami.cpp \
$(FBA_BURNER_DIR)/gamc.cpp \
$(FBA_CPU_DIR)/h6280/tblh6280.c \
$(FBA_CPU_DIR)/m6502/t65sc02.c \
$(FBA_CPU_DIR)/m6502/t65c02.c \
$(FBA_CPU_DIR)/m6502/tdeco16.c \
$(FBA_CPU_DIR)/m6502/tn2a03.c \
$(FBA_CPU_DIR)/m6502/t6502.c \
$(FBA_CPU_DIR)/nec/v25sfr.c \
$(FBA_CPU_DIR)/nec/v25instr.c \
$(FBA_CPU_DIR)/nec/necinstr.c \
$(FBA_CPU_DIR)/mips3/mips3_dasm.cpp \
$(FBA_CPU_DIR)/tms34010/tms34010_dasm.cpp \
$(FBA_CPU_DIR)/tms34010/tms34010_newdasm.cpp \
$(FBA_BURN_DIR)/drv/capcom/ctv_make.cpp \
$(FBA_BURN_DIR)/drv/pgm/pgm_sprite_create.cpp \
$(FBA_INTERFACE_DIR)/audio/aud_interface.cpp \
$(FBA_CPU_DIR)/i8051/mcs51ops.c \
$(FBA_CPU_DIR)/upd7810/7810ops.c \
$(FBA_CPU_DIR)/upd7810/7810tbl.c \
$(FBA_CPU_DIR)/v60/op12.c \
$(FBA_CPU_DIR)/v60/am.c \
$(FBA_CPU_DIR)/v60/am1.c \
$(FBA_CPU_DIR)/v60/am2.c \
$(FBA_CPU_DIR)/v60/op7a.c \
$(FBA_CPU_DIR)/v60/am3.c \
$(FBA_CPU_DIR)/v60/op2.c \
$(FBA_CPU_DIR)/v60/op4.c \
$(FBA_CPU_DIR)/v60/op6.c \
$(FBA_CPU_DIR)/v60/op3.c \
$(FBA_CPU_DIR)/v60/op5.c \
$(FBA_CPU_DIR)/v60/optable.c \
$(FBA_CPU_DIR)/v60/v60mem.c \
$(FBA_CPU_DIR)/v60/v60d.c \
$(FBA_CPU_DIR)/i8x41/8x41dasm.c \
$(FBA_CPU_DIR)/z180/z180xy.c \
$(FBA_CPU_DIR)/z180/z180fd.c \
$(FBA_CPU_DIR)/z180/z180op.c \
$(FBA_CPU_DIR)/z180/z180ed.c \
$(FBA_CPU_DIR)/z180/z180dd.c \
$(FBA_CPU_DIR)/z180/z180cb.c \
$(ATARI_DIR)/WHATSNEW.txt.cpp
ifeq ($(AUTOGEN_DATS), 0)
BURN_BLACKLIST += $(FBA_BURNER_DIR)/dat.cpp
else
FBA_DEFINES += -DAUTOGEN_DATS
endif
ifeq ($(NO_MD), 1)
MD_DIR :=
endif
ifeq ($(NO_PCE), 1)
PCE_DIR :=
endif
ifeq ($(NO_SMS), 1)
SMS_DIR :=
endif
ifeq ($(NO_CAPCOM), 1)
CAPCOM_DIR :=
endif
ifeq ($(NO_NEOGEO), 1)
NEOGEO_DIR :=
endif
FBA_BURN_DRIVERS_DIRS := $(CAPCOM_DIR) \
$(ATARI_DIR) \
$(FBA_BURN_DRIVERS_DIR)/cave \
$(FBA_BURN_DRIVERS_DIR)/coleco \
$(CPS3_DIR) \
$(FBA_BURN_DRIVERS_DIR)/dataeast \
$(GALAXIAN_DIR) \
$(FBA_BURN_DRIVERS_DIR)/irem \
$(FBA_BURN_DRIVERS_DIR)/konami \
$(MD_DIR) \
$(MIDWAY_DIR) \
$(FBA_BURN_DRIVERS_DIR)/msx \
$(NEOGEO_DIR) \
$(PCE_DIR) \
$(PGM_DIR) \
$(FBA_BURN_DRIVERS_DIR)/pre90s \
$(FBA_BURN_DRIVERS_DIR)/psikyo \
$(FBA_BURN_DRIVERS_DIR)/pst90s \
$(FBA_BURN_DRIVERS_DIR)/sega \
$(FBA_BURN_DRIVERS_DIR)/sg1000 \
$(SMS_DIR) \
$(SNES_DIR) \
$(FBA_BURN_DRIVERS_DIR)/spectrum \
$(FBA_BURN_DRIVERS_DIR)/taito \
$(FBA_BURN_DRIVERS_DIR)/toaplan \
$(FBA_BURN_DRIVERS_DIR)
FBA_BURN_DIRS := $(FBA_BURN_DIR) \
$(FBA_BURN_DIR)/devices \
$(FBA_BURN_DIR)/snd \
$(FBA_BURN_DRIVERS_DIRS)
FBA_CPU_DIRS := $(FBA_CPU_DIR) \
$(ADSP2100_DIR) \
$(FBA_CPU_DIR)/arm \
$(FBA_CPU_DIR)/arm7 \
$(FBA_CPU_DIR)/h6280 \
$(FBA_CPU_DIR)/hd6309 \
$(FBA_CPU_DIR)/i8x41 \
$(FBA_CPU_DIR)/i8039 \
$(FBA_CPU_DIR)/i8051 \
$(FBA_CPU_DIR)/konami \
$(FBA_CPU_DIR)/m6502 \
$(FBA_CPU_DIR)/m6800 \
$(FBA_CPU_DIR)/m6805 \
$(FBA_CPU_DIR)/m6809 \
$(M68K_DIR) \
$(MIPS3_DIR) \
$(FBA_CPU_DIR)/nec \
$(FBA_CPU_DIR)/pic16c5x \
$(FBA_CPU_DIR)/s2650 \
$(FBA_CPU_DIR)/sh2 \
$(FBA_CPU_DIR)/tlcs90 \
$(FBA_CPU_DIR)/tms32010 \
$(TMS34010_DIR) \
$(FBA_CPU_DIR)/upd7725 \
$(FBA_CPU_DIR)/upd7810 \
$(FBA_CPU_DIR)/v60 \
$(FBA_CPU_DIR)/z80 \
$(FBA_CPU_DIR)/z180
FBA_INTERFACE_DIRS := $(FBA_INTERFACE_DIR)/audio
FBA_SRC_DIRS := $(FBA_BURNER_DIR) $(FBA_BURN_DIRS) $(FBA_CPU_DIRS) $(FBA_BURNER_DIRS) $(FBA_INTERFACE_DIRS)
ifneq ($(STATIC_LINKING), 1)
SOURCES_C += $(LIBRETRO_COMM_DIR)/file/file_path.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.c \
$(LIBRETRO_COMM_DIR)/compat/compat_posix_string.c \
$(LIBRETRO_COMM_DIR)/compat/compat_strcasestr.c \
$(LIBRETRO_COMM_DIR)/compat/compat_strl.c \
$(LIBRETRO_COMM_DIR)/compat/fopen_utf8.c \
$(LIBRETRO_COMM_DIR)/string/stdstring.c \
$(LIBRETRO_COMM_DIR)/streams/file_stream.c \
$(LIBRETRO_COMM_DIR)/streams/file_stream_transforms.c \
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.c \
$(LIBRETRO_COMM_DIR)/features/features_cpu.c \
$(LIBRETRO_COMM_DIR)/file/config_file.c \
$(LIBRETRO_COMM_DIR)/file/config_file_userdata.c \
$(LIBRETRO_COMM_DIR)/lists/string_list.c \
$(LIBRETRO_COMM_DIR)/memmap/memalign.c
endif
INCLUDE_DIRS := $(FBA_BURNER_DIR)/win32 \
$(LIBRETRO_COMM_DIR)/include \
$(LIBRETRO_DIR) \
$(FBA_BURN_DIR) \
$(MAIN_FBA_DIR)/cpu \
$(FBA_BURN_DIR)/snd \
$(FBA_BURN_DIR)/devices \
$(FBA_INTERFACE_DIR) \
$(FBA_INTERFACE_DIR)/input \
$(FBA_INTERFACE_DIR)/cd \
$(FBA_INTERFACE_DIR)/audio \
$(FBA_BURNER_DIR) \
$(FBA_CPU_DIR) \
$(FBA_CPU_DIR)/i8039 \
$(FBA_CPU_DIR)/i8051 \
$(FBA_CPU_DIR)/i8x41 \
$(FBA_CPU_DIR)/m6805 \
$(FBA_CPU_DIR)/tms32010 \
$(FBA_CPU_DIR)/upd7725 \
$(FBA_CPU_DIR)/upd7810 \
$(FBA_CPU_DIR)/v60 \
$(FBA_CPU_DIR)/z80 \
$(FBA_CPU_DIR)/z180 \
$(FBA_LIB_DIR)/zlib \
$(FBA_LIB_DIR)/lib7z \
$(FBA_BURN_DIR)/drv/capcom \
$(FBA_BURN_DIR)/drv/konami \
$(FBA_BURN_DIR)/drv/dataeast \
$(FBA_BURN_DIR)/drv/cave \
$(FBA_BURN_DIR)/drv/neogeo \
$(FBA_BURN_DIR)/drv/psikyo \
$(FBA_BURN_DIR)/drv/sega \
$(FBA_BURN_DIR)/drv/toaplan \
$(FBA_BURN_DIR)/drv/taito \
$(FBA_BURN_DIR)/drv/irem \
$(FBA_GENERATED_DIR) \
$(FBA_LIB_DIR)
ARM_FLAGS =
ifeq ($(USE_X64_DRC), 1)
FBA_DEFINES += -DXBYAK_NO_OP_NAMES -DMIPS3_X64_DRC
FBA_SRC_DIRS += $(MIPS3_X64_DYNAREC_DIR)
ifeq (,$(findstring msvc,$(platform)))
CXXFLAGS += -std=gnu++11
endif
else
ifeq (,$(findstring msvc,$(platform)))
CXXFLAGS += -std=gnu++98
endif
endif
ifeq ($(USE_CYCLONE), 1)
FBA_DEFINES += -DUSE_CYCLONE
INCLUDE_DIRS += $(FBA_CPU_DIR)/cyclone
SOURCES_S += $(FBA_CPU_DIR)/cyclone/Cyclone.S
BURN_BLACKLIST += $(FBA_CPU_DIR)/m68000_intf.cpp
ARM_FLAGS = -mword-relocations -mlittle-endian -munaligned-access
# ios and android don't support this
ifneq (,$(findstring ios,$(platform)))
ARM_FLAGS =
endif
ifneq (,$(findstring android,$(platform)))
ARM_FLAGS =
endif
CFLAGS += -fno-optimize-sibling-calls -funsafe-math-optimizations -fsingle-precision-constant
CXXFLAGS += -fno-optimize-sibling-calls -funsafe-math-optimizations -fsingle-precision-constant
else
BURN_BLACKLIST += $(FBA_CPU_DIR)/c68000_intf.cpp
endif
NEON_FLAGS=
ifeq ($(HAVE_NEON), 1)
NEON_FLAGS = -mvectorize-with-neon-quad
# ios and android don't support this
ifneq (,$(findstring ios,$(platform)))
NEON_FLAGS =
endif
ifneq (,$(findstring android,$(platform)))
NEON_FLAGS =
endif
endif
ifeq ($(EXTERNAL_ZLIB), 1)
FBA_DEFINES += -DEXTERNAL_ZLIB
LDFLAGS += -lz
else
FBA_SRC_DIRS += $(FBA_LIB_DIR)/zlib
endif
ifeq ($(INCLUDE_7Z_SUPPORT), 1)
FBA_DEFINES += -DINCLUDE_7Z_SUPPORT
FBA_SRC_DIRS += $(FBA_LIB_DIR)/lib7z
BURN_BLACKLIST += $(FBA_LIB_DIR)/lib7z/LzFindMt.c \
$(FBA_LIB_DIR)/lib7z/LzmaEnc.c \
$(FBA_LIB_DIR)/lib7z/MtCoder.c \
$(FBA_LIB_DIR)/lib7z/Lzma2Enc.c \
$(FBA_LIB_DIR)/lib7z/Bcj2Enc.c \
$(FBA_LIB_DIR)/lib7z/Threads.c \
$(FBA_LIB_DIR)/lib7z/Lzma86Enc.c \
$(FBA_LIB_DIR)/lib7z/LzmaLib.c \
$(FBA_LIB_DIR)/lib7z/XzEnc.c
else
BURN_BLACKLIST += $(FBA_BURNER_DIR)/un7z.cpp
endif
SOURCES_C += $(filter-out $(BURN_BLACKLIST),$(foreach dir,$(FBA_SRC_DIRS),$(wildcard $(dir)/*.c)))
SOURCES_CXX += $(filter-out $(BURN_BLACKLIST),$(foreach dir,$(FBA_SRC_DIRS),$(wildcard $(dir)/*.cpp)))
SOURCES_CXX += $(LIBRETRO_DIR)/libretro.cpp \
$(LIBRETRO_DIR)/retro_cdemu.cpp \
$(LIBRETRO_DIR)/retro_common.cpp \
$(LIBRETRO_DIR)/retro_input.cpp \
$(LIBRETRO_DIR)/retro_memory.cpp
ifeq (,$(findstring msvc,$(platform)))
CFLAGS += -std=gnu99
endif
# GIT HASH
GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
ifneq ($(GIT_VERSION)," unknown")
CXXFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
endif