-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile.common
226 lines (202 loc) · 10.5 KB
/
Makefile.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
# ChaiLove
SOURCES_CXX := $(wildcard \
$(CORE_DIR)/src/*.cpp \
$(CORE_DIR)/src/love/*.cpp \
$(CORE_DIR)/src/love/Types/Audio/*.cpp \
$(CORE_DIR)/src/love/Types/Config/*.cpp \
$(CORE_DIR)/src/love/Types/FileSystem/*.cpp \
$(CORE_DIR)/src/love/Types/Graphics/*.cpp \
$(CORE_DIR)/src/love/Types/Input/*.cpp \
)
SOURCES_C = $(CORE_DIR)/src/physfs_platform_libretro.c
SOURCES_S =
FLAGS += -Wfatal-errors
# random
FLAGS += -I$(CORE_DIR)/vendor/random/include
# libretro-common
FLAGS += -I$(CORE_DIR)/vendor/libretro-common/include \
-DHAVE_RWAV=1
# Only compile libretro-common when not STATIC_LINKING
ifneq ($(STATIC_LINKING), 1)
SOURCES_C += $(wildcard \
$(CORE_DIR)/vendor/libretro-common/audio/audio_mix.c \
$(CORE_DIR)/vendor/libretro-common/audio/audio_mixer.c \
$(CORE_DIR)/vendor/libretro-common/audio/conversion/*.c \
$(CORE_DIR)/vendor/libretro-common/audio/resampler/audio_resampler.c \
$(CORE_DIR)/vendor/libretro-common/audio/resampler/drivers/nearest_resampler.c \
$(CORE_DIR)/vendor/libretro-common/audio/resampler/drivers/null_resampler.c \
$(CORE_DIR)/vendor/libretro-common/audio/resampler/drivers/sinc_resampler.c \
$(CORE_DIR)/vendor/libretro-common/compat/compat_posix_string.c \
$(CORE_DIR)/vendor/libretro-common/compat/compat_strcasestr.c \
$(CORE_DIR)/vendor/libretro-common/compat/compat_strl.c \
$(CORE_DIR)/vendor/libretro-common/compat/fopen_utf8.c \
$(CORE_DIR)/vendor/libretro-common/encodings/encoding_utf.c \
$(CORE_DIR)/vendor/libretro-common/features/features_cpu.c \
$(CORE_DIR)/vendor/libretro-common/file/config_file.c \
$(CORE_DIR)/vendor/libretro-common/file/config_file_userdata.c \
$(CORE_DIR)/vendor/libretro-common/file/file_path.c \
$(CORE_DIR)/vendor/libretro-common/file/file_path_io.c \
$(CORE_DIR)/vendor/libretro-common/file/retro_dirent.c \
$(CORE_DIR)/vendor/libretro-common/time/rtime.c \
$(CORE_DIR)/vendor/libretro-common/formats/wav/rwav.c \
$(CORE_DIR)/vendor/libretro-common/lists/string_list.c \
$(CORE_DIR)/vendor/libretro-common/memmap/memalign.c \
$(CORE_DIR)/vendor/libretro-common/rthreads/rthreads.c \
$(CORE_DIR)/vendor/libretro-common/streams/file_stream.c \
$(CORE_DIR)/vendor/libretro-common/string/stdstring.c \
$(CORE_DIR)/vendor/libretro-common/vfs/vfs_implementation.c \
)
# Ensure the sinc_resampler_neon is available for ARM NEON devices.
SOURCES_S += $(CORE_DIR)/vendor/libretro-common/audio/resampler/drivers/sinc_resampler_neon.S
# MD5
FLAGS += -I$(CORE_DIR)/vendor/libretro-common/include
SOURCES_C += $(CORE_DIR)/vendor/libretro-common/utils/md5.c
endif
ifeq ($(platform), ctr)
SOURCES_C += $(CORE_DIR)/vendor/libretro-common/audio/audio_mix.c \
$(CORE_DIR)/vendor/libretro-common/audio/audio_mixer.c
endif
ifeq ($(platform), emscripten)
SOURCES_C += $(CORE_DIR)/vendor/libretro-common/rthreads/rthreads.c
endif
# stb_vorbis
#SOURCES_C += $(CORE_DIR)/vendor/stb/stb_vorbis.c
FLAGS += -DHAVE_STB_VORBIS
FLAGS += -I$(CORE_DIR)/vendor/libretro-deps
# zlib
SOURCES_C += \
$(CORE_DIR)/vendor/libretro-deps/libz/adler32.c \
$(CORE_DIR)/vendor/libretro-deps/libz/compress.c \
$(CORE_DIR)/vendor/libretro-deps/libz/crc32.c \
$(CORE_DIR)/vendor/libretro-deps/libz/deflate.c \
$(CORE_DIR)/vendor/libretro-deps/libz/gzclose.c \
$(CORE_DIR)/vendor/libretro-deps/libz/gzlib.c \
$(CORE_DIR)/vendor/libretro-deps/libz/gzread.c \
$(CORE_DIR)/vendor/libretro-deps/libz/gzwrite.c \
$(CORE_DIR)/vendor/libretro-deps/libz/infback.c \
$(CORE_DIR)/vendor/libretro-deps/libz/inffast.c \
$(CORE_DIR)/vendor/libretro-deps/libz/inflate.c \
$(CORE_DIR)/vendor/libretro-deps/libz/inftrees.c \
$(CORE_DIR)/vendor/libretro-deps/libz/trees.c \
$(CORE_DIR)/vendor/libretro-deps/libz/zutil.c
FLAGS += -I$(CORE_DIR)/vendor/libretro-deps/libz
FLAGS += -I$(CORE_DIR)/vendor/libretro-common/compat
FLAGS += -DWANT_ZLIB
# PhysFS
FLAGS += -I$(CORE_DIR)/vendor/physfs/src
FLAGS += -I$(CORE_DIR)/vendor/physfs/extras
FLAGS += -DPHYSFS_NO_CDROM_SUPPORT=1 \
-DPHYSFS_SUPPORTS_DEFAULT=0 \
-DPHYSFS_SUPPORTS_ZIP=1
SOURCES_C += $(wildcard \
$(CORE_DIR)/vendor/physfs/extras/physfsrwops.c \
$(CORE_DIR)/vendor/physfs/src/*.c \
)
ifeq ($(platform), osx)
# LDFLAGS += -mmacosx-version-min=10.2
LDFLAGS += -framework IOKit -framework Foundation
# FLAGS += -DMAC_OS_X_VERSION_MIN_REQUIRED=1020
FLAGS += -D__MACH__ -D__APPLE__ -DPHYSFS_PLATFORM_APPLE
endif
# SDL_tty
FLAGS += -I$(CORE_DIR)/vendor/SDL_tty/include/SDL_tty
SOURCES_C += $(wildcard \
$(CORE_DIR)/vendor/SDL_tty/src/SDL_fnt.c \
$(CORE_DIR)/vendor/SDL_tty/src/SDL_tty.c \
)
# SDL_gfx
FLAGS += -I$(CORE_DIR)/vendor/sdl-libretro/tests/SDL_gfx-2.0.26
SOURCES_C += $(wildcard \
$(CORE_DIR)/vendor/sdl-libretro/tests/SDL_gfx-2.0.26/*.c \
)
# FreeType2
# See https://github.com/emscripten-ports/FreeType/blob/master/builds/amiga/makefile
FLAGS += -I$(CORE_DIR)/vendor/libretro-deps/freetype/include
FLAGS += -DFT2_BUILD_LIBRARY \
-DFT_USE_AUTOFIT \
-DFT_USE_RASTER \
-DFT_USE_SMOOTH \
-DFT_USE_TT \
-DFT_USE_T1 \
-DFT_USE_T42 \
-DFT_USE_T1CID \
-DFT_USE_CFF \
-DFT_USE_OTV \
-DFT_USE_GXV
SOURCES_C += \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/autofit/autofit.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftbase.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftbbox.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftbdf.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftbitmap.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftcid.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftdebug.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftfntfmt.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftfstype.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftgasp.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftglyph.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftgxval.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftinit.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftlcdfil.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftmm.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftotval.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftpatent.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftpfr.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftstroke.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftsynth.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftsystem.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/fttype1.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/base/ftwinfnt.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/bdf/bdf.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/bzip2/ftbzip2.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/cache/ftcache.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/cff/cff.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/cid/type1cid.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/gzip/ftgzip.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/lzw/ftlzw.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/pcf/pcf.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/pfr/pfr.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/psaux/psaux.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/pshinter/pshinter.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/psnames/psnames.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/raster/raster.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/sfnt/sfnt.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/smooth/smooth.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/truetype/truetype.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/type1/type1.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/type42/type42.c \
$(CORE_DIR)/vendor/libretro-deps/freetype/src/winfonts/winfnt.c
# SDL_ttf
FLAGS += -I$(CORE_DIR)/vendor/sdl-libretro/tests/SDL_ttf-2.0.11/VisualC/external/include
SOURCES_C += $(CORE_DIR)/vendor/sdl-libretro/tests/SDL_ttf-2.0.11/SDL_ttf.c
# SDL_stbimage
FLAGS += -I$(CORE_DIR)/vendor/Snippets
# STB
FLAGS += -I$(CORE_DIR)/vendor/stb
# TinySHA1
FLAGS += -I$(CORE_DIR)/vendor/TinySHA1
# cppcodec
FLAGS += -I$(CORE_DIR)/vendor/cppcodec
# ChaiScript
ifeq ($(HAVE_CHAISCRIPT),)
FLAGS += -I$(CORE_DIR)/vendor/chaiscript/include
FLAGS += -I$(CORE_DIR)/vendor/ChaiScript_Extras/include
FLAGS += -D__HAVE_CHAISCRIPT__
FLAGS += -DCHAISCRIPT_NO_THREADS -DCHAISCRIPT_NO_THREADS_WARNING -DCHAISCRIPT_NO_DYNLOAD
FLAGS += -DCHAISCRIPT_EXTRAS_MATH_SKIP_ADVANCED
endif
# SDL
ifeq ($(platform), win)
SOURCES_C += $(wildcard ./vendor/sdl-libretro/src/*.c ./vendor/sdl-libretro/src/audio/*.c ./vendor/sdl-libretro/src/cdrom/dummy/*.c ./vendor/sdl-libretro/src/cdrom/*.c ./vendor/sdl-libretro/src/cpuinfo/*.c ./vendor/sdl-libretro/src/events/*.c ./vendor/sdl-libretro/src/file/*.c ./vendor/sdl-libretro/src/stdlib/*.c ./vendor/sdl-libretro/src/thread/*.c ./vendor/sdl-libretro/src/timer/*.c ./vendor/sdl-libretro/src/video/*.c ./vendor/sdl-libretro/src/joystick/*.c ./vendor/sdl-libretro/src/video/libretro/*.c ./vendor/sdl-libretro/src/joystick/libretro/*.c ./vendor/sdl-libretro/src/timer/libretro/*.c ./vendor/sdl-libretro/src/audio/libretro/*.c ./vendor/sdl-libretro/src/thread/win32/SDL_sysmutex.c ./vendor/sdl-libretro/src/thread/win32/SDL_syssem.c ./vendor/sdl-libretro/src/thread/win32/SDL_systhread.c ./vendor/sdl-libretro/src/thread/generic/SDL_syscond.c ./vendor/sdl-libretro/src/loadso/dummy/*.c)
else
SOURCES_C += $(wildcard $(CORE_DIR)/vendor/sdl-libretro/src/*.c $(CORE_DIR)/vendor/sdl-libretro/src/audio/*.c $(CORE_DIR)/vendor/sdl-libretro/src/cdrom/dummy/*.c $(CORE_DIR)/vendor/sdl-libretro/src/cdrom/*.c $(CORE_DIR)/vendor/sdl-libretro/src/cpuinfo/*.c $(CORE_DIR)/vendor/sdl-libretro/src/events/*.c $(CORE_DIR)/vendor/sdl-libretro/src/file/*.c $(CORE_DIR)/vendor/sdl-libretro/src/stdlib/*.c $(CORE_DIR)/vendor/sdl-libretro/src/thread/*.c $(CORE_DIR)/vendor/sdl-libretro/src/timer/*.c $(CORE_DIR)/vendor/sdl-libretro/src/video/*.c $(CORE_DIR)/vendor/sdl-libretro/src/joystick/*.c $(CORE_DIR)/vendor/sdl-libretro/src/video/libretro/*.c $(CORE_DIR)/vendor/sdl-libretro/src/thread/generic/*.c $(CORE_DIR)/vendor/sdl-libretro/src/joystick/libretro/*.c $(CORE_DIR)/vendor/sdl-libretro/src/timer/libretro/*.c $(CORE_DIR)/vendor/sdl-libretro/src/audio/libretro/*.c $(CORE_DIR)/vendor/sdl-libretro/src/loadso/dummy/*.c)
endif
FLAGS += -DSDL_THREADS_DISABLED -DSDL_CDROM_DISABLED
FLAGS += -I$(CORE_DIR)/vendor/sdl-libretro/include
OBJECTS += $(SOURCES_CXX:.cpp=.o) $(SOURCES_C:.c=.o) $(SOURCES_S:.S=.o) $(SOURCES_M:.m=.o)
LDFLAGS += $(fpic) $(SHARED) $(EXTRA_LDF)
WARNINGS :=
# Windows: Fix retro_common_api.h
ifeq ($(system_platform), win)
FLAGS += -DPRId64=I64d -DPRIu64=I64u -DPRIuPTR=Iu
endif