-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathMakefile.common
More file actions
143 lines (131 loc) · 4.69 KB
/
Makefile.common
File metadata and controls
143 lines (131 loc) · 4.69 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
LIBRETRO_COMM_DIR = $(CORE_DIR)/libretro-common
INCFLAGS := -I$(CORE_DIR) \
-I$(CORE_DIR)/src \
-I$(CORE_DIR)/src/m68000 \
-I$(LIBRETRO_COMM_DIR)/include
ifneq (,$(findstring msvc2003,$(platform)))
INCFLAGS += -I$(LIBRETRO_COMM_DIR)/include/compat/msvc
endif
SOURCES_CXX :=
SOURCES_C := \
$(CORE_DIR)/libretro.c \
$(CORE_DIR)/src/blitter.c \
$(CORE_DIR)/src/dac.c \
$(CORE_DIR)/src/dsp.c \
$(CORE_DIR)/src/file.c \
$(CORE_DIR)/src/gpu.c \
$(CORE_DIR)/src/jaguar.c \
$(CORE_DIR)/src/jerry.c \
$(CORE_DIR)/src/op.c \
$(CORE_DIR)/src/tom.c \
$(CORE_DIR)/src/cdintf.c \
$(CORE_DIR)/src/cdrom.c \
$(CORE_DIR)/src/cheat.c \
$(CORE_DIR)/src/crc32.c \
$(CORE_DIR)/src/event.c \
$(CORE_DIR)/src/eeprom.c \
$(CORE_DIR)/src/filedb.c \
$(CORE_DIR)/src/m68000/cpustbl.c \
$(CORE_DIR)/src/m68000/cpudefs.c \
$(CORE_DIR)/src/m68000/cpuemu.c \
$(CORE_DIR)/src/m68000/cpuextra.c \
$(CORE_DIR)/src/m68000/m68kinterface.c \
$(CORE_DIR)/src/m68000/readcpu.c \
$(CORE_DIR)/src/jagbios.c \
$(CORE_DIR)/src/jagbios2.c \
$(CORE_DIR)/src/jagcdbios.c \
$(CORE_DIR)/src/jagdevcdbios.c \
$(CORE_DIR)/src/jagstub1bios.c \
$(CORE_DIR)/src/jagstub2bios.c \
$(CORE_DIR)/src/joystick.c \
$(CORE_DIR)/src/settings.c \
$(CORE_DIR)/src/memtrack.c \
$(CORE_DIR)/src/mmu.c \
$(CORE_DIR)/src/vjag_memory.c \
$(CORE_DIR)/src/universalhdr.c \
$(CORE_DIR)/src/wavetable.c
# SIMD-accelerated blitter operations: select arch-specific implementation.
# BLITTER_SIMD may be set explicitly to one of: scalar, sse2, neon.
BLITTER_SIMD_SRC :=
ifneq ($(BLITTER_SIMD),)
ifeq (,$(filter scalar sse2 neon,$(BLITTER_SIMD)))
$(error Unsupported BLITTER_SIMD '$(BLITTER_SIMD)'; expected one of: scalar sse2 neon)
endif
endif
ifeq ($(BLITTER_SIMD),sse2)
BLITTER_SIMD_SRC := $(CORE_DIR)/src/blitter_simd_sse2.c
else ifeq ($(BLITTER_SIMD),neon)
BLITTER_SIMD_SRC := $(CORE_DIR)/src/blitter_simd_neon.c
else ifeq ($(BLITTER_SIMD),scalar)
BLITTER_SIMD_SRC := $(CORE_DIR)/src/blitter_simd_scalar.c
else
# ARM targets: prefer NEON when guaranteed or explicitly enabled.
ifeq ($(HAVE_NEON), 1)
BLITTER_SIMD_SRC := $(CORE_DIR)/src/blitter_simd_neon.c
endif
ifneq (,$(filter ios-arm64 tvos-arm64,$(platform)))
BLITTER_SIMD_SRC := $(CORE_DIR)/src/blitter_simd_neon.c
endif
# aarch64/arm64 always have NEON; plain 'arm' may lack it.
ifneq (,$(filter aarch64 arm64,$(ARCH)))
BLITTER_SIMD_SRC := $(CORE_DIR)/src/blitter_simd_neon.c
endif
# armv8+ implies NEON; armv7/armhf only use NEON if HAVE_NEON was set above.
ifneq (,$(filter arm64 armv8%,$(platform)))
BLITTER_SIMD_SRC := $(CORE_DIR)/src/blitter_simd_neon.c
endif
# x86/x64 targets: use SSE2.
ifneq (,$(filter x86_64 x86 i686 i386,$(ARCH)))
BLITTER_SIMD_SRC := $(CORE_DIR)/src/blitter_simd_sse2.c
endif
ifneq (,$(filter x86_64 x86 i686 i386 win-x64 win32,$(platform)))
BLITTER_SIMD_SRC := $(CORE_DIR)/src/blitter_simd_sse2.c
endif
# MSYS2/MinGW
ifneq (,$(filter MINGW64% MINGW32%,$(MSYSTEM)))
BLITTER_SIMD_SRC := $(CORE_DIR)/src/blitter_simd_sse2.c
endif
# 32-bit x86 needs explicit -msse2 (x86_64 has it baseline).
ifeq ($(BLITTER_SIMD_SRC),$(CORE_DIR)/src/blitter_simd_sse2.c)
ifneq (,$(filter i686 i386 x86 win32,$(ARCH) $(platform)))
CFLAGS += -msse2
endif
ifneq (,$(filter MINGW32%,$(MSYSTEM)))
CFLAGS += -msse2
endif
endif
# Native build fallback: auto-detect from host architecture, but only for
# native-build platforms (unix/osx/win). Cross-compile targets (vita, ps3,
# libnx, etc.) set platform explicitly and should not use host detection.
ifeq ($(BLITTER_SIMD_SRC),)
ifneq (,$(filter unix osx win,$(platform)))
ifneq (,$(filter x86_64 i686 i386,$(shell uname -m 2>/dev/null)))
BLITTER_SIMD_SRC := $(CORE_DIR)/src/blitter_simd_sse2.c
endif
ifneq (,$(filter aarch64 arm64,$(shell uname -m 2>/dev/null)))
BLITTER_SIMD_SRC := $(CORE_DIR)/src/blitter_simd_neon.c
endif
endif
endif
endif
# Fall back to scalar if no SIMD was selected (e.g., exotic platforms)
ifeq ($(BLITTER_SIMD_SRC),)
BLITTER_SIMD_SRC := $(CORE_DIR)/src/blitter_simd_scalar.c
endif
SOURCES_C += $(BLITTER_SIMD_SRC)
ifneq ($(STATIC_LINKING), 1)
SOURCES_C += \
$(LIBRETRO_COMM_DIR)/compat/compat_strcasestr.c \
$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.c \
$(LIBRETRO_COMM_DIR)/compat/compat_snprintf.c \
$(LIBRETRO_COMM_DIR)/compat/compat_strl.c \
$(LIBRETRO_COMM_DIR)/compat/compat_posix_string.c \
$(LIBRETRO_COMM_DIR)/compat/fopen_utf8.c \
$(LIBRETRO_COMM_DIR)/streams/file_stream.c \
$(LIBRETRO_COMM_DIR)/streams/file_stream_transforms.c \
$(LIBRETRO_COMM_DIR)/string/stdstring.c \
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.c \
$(LIBRETRO_COMM_DIR)/file/file_path.c \
$(LIBRETRO_COMM_DIR)/file/file_path_io.c \
$(LIBRETRO_COMM_DIR)/time/rtime.c
endif