Repository navigation
Expand file tree
/
Copy pathMakefile.common
More file actions
507 lines (461 loc) · 19.9 KB
/
Copy pathMakefile.common
File metadata and controls
507 lines (461 loc) · 19.9 KB
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
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
DEPS_DIR = $(CORE_DIR)/core/deps
LIBRETRO_COMM_DIR = $(CORE_DIR)/core/libretro-common
INCFLAGS += -I$(CORE_DIR)/core/libretro \
-I$(CORE_DIR)/core/ \
-I$(DEPS_DIR) \
-I$(LIBRETRO_COMM_DIR)/include
SOURCES_C ?=
SOURCES_CXX :=
SOURCES_C += $(CORE_DIR)/core/hw/pvr/renderer_dispatch.c
# CHD images are read by libretro-common's clean-room rchd reader. Its
# FLAC and zstd hunk codecs come from the same tree; deflate and LZMA
# are the archive codecs below, and the version 5 map needs
# encoding_huffman.c to open at all.
CHD_SOURCES_C = \
$(CORE_DIR)/core/imgread/chd_image.c \
$(LIBRETRO_COMM_DIR)/formats/chd/rchd.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_huffman.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_rzstd.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_xxh64.c \
$(LIBRETRO_COMM_DIR)/formats/flac/rflac.c
# zip and 7z archives: rzip_archive over encoding_deflate.c, r7z_archive
# over the LZMA/LZMA2/BCJ units and encoding_rbzip2.c.
ARCHIVE_SOURCES_C = \
$(CORE_DIR)/core/archive/archive.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_deflate.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_crc32.c \
$(LIBRETRO_COMM_DIR)/formats/7z/r7z_archive.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_rbzip2.c \
$(LIBRETRO_COMM_DIR)/formats/7z/r7z_lzma.c \
$(LIBRETRO_COMM_DIR)/formats/7z/r7z_lzma2.c \
$(LIBRETRO_COMM_DIR)/formats/7z/r7z_lzma_stream.c \
$(LIBRETRO_COMM_DIR)/formats/7z/r7z_bcj2.c \
$(LIBRETRO_COMM_DIR)/formats/7z/r7z_filters.c \
$(LIBRETRO_COMM_DIR)/formats/zip/rzip_archive.c \
$(LIBRETRO_COMM_DIR)/formats/rar/rrar_archive.c \
$(LIBRETRO_COMM_DIR)/formats/rar/rrar_ppmd7.c \
$(LIBRETRO_COMM_DIR)/features/features_cpu.c
PICOTCP_INCFLAGS = \
-I$(DEPS_DIR)/picotcp/include \
-I$(DEPS_DIR)/picotcp/modules
PICOTCP_CFLAGS = -DPICO_SUPPORT_UDP -DPICO_SUPPORT_DHCPD
PICOTCP_SOURCES_C = \
$(DEPS_DIR)/picotcp/modules/pico_arp.c \
$(DEPS_DIR)/picotcp/modules/pico_dev_ppp.c \
$(DEPS_DIR)/picotcp/modules/pico_dhcp_common.c \
$(DEPS_DIR)/picotcp/modules/pico_dhcp_server.c \
$(DEPS_DIR)/picotcp/modules/pico_dns_client.c \
$(DEPS_DIR)/picotcp/modules/pico_dns_common.c \
$(DEPS_DIR)/picotcp/modules/pico_ethernet.c \
$(DEPS_DIR)/picotcp/modules/pico_fragments.c \
$(DEPS_DIR)/picotcp/modules/pico_ipv4.c \
$(DEPS_DIR)/picotcp/modules/pico_socket_tcp.c \
$(DEPS_DIR)/picotcp/modules/pico_socket_udp.c \
$(DEPS_DIR)/picotcp/modules/pico_tcp.c \
$(DEPS_DIR)/picotcp/modules/pico_udp.c \
$(DEPS_DIR)/picotcp/stack/pico_device.c \
$(DEPS_DIR)/picotcp/stack/pico_frame.c \
$(DEPS_DIR)/picotcp/stack/pico_md5.c \
$(DEPS_DIR)/picotcp/stack/pico_protocol.c \
$(DEPS_DIR)/picotcp/stack/pico_socket.c \
$(DEPS_DIR)/picotcp/stack/pico_stack.c \
$(DEPS_DIR)/picotcp/stack/pico_tree.c
# The textures' hashes (custom textures are named by them): XXH32
SOURCES_C += $(LIBRETRO_COMM_DIR)/encodings/encoding_xxh32.c
# ...and their pictures, read and dumped (core/rend/custom_image.h)
SOURCES_C += $(CORE_DIR)/core/rend/custom_image.c
# The NAOMI 2's geometry processor
SOURCES_C += $(CORE_DIR)/core/hw/pvr/elan.c \
$(CORE_DIR)/core/hw/pvr/elan_host.c
# The ROMs of a NAOMI cartridge that share a range a word each in turn
SOURCES_C += $(CORE_DIR)/core/hw/naomi/naomi_interleave.c
# What a GD-ROM game's DIMM board leaves in the NAOMI's memory
SOURCES_C += $(CORE_DIR)/core/hw/naomi/naomi_dimm.c
# The lists a frame's parse appends to (List<T>'s, typed: helper_classes.h)
SOURCES_C += $(CORE_DIR)/core/hw/pvr/ta_list.c
SOURCES_C += $(CORE_DIR)/core/hw/pvr/ta.c $(CORE_DIR)/core/hw/pvr/ta_ctx.c $(CORE_DIR)/core/hw/pvr/ta_vtx.c
# ...the translucent polygons sorted
SOURCES_C += $(CORE_DIR)/core/rend/sorter.c
# ...and the texture converters
SOURCES_C += $(CORE_DIR)/core/rend/texconv.c $(CORE_DIR)/core/rend/TexCache.c $(CORE_DIR)/core/rend/tex_map.c \
$(CORE_DIR)/core/rend/tex_pool.c $(CORE_DIR)/core/rend/transform_matrix.c
SOURCES_C += $(CORE_DIR)/core/rend/vram_lock.c
SOURCES_C += $(CORE_DIR)/core/rend/rtt_watch.c
SOURCES_C += $(CORE_DIR)/core/rend/upscaler.c
SOURCES_C += $(CORE_DIR)/core/rend/custom_texture.c
SOURCES_C += $(CORE_DIR)/core/rend/tile/compute_frame.c
SOURCES_C += $(CORE_DIR)/core/serialize.c
SOURCES_C += $(CORE_DIR)/core/hw/pvr/Renderer_if.c
SOURCES_C += $(CORE_DIR)/core/hw/maple/maple_cfg.c
SOURCES_C += $(CORE_DIR)/core/hw/maple/jvs_board.c
SOURCES_C += $(CORE_DIR)/core/hw/maple/jvs_bridge.c
SOURCES_C += $(CORE_DIR)/core/hw/maple/maple_devs.c
# ...and a strip's indices (make_index()'s)
SOURCES_C += $(CORE_DIR)/core/hw/pvr/ta_index.c
# ...and what C++ has become C, MSVC C89 (AGENTS.md: gradually)
SOURCES_C += $(CORE_DIR)/core/hw/gdrom/gdrom_response.c \
$(CORE_DIR)/core/hw/maple/vmu_beep.c \
$(CORE_DIR)/core/rend/last_picture.c \
$(CORE_DIR)/core/reios/descrambl.c \
$(CORE_DIR)/core/hw/naomi/printer.c \
$(CORE_DIR)/core/hw/sh4/modules/bsc.c \
$(CORE_DIR)/core/hw/sh4/modules/cpg.c \
$(CORE_DIR)/core/hw/sh4/modules/intc.c \
$(CORE_DIR)/core/hw/sh4/modules/dmac.c \
$(CORE_DIR)/core/hw/sh4/sh4_mmr.c \
$(CORE_DIR)/core/hw/sh4/sh4_mem.c \
$(CORE_DIR)/core/hw/sh4/sh4_cache.c \
$(CORE_DIR)/core/hw/arm7/arm7.c \
$(CORE_DIR)/core/hw/arm7/arm7_rec.c \
$(CORE_DIR)/core/hw/arm7/arm7_rec_x64.c \
$(CORE_DIR)/core/hw/arm7/arm7_rec_x86.c \
$(CORE_DIR)/core/hw/arm7/arm7_rec_arm64.c \
$(CORE_DIR)/core/hw/arm7/arm7_rec_arm32.c \
$(CORE_DIR)/core/hw/mem/_vmem.c \
$(CORE_DIR)/core/hw/sh4/modules/serial.c \
$(CORE_DIR)/core/hw/sh4/sh4_rom.c \
$(CORE_DIR)/core/hw/naomi/decrypt.c \
$(CORE_DIR)/core/hw/naomi/dinokich_card.c \
$(CORE_DIR)/core/hw/sh4/modules/mmu.c \
$(CORE_DIR)/core/hw/sh4/modules/fastmmu.c \
$(CORE_DIR)/core/hw/sh4/interpr/sh4_interpreter.c \
$(CORE_DIR)/core/hw/sh4/sh4_opcode_list.c \
$(CORE_DIR)/core/hw/sh4/interpr/sh4_opcodes.c \
$(CORE_DIR)/core/hw/sh4/interpr/sh4_fpu.c \
$(CORE_DIR)/core/hw/arm7/arm_mem.c \
$(CORE_DIR)/core/hw/maple/maple_helper.c \
$(CORE_DIR)/core/hw/maple/maple_if.c \
$(CORE_DIR)/core/hw/pvr/drkPvr.c \
$(CORE_DIR)/core/reios/reios_elf.c \
$(CORE_DIR)/core/reios/gdrom_hle.c \
$(CORE_DIR)/core/reios/reios.c \
$(CORE_DIR)/core/hw/flashrom/x76f100.c \
$(CORE_DIR)/core/hw/flashrom/flashrom.c \
$(CORE_DIR)/core/libretro/audiostream.c \
$(DEPS_DIR)/libelf/elf.c \
$(DEPS_DIR)/libelf/elf32.c \
$(DEPS_DIR)/libelf/elf64.c \
$(CORE_DIR)/core/hw/aica/aica_if.c \
$(CORE_DIR)/core/hw/sh4/modules/ccn.c \
$(CORE_DIR)/core/hw/sh4/modules/rtc.c \
$(CORE_DIR)/core/hw/sh4/modules/tmu.c \
$(CORE_DIR)/core/hw/sh4/modules/ubc.c \
$(CORE_DIR)/core/hw/sh4/sh4_core_regs.c \
$(CORE_DIR)/core/hw/sh4/sh4_interrupts.c \
$(CORE_DIR)/core/hw/sh4/sh4_sched.c \
$(CORE_DIR)/core/hw/aica/aica.c \
$(CORE_DIR)/core/hw/aica/aica_mem.c \
$(CORE_DIR)/core/hw/aica/dsp.c \
$(CORE_DIR)/core/hw/aica/dsp_interp.c \
$(CORE_DIR)/core/hw/aica/dsp_arm64.c \
$(CORE_DIR)/core/hw/aica/dsp_x64.c \
$(CORE_DIR)/core/hw/aica/dsp_x86.c \
$(CORE_DIR)/core/hw/aica/sgc_if.c \
$(CORE_DIR)/core/hw/pvr/spg.c \
$(CORE_DIR)/core/hw/pvr/pvr_mem.c \
$(CORE_DIR)/core/hw/pvr/pvr_sb_regs.c \
$(CORE_DIR)/core/hw/pvr/pvr_regs.c \
$(CORE_DIR)/core/hw/holly/holly_intc.c \
$(CORE_DIR)/core/hw/naomi/midiffb.c \
$(CORE_DIR)/core/hw/gdrom/gdromv3.c \
$(CORE_DIR)/core/hw/holly/sb.c \
$(CORE_DIR)/core/hw/holly/sb_mem.c \
$(CORE_DIR)/core/hw/arm7/vbaARM.c \
$(CORE_DIR)/core/imgread/ImgReader.c \
$(CORE_DIR)/core/imgread/cdi.c \
$(CORE_DIR)/core/imgread/chd.c \
$(CORE_DIR)/core/imgread/common.c \
$(CORE_DIR)/core/imgread/disc.c \
$(CORE_DIR)/core/imgread/cue.c \
$(CORE_DIR)/core/imgread/gdi.c \
$(CORE_DIR)/core/imgread/sheet.c \
$(DEPS_DIR)/chdpsr/cdipsr.c
SOURCES_ASM :=
ifeq ($(SYSTEM_PICOTCP), 1)
CFLAGS += $(shell pkg-config --cflags picotcp)
LIBS += $(shell pkg-config --libs picotcp)
else
INCFLAGS += $(PICOTCP_INCFLAGS)
CFLAGS += $(PICOTCP_CFLAGS)
SOURCES_C += $(PICOTCP_SOURCES_C)
endif
ifeq ($(ENABLE_MODEM), 1)
SOURCES_C += $(CORE_DIR)/core/network/picoppp.c
SOURCES_C += $(CORE_DIR)/core/hw/modem/modem.c \
$(CORE_DIR)/core/hw/modem/v42.c \
$(CORE_DIR)/core/network/miniupnp.c \
$(CORE_DIR)/core/hw/modem/dns.c \
$(CORE_DIR)/core/hw/modem/v42bis.c
SOURCES_C += $(CORE_DIR)/core/hw/bba/bba.c \
$(CORE_DIR)/core/hw/bba/rtl8139c.c
SOURCES_C += $(CORE_DIR)/core/network/dcnet.c
# the gateway's ports forwarded (UPnP; RetroArch does not build it)
SOURCES_C += $(LIBRETRO_COMM_DIR)/net/net_upnp.c
ifneq ($(STATIC_LINKING), 1)
SOURCES_C += $(LIBRETRO_COMM_DIR)/net/net_http.c \
$(LIBRETRO_COMM_DIR)/formats/xml/rxml.c \
$(LIBRETRO_COMM_DIR)/lists/string_list.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_base64.c
endif
CORE_DEFINES += -DENABLE_MODEM
endif
ifeq ($(HAVE_GL), 1)
SOURCES_C += $(CORE_DIR)/core/rend/gles/gles.c \
$(CORE_DIR)/core/rend/gles/gltex.c \
$(CORE_DIR)/core/rend/gles/gl_writeout.c \
$(CORE_DIR)/core/rend/gles/gldraw.c \
$(CORE_DIR)/core/rend/gles/gl_texdecoder.c \
$(CORE_DIR)/core/rend/gles/glprogram_cache.c \
$(CORE_DIR)/core/rend/gles/glcache.c
ifeq ($(HAVE_GL4), 1)
SOURCES_C += $(CORE_DIR)/core/rend/gl4/gles.c \
$(CORE_DIR)/core/rend/gl4/gldraw.c \
$(CORE_DIR)/core/rend/gl4/gltex.c \
$(CORE_DIR)/core/rend/gl4/abuffer.c
# (where a frame is parsed when the card draws it from there: gles/parse_arena_gl.h)
SOURCES_C += $(CORE_DIR)/core/rend/gles/parse_arena_gl.c \
$(CORE_DIR)/core/rend/gles/ta_decoder_gl.c
endif
SOURCES_C += $(LIBRETRO_COMM_DIR)/glsym/rglgen.c \
$(DEPS_DIR)/glsm/glsm.c
ifeq ($(GLES), 1)
SOURCES_C += $(LIBRETRO_COMM_DIR)/glsym/glsym_es2.c
else
SOURCES_C += $(LIBRETRO_COMM_DIR)/glsym/glsym_gl.c
endif
endif
ifeq ($(HAVE_VULKAN), 1)
# (the shaders are SPIR-V made when the source is: tools/rend/kernels_spv.sh; no GLSL compiler is built in)
INCFLAGS += -I$(DEPS_DIR)/khronos
SOURCES_C += $(LIBRETRO_COMM_DIR)/vulkan/vulkan_symbol_wrapper.c \
$(CORE_DIR)/core/rend/vulkan/vk_heap.c \
$(CORE_DIR)/core/rend/vulkan/parse_arena_vk.c \
$(CORE_DIR)/core/rend/vulkan/hdr_encode_vk.c \
$(CORE_DIR)/core/rend/vulkan/vk_context.c \
$(CORE_DIR)/core/rend/vulkan/vk_pso.c \
$(CORE_DIR)/core/rend/vulkan/vk_shaders.c \
$(CORE_DIR)/core/rend/vulkan/vk_buffer.c \
$(CORE_DIR)/core/rend/vulkan/vk_cmd_pool.c \
$(CORE_DIR)/core/rend/vulkan/vk_gpu_timer.c \
$(CORE_DIR)/core/rend/vulkan/vk_desc_cache.c
SOURCES_CXX += \
$(CORE_DIR)/core/rend/vulkan/drawer.cpp \
$(CORE_DIR)/core/rend/vulkan/motion_pass.cpp \
$(CORE_DIR)/core/rend/vulkan/writeout.cpp \
$(CORE_DIR)/core/rend/vulkan/rtt_read.cpp \
$(CORE_DIR)/core/rend/vulkan/pipeline.cpp \
$(CORE_DIR)/core/rend/vulkan/quad.cpp \
$(CORE_DIR)/core/rend/vulkan/texture.cpp \
$(CORE_DIR)/core/rend/vulkan/tex_decoder.cpp \
$(CORE_DIR)/core/rend/vulkan/ta_decoder.cpp \
$(CORE_DIR)/core/rend/vulkan/vmu.cpp \
$(CORE_DIR)/core/rend/vulkan/vulkan_renderer.cpp \
$(CORE_DIR)/core/rend/vulkan/oit/oit_drawer.cpp \
$(CORE_DIR)/core/rend/vulkan/oit/oit_pipeline.cpp \
$(CORE_DIR)/core/rend/vulkan/oit/oit_renderer.cpp \
$(CORE_DIR)/core/rend/vulkan/oit/oit_renderpass.cpp \
$(CORE_DIR)/core/rend/vulkan/compute_drawer.cpp
endif
# Direct3D 11, on Windows: the frontend's device, the shaders compiled when
# they are first needed
ifeq ($(HAVE_D3D11), 1)
SOURCES_C += \
$(CORE_DIR)/core/rend/dx11/dx11_renderer.c \
$(CORE_DIR)/core/rend/dx11/oit/dx11_oitrenderer.c \
$(CORE_DIR)/core/rend/dx11/dx11context_lr.c \
$(CORE_DIR)/core/rend/dx11/dx11_overlay.c \
$(CORE_DIR)/core/rend/dx11/dx11_nvapi.c \
$(CORE_DIR)/core/rend/dx11/dx11_renderstate.c \
$(CORE_DIR)/core/rend/dx11/dx11_texdecoder.c \
$(CORE_DIR)/core/rend/dx11/dx11_texture.c \
$(CORE_DIR)/core/rend/dx11/dx11_shaders.c \
$(CORE_DIR)/core/rend/dx11/dx11_writeout.c \
$(CORE_DIR)/core/rend/dx11/dx11_ta_decoder.c \
$(CORE_DIR)/core/rend/dx11/oit/dx11_oitshaders.c \
$(CORE_DIR)/core/rend/hdr/hdr_encode_d3d11.c
endif
# (the video memory a DXGI adapter has: the Direct3D 11 and 12 renderers')
ifneq ($(filter 1,$(HAVE_D3D11) $(HAVE_D3D12)),)
SOURCES_C += $(CORE_DIR)/core/rend/dxgi_budget.c
endif
# Direct3D 12, on Windows: the frontend's device and queue, the shaders DXBC
# made when the core is built (rend/dx12/dx12_dxbc.inc)
ifeq ($(HAVE_D3D12), 1)
SOURCES_C += $(CORE_DIR)/core/rend/hdr/hdr_encode_d3d12.c \
$(CORE_DIR)/core/rend/dx12/dx12_renderer.c \
$(CORE_DIR)/core/rend/dx12/oit/dx12_oitrenderer.c \
$(CORE_DIR)/core/rend/dx12/dx12context_lr.c \
$(CORE_DIR)/core/rend/dx12/dx12_overlay.c \
$(CORE_DIR)/core/rend/dx12/dx12_pso.c \
$(CORE_DIR)/core/rend/dx12/dx12_nvapi.c \
$(CORE_DIR)/core/rend/dx12/dx12_shaders.c \
$(CORE_DIR)/core/rend/dx12/dx12_writeout.c \
$(CORE_DIR)/core/rend/dx12/dx12_texdecoder.c \
$(CORE_DIR)/core/rend/dx12/dx12_texture.c \
$(CORE_DIR)/core/rend/dx12/dx12_ta_decoder.c \
$(CORE_DIR)/core/rend/dx12/dx12_compute.c \
$(CORE_DIR)/core/rend/dx12/parse_arena_d3d12.c
endif
# Where a renderer has a frame parsed to (core/rend/parse_arena.h): the
# Vulkan, OpenGL 4 and Direct3D 12 ones
ifneq (,$(filter 1,$(HAVE_VULKAN) $(HAVE_GL4) $(HAVE_D3D12)))
SOURCES_C += $(CORE_DIR)/core/rend/parse_arena.c
endif
# The HDR output's Display Transform (rend/hdr/, Color Format), for the
# renderers that have the HDR output
ifneq (,$(filter 1,$(HAVE_VULKAN) $(HAVE_D3D11) $(HAVE_D3D12)))
SOURCES_C += $(CORE_DIR)/core/rend/hdr/hdr_output.c \
$(CORE_DIR)/core/rend/hdr/hdr_transform.c \
$(CORE_DIR)/core/rend/hdr/hdr_aces2.c \
$(CORE_DIR)/core/rend/hdr/hdr_display.c \
$(CORE_DIR)/core/rend/hdr/hdr_libretro.c
endif
# NVIDIA's NVAPI, loaded when it is run, for either Direct3D renderer
# (libretro-common's loader, gfx/nvidia/nvapi_loader.h)
ifneq (,$(filter 1,$(HAVE_D3D11) $(HAVE_D3D12)))
SOURCES_C += $(LIBRETRO_COMM_DIR)/gfx/nvidia/nvapi_loader.c
endif
# Shaders and pipelines made ahead on a thread of their own, for either
# Direct3D renderer (rend/d3d_warm.h)
ifneq (,$(filter 1,$(HAVE_D3D11) $(HAVE_D3D12)))
SOURCES_C += $(CORE_DIR)/core/rend/d3d_warm.c
endif
ifeq ($(HAVE_D3D11), 1)
SOURCES_C += $(CORE_DIR)/core/rend/d3d_shader_cache.c
endif
# Direct3D 9, on Windows: the frontend's device, every shader compiled when
# the renderer is first set up
ifeq ($(HAVE_D3D9), 1)
SOURCES_C += \
$(CORE_DIR)/core/rend/dx9/dx9context_lr.c \
$(CORE_DIR)/core/rend/dx9/dx9_overlay.c \
$(CORE_DIR)/core/rend/dx9/dx9_renderer.c \
$(CORE_DIR)/core/rend/dx9/dx9_shaders.c \
$(CORE_DIR)/core/rend/dx9/dx9_texture.c \
$(CORE_DIR)/core/rend/dx9/dx9_texdecoder.c
endif
SOURCES_C += $(CORE_DIR)/core/hw/naomi/systemsp.c
SOURCES_C += $(CORE_DIR)/core/hw/naomi/naomi.c \
$(CORE_DIR)/core/hw/naomi/naomi_cart.c \
$(CORE_DIR)/core/hw/naomi/cartridge.c \
$(CORE_DIR)/core/hw/naomi/m1cartridge.c \
$(CORE_DIR)/core/hw/naomi/m4cartridge.c \
$(CORE_DIR)/core/hw/naomi/awcartridge.c \
$(CORE_DIR)/core/hw/naomi/gdcartridge.c \
$(CORE_DIR)/core/hw/naomi/touchscreen.c \
$(CORE_DIR)/core/hw/naomi/hopper.c \
$(CORE_DIR)/core/hw/naomi/card_reader.c \
$(CORE_DIR)/core/hw/naomi/dinokich.c \
$(CORE_DIR)/core/hw/naomi/systemsp_serial.c \
$(CORE_DIR)/core/hw/naomi/naomi_m3comm.c \
$(CORE_DIR)/core/network/naomi_network.c
# The sockets under net_platform.h, for the modem's network and NAOMI's
ifneq ($(STATIC_LINKING), 1)
SOURCES_C += $(LIBRETRO_COMM_DIR)/net/net_socket.c \
$(LIBRETRO_COMM_DIR)/net/net_compat.c
endif
# The device in the Dreamcast's expansion port, in every build
SOURCES_C += $(CORE_DIR)/core/network/netstate.c
# Where the core writes its files
SOURCES_C += $(CORE_DIR)/core/paths.c \
$(CORE_DIR)/core/nullDC.c \
$(CORE_DIR)/core/cheats.c
# The SH4's recompiler: none with NO_REC=1, the interpreter alone; the
# portable one with HAVE_GENERIC_JIT=1, on any processor
ifneq ($(NO_REC), 1)
ifeq ($(HAVE_GENERIC_JIT), 1)
DYNAREC_USED = 1
SOURCES_C += $(CORE_DIR)/core/rec-portable/rec_portable.c
# Recompiler (x64)
else ifneq ($(filter $(WITH_DYNAREC), x86_64 x64),)
DYNAREC_USED = 1
SOURCES_C += $(CORE_DIR)/core/rec-x64/rec_x64.c
# Recompiler (x86 32bit)
else ifneq ($(filter $(WITH_DYNAREC), i386 i686 x86),)
DYNAREC_USED = 1
SOURCES_C += $(CORE_DIR)/core/rec-x86/rec_x86.c
# Recompiler (ARM)
else ifeq ($(WITH_DYNAREC), arm)
DYNAREC_USED = 1
SOURCES_C += $(CORE_DIR)/core/rec-ARM/rec_arm.c
SOURCES_ASM += $(CORE_DIR)/core/rec-ARM/ngen_arm.S
# Recompiler (ARM64)
else ifneq ($(filter $(WITH_DYNAREC), arm64 aarch64),)
DYNAREC_USED = 1
# (for macOS, what it has is in rec_arm64.c, in Apple's syntax)
ifeq (,$(findstring osx,$(platform)))
SOURCES_ASM += $(CORE_DIR)/core/rec-ARM64/ngen_arm64.S
endif
SOURCES_C += $(CORE_DIR)/core/rec-ARM64/rec_arm64.c
endif
endif
# Dynarec
ifeq ($(DYNAREC_USED), 1)
SOURCES_C += $(CORE_DIR)/core/node_pool.c \
$(CORE_DIR)/core/hw/sh4/dyna/shil.c \
$(CORE_DIR)/core/hw/sh4/dyna/decoder.c \
$(CORE_DIR)/core/hw/sh4/dyna/wait_site.c \
$(CORE_DIR)/core/hw/sh4/dyna/ssa.c \
$(CORE_DIR)/core/hw/sh4/dyna/blockmanager.c \
$(CORE_DIR)/core/hw/sh4/dyna/driver.c \
$(CORE_DIR)/core/hw/sh4/dyna/ssa_regalloc.c
endif
SOURCES_C += $(CORE_DIR)/core/libretro/libretro.c
SOURCES_CXX += $(CORE_DIR)/core/libretro/lr_contexts.cpp
SOURCES_C += $(CORE_DIR)/core/libretro/common.c
SOURCES_C += $(CORE_DIR)/core/libretro/lr_input.c
SOURCES_C += $(CORE_DIR)/core/libretro/lr_disk.c
SOURCES_C += $(CORE_DIR)/core/libretro/vmem_utils.c
SOURCES_C += $(DEPS_DIR)/coreio/coreio.c
SOURCES_C += $(CORE_DIR)/core/savewriter.c
# When statically linked into RetroArch (e.g. libnx), the frontend already
# compiles these libretro-common sources; building them again would duplicate
# symbols at link time. The headers stay -- they now match current upstream, so
# the declarations agree with the objects RetroArch provides.
ifneq ($(STATIC_LINKING), 1)
SOURCES_C += $(LIBRETRO_COMM_DIR)/file/file_path.c \
$(LIBRETRO_COMM_DIR)/file/file_path_io.c \
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.c \
$(LIBRETRO_COMM_DIR)/vfs/vfs_prefetch.c \
$(LIBRETRO_COMM_DIR)/streams/file_stream.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.c \
$(LIBRETRO_COMM_DIR)/compat/compat_strl.c \
$(LIBRETRO_COMM_DIR)/compat/fopen_utf8.c \
$(LIBRETRO_COMM_DIR)/file/retro_dirent.c \
$(LIBRETRO_COMM_DIR)/string/stdstring.c \
$(LIBRETRO_COMM_DIR)/string/rstrtod.c \
$(LIBRETRO_COMM_DIR)/time/rtime.c
# custom textures read (PNG, JPEG) and dumped (PNG)
SOURCES_C += $(LIBRETRO_COMM_DIR)/formats/png/rpng.c \
$(LIBRETRO_COMM_DIR)/formats/png/rpng_encode.c \
$(LIBRETRO_COMM_DIR)/file/rpng_file.c \
$(LIBRETRO_COMM_DIR)/formats/jpeg/rjpeg.c \
$(LIBRETRO_COMM_DIR)/streams/trans_stream.c \
$(LIBRETRO_COMM_DIR)/streams/trans_stream_deflate.c \
$(LIBRETRO_COMM_DIR)/streams/trans_stream_pipe.c \
$(LIBRETRO_COMM_DIR)/streams/interface_stream.c \
$(LIBRETRO_COMM_DIR)/streams/memory_stream.c
ifeq ($(HAVE_CHD), 1)
# (interface_stream.c opens CHDs with HAVE_CHD)
SOURCES_C += $(LIBRETRO_COMM_DIR)/streams/chd_stream.c
endif
endif
ifeq ($(NO_THREADS), 1)
else
SOURCES_C += $(CORE_DIR)/core/libretro/emu_baton.c
ifneq ($(STATIC_LINKING), 1)
SOURCES_C += $(LIBRETRO_COMM_DIR)/rthreads/rthreads.c \
$(LIBRETRO_COMM_DIR)/rthreads/retro_eventcount.c \
$(LIBRETRO_COMM_DIR)/queues/retro_spsc.c
endif
endif
ifeq ($(HAVE_TEXUPSCALE), 1)
# (with the threads xBRZ's rows are shared out to: rend/band_pool.h)
SOURCES_C += $(DEPS_DIR)/xbrz/xbrz.c $(CORE_DIR)/core/rend/band_pool.c
endif
ifeq ($(HAVE_CHD), 1)
SOURCES_C += $(CHD_SOURCES_C)
endif
SOURCES_C += $(ARCHIVE_SOURCES_C)
# (7z's bzip2 folders, through encoding_rbzip2.c)
CORE_DEFINES += -DHAVE_RBZIP2