Commit | Line | Data |
---|---|---|
4132e8ca | 1 | # Makefile for PCSX ReARMed |
a80ae4a0 | 2 | |
61bc6d40 | 3 | # default stuff goes here, so that config can override |
9aff1963 | 4 | TARGET ?= pcsx |
41846131 | 5 | CFLAGS += -Wall -Iinclude -ffast-math |
6 | ||
7 | DEBUG ?= 0 | |
8 | DEBUG_SYMS ?= 0 | |
9 | ASSERTS ?= 0 | |
10 | HAVE_CHD ?= 1 | |
11 | ifneq ($(DEBUG)$(DEBUG_SYMS), 00) | |
12 | CFLAGS += -ggdb | |
13 | endif | |
14 | ifneq ($(DEBUG), 1) | |
fad9f755 | 15 | CFLAGS += -O2 |
79c4d434 | 16 | ifneq ($(ASSERTS), 1) |
fad9f755 | 17 | CFLAGS += -DNDEBUG |
18 | endif | |
b60f2812 | 19 | endif |
36c76c86 PC |
20 | ifeq ($(DEBUG_ASAN), 1) |
21 | CFLAGS += -fsanitize=address | |
5dd884df | 22 | LDFLAGS += -fsanitize=address |
23 | #LDFLAGS += -static-libasan | |
36c76c86 | 24 | endif |
fad9f755 | 25 | ifneq ($(NO_FSECTIONS), 1) |
26 | CFLAGS += -ffunction-sections -fdata-sections | |
e6f13b47 | 27 | FSECTIONS_LDFLAGS ?= -Wl,--gc-sections |
28 | LDFLAGS += $(FSECTIONS_LDFLAGS) | |
fad9f755 | 29 | endif |
9165d434 | 30 | CFLAGS += -DP_HAVE_MMAP=$(if $(NO_MMAP),0,1) \ |
31 | -DP_HAVE_PTHREAD=$(if $(NO_PTHREAD),0,1) \ | |
4bb8d7e1 PC |
32 | -DP_HAVE_POSIX_MEMALIGN=$(if $(NO_POSIX_MEMALIGN),0,1) \ |
33 | -DDISABLE_MEM_LUTS=0 | |
61bc6d40 | 34 | CXXFLAGS += $(CFLAGS) |
4132e8ca | 35 | #DRC_DBG = 1 |
36 | #PCNT = 1 | |
80c2304e | 37 | |
a4c71501 | 38 | # Suppress minor warnings for dependencies |
39 | deps/%: CFLAGS += -Wno-unused -Wno-unused-function | |
40 | ||
38c2028e | 41 | all: config.mak target_ plugins_ |
de38f20e | 42 | |
9aff1963 | 43 | ifndef NO_CONFIG_MAK |
4132e8ca | 44 | ifneq ($(wildcard config.mak),) |
45 | config.mak: ./configure | |
46 | @echo $@ is out-of-date, running configure | |
47 | @sed -n "/.*Configured with/s/[^:]*: //p" $@ | sh | |
48 | include config.mak | |
49 | else | |
50 | config.mak: | |
51 | @echo "Please run ./configure before running make!" | |
52 | @exit 1 | |
53 | endif | |
9aff1963 | 54 | else # NO_CONFIG_MAK |
55 | config.mak: | |
56 | endif | |
57 | ||
4132e8ca | 58 | -include Makefile.local |
80c2304e | 59 | |
9aff1963 | 60 | CC_LINK ?= $(CC) |
61 | CC_AS ?= $(CC) | |
22fa3f2b | 62 | LDFLAGS += $(MAIN_LDFLAGS) |
9aff1963 | 63 | EXTRA_LDFLAGS ?= -Wl,-Map=$@.map |
07c13dfd | 64 | LDLIBS += $(MAIN_LDLIBS) |
e0aec5ee | 65 | ifdef PCNT |
66 | CFLAGS += -DPCNT | |
67 | endif | |
61bc6d40 | 68 | |
80c2304e | 69 | # core |
08d9d257 | 70 | OBJS += libpcsxcore/cdriso.o libpcsxcore/cdrom.o libpcsxcore/cdrom-async.o \ |
71 | libpcsxcore/cheat.o libpcsxcore/database.o \ | |
7d7672a5 | 72 | libpcsxcore/decode_xa.o libpcsxcore/mdec.o \ |
80c2304e | 73 | libpcsxcore/misc.o libpcsxcore/plugins.o libpcsxcore/ppf.o libpcsxcore/psxbios.o \ |
0890ae15 | 74 | libpcsxcore/psxcommon.o libpcsxcore/psxcounters.o libpcsxcore/psxdma.o \ |
9a0a61d2 | 75 | libpcsxcore/psxhw.o libpcsxcore/psxinterpreter.o libpcsxcore/psxmem.o \ |
76 | libpcsxcore/psxevents.o libpcsxcore/r3000a.o \ | |
abf09485 | 77 | libpcsxcore/sio.o libpcsxcore/spu.o libpcsxcore/gpu.o |
59774ed0 | 78 | OBJS += libpcsxcore/gte.o libpcsxcore/gte_nf.o libpcsxcore/gte_divider.o |
7d7672a5 | 79 | #OBJS += libpcsxcore/debug.o libpcsxcore/socket.o libpcsxcore/disr3000a.o |
79c4d434 | 80 | |
81 | ifeq ($(WANT_ZLIB),1) | |
82 | ZLIB_DIR = deps/libchdr/deps/zlib-1.3.1 | |
83 | CFLAGS += -I$(ZLIB_DIR) | |
84 | OBJS += $(ZLIB_DIR)/adler32.o \ | |
85 | $(ZLIB_DIR)/compress.o \ | |
86 | $(ZLIB_DIR)/crc32.o \ | |
87 | $(ZLIB_DIR)/deflate.o \ | |
88 | $(ZLIB_DIR)/gzclose.o \ | |
89 | $(ZLIB_DIR)/gzlib.o \ | |
90 | $(ZLIB_DIR)/gzread.o \ | |
91 | $(ZLIB_DIR)/gzwrite.o \ | |
92 | $(ZLIB_DIR)/infback.o \ | |
93 | $(ZLIB_DIR)/inffast.o \ | |
94 | $(ZLIB_DIR)/inflate.o \ | |
95 | $(ZLIB_DIR)/inftrees.o \ | |
96 | $(ZLIB_DIR)/trees.o \ | |
97 | $(ZLIB_DIR)/uncompr.o \ | |
98 | $(ZLIB_DIR)/zutil.o | |
99 | $(ZLIB_DIR)/%.o: CFLAGS += -DHAVE_UNISTD_H | |
100 | endif | |
101 | ||
59774ed0 | 102 | ifeq "$(ARCH)" "arm" |
103 | OBJS += libpcsxcore/gte_arm.o | |
104 | endif | |
57467c77 | 105 | ifeq "$(HAVE_NEON_ASM)" "1" |
8cfbda97 | 106 | OBJS += libpcsxcore/gte_neon.o |
107 | endif | |
305c8c93 | 108 | libpcsxcore/psxbios.o: CFLAGS += -Wno-nonnull |
ab948f7e | 109 | |
fad9f755 | 110 | ifeq "$(USE_ASYNC_CDROM)" "1" |
111 | libpcsxcore/cdrom-async.o: CFLAGS += -DUSE_ASYNC_CDROM | |
112 | frontend/libretro.o: CFLAGS += -DUSE_ASYNC_CDROM | |
113 | frontend/menu.o: CFLAGS += -DUSE_ASYNC_CDROM | |
114 | USE_RTHREADS := 1 | |
115 | endif | |
116 | ||
f95a77f7 | 117 | # dynarec |
a4c71501 | 118 | ifeq "$(DYNAREC)" "lightrec" |
119 | CFLAGS += -Ideps/lightning/include -Ideps/lightrec -Iinclude/lightning -Iinclude/lightrec \ | |
120 | -DLIGHTREC -DLIGHTREC_STATIC | |
121 | LIGHTREC_CUSTOM_MAP ?= 0 | |
122 | LIGHTREC_CUSTOM_MAP_OBJ ?= libpcsxcore/lightrec/mem.o | |
123 | LIGHTREC_THREADED_COMPILER ?= 0 | |
124 | LIGHTREC_CODE_INV ?= 0 | |
125 | CFLAGS += -DLIGHTREC_CUSTOM_MAP=$(LIGHTREC_CUSTOM_MAP) \ | |
126 | -DLIGHTREC_CODE_INV=$(LIGHTREC_CODE_INV) \ | |
127 | -DLIGHTREC_ENABLE_THREADED_COMPILER=$(LIGHTREC_THREADED_COMPILER) | |
128 | ifeq ($(LIGHTREC_CUSTOM_MAP),1) | |
129 | LDLIBS += -lrt | |
130 | OBJS += $(LIGHTREC_CUSTOM_MAP_OBJ) | |
131 | endif | |
132 | ifeq ($(NEED_SYSCONF),1) | |
133 | OBJS += libpcsxcore/lightrec/sysconf.o | |
134 | endif | |
135 | ifeq ($(LIGHTREC_THREADED_COMPILER),1) | |
136 | OBJS += deps/lightrec/recompiler.o \ | |
137 | deps/lightrec/reaper.o | |
138 | endif | |
139 | OBJS += deps/lightrec/tlsf/tlsf.o | |
140 | OBJS += libpcsxcore/lightrec/plugin.o | |
141 | OBJS += deps/lightning/lib/jit_disasm.o \ | |
142 | deps/lightning/lib/jit_memory.o \ | |
143 | deps/lightning/lib/jit_names.o \ | |
144 | deps/lightning/lib/jit_note.o \ | |
145 | deps/lightning/lib/jit_print.o \ | |
146 | deps/lightning/lib/jit_size.o \ | |
147 | deps/lightning/lib/lightning.o \ | |
148 | deps/lightrec/blockcache.o \ | |
149 | deps/lightrec/constprop.o \ | |
150 | deps/lightrec/disassembler.o \ | |
151 | deps/lightrec/emitter.o \ | |
152 | deps/lightrec/interpreter.o \ | |
153 | deps/lightrec/lightrec.o \ | |
154 | deps/lightrec/memmanager.o \ | |
155 | deps/lightrec/optimizer.o \ | |
156 | deps/lightrec/regcache.o | |
157 | deps/lightning/%.o: CFLAGS += -DHAVE_MMAP=P_HAVE_MMAP | |
158 | deps/lightning/%: CFLAGS += -Wno-uninitialized | |
159 | deps/lightrec/%: CFLAGS += -Wno-uninitialized | |
160 | libpcsxcore/lightrec/mem.o: CFLAGS += -D_GNU_SOURCE | |
161 | ifeq ($(MMAP_WIN32),1) | |
162 | CFLAGS += -Iinclude/mman -I deps/mman | |
163 | OBJS += deps/mman/mman.o | |
164 | endif | |
165 | else ifeq "$(DYNAREC)" "ari64" | |
be516ebe | 166 | OBJS += libpcsxcore/new_dynarec/new_dynarec.o |
7e605697 | 167 | OBJS += libpcsxcore/new_dynarec/pcsxmem.o |
be516ebe | 168 | ifeq "$(ARCH)" "arm" |
169 | OBJS += libpcsxcore/new_dynarec/linkage_arm.o | |
687b4580 | 170 | libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/assem_arm.c |
57467c77 | 171 | else ifneq (,$(findstring $(ARCH),aarch64 arm64)) |
be516ebe | 172 | OBJS += libpcsxcore/new_dynarec/linkage_arm64.o |
687b4580 | 173 | libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/assem_arm64.c |
be516ebe | 174 | else |
175 | $(error no dynarec support for architecture $(ARCH)) | |
176 | endif | |
0b1633d7 | 177 | ifeq "$(NDRC_THREAD)" "1" |
178 | libpcsxcore/new_dynarec/new_dynarec.o: CFLAGS += -DNDRC_THREAD | |
179 | libpcsxcore/new_dynarec/emu_if.o: CFLAGS += -DNDRC_THREAD | |
180 | frontend/libretro.o: CFLAGS += -DNDRC_THREAD | |
181 | USE_RTHREADS := 1 | |
182 | endif | |
448bbcae | 183 | else |
41e82ad4 | 184 | CFLAGS += -DDRC_DISABLE |
7139f3c8 | 185 | endif |
9a0a61d2 | 186 | OBJS += libpcsxcore/new_dynarec/emu_if.o |
687b4580 | 187 | libpcsxcore/new_dynarec/new_dynarec.o: libpcsxcore/new_dynarec/pcsxmem_inline.c |
3eb78778 | 188 | ifdef DRC_DBG |
189 | libpcsxcore/new_dynarec/emu_if.o: CFLAGS += -D_FILE_OFFSET_BITS=64 | |
190 | CFLAGS += -DDRC_DBG | |
191 | endif | |
2a014d73 | 192 | ifeq "$(BASE_ADDR_DYNAMIC)" "1" |
193 | libpcsxcore/new_dynarec/%.o: CFLAGS += -DBASE_ADDR_DYNAMIC=1 | |
a327ad27 | 194 | endif |
f95a77f7 | 195 | |
e906c010 | 196 | # spu |
ee849648 | 197 | OBJS += plugins/dfsound/dma.o plugins/dfsound/freeze.o \ |
07c13dfd | 198 | plugins/dfsound/registers.o plugins/dfsound/spu.o \ |
199 | plugins/dfsound/out.o plugins/dfsound/nullsnd.o | |
6d866bb7 | 200 | plugins/dfsound/spu.o: plugins/dfsound/adsr.c plugins/dfsound/reverb.c \ |
201 | plugins/dfsound/xa.c | |
3a721c1f | 202 | ifeq "$(ARCH)" "arm" |
b17618c0 | 203 | OBJS += plugins/dfsound/arm_utils.o |
204 | endif | |
5514a050 | 205 | ifeq "$(HAVE_C64_TOOLS)" "1" |
42dde520 | 206 | plugins/dfsound/%.o: CFLAGS += -DC64X_DSP -DWANT_THREAD_CODE |
5514a050 | 207 | plugins/dfsound/spu.o: plugins/dfsound/spu_c64x.c |
8886a808 | 208 | frontend/menu.o: CFLAGS += -DC64X_DSP |
5514a050 | 209 | endif |
07c13dfd | 210 | ifneq ($(findstring oss,$(SOUND_DRIVERS)),) |
211 | plugins/dfsound/out.o: CFLAGS += -DHAVE_OSS | |
de38f20e | 212 | OBJS += plugins/dfsound/oss.o |
213 | endif | |
07c13dfd | 214 | ifneq ($(findstring alsa,$(SOUND_DRIVERS)),) |
215 | plugins/dfsound/out.o: CFLAGS += -DHAVE_ALSA | |
de38f20e | 216 | OBJS += plugins/dfsound/alsa.o |
4132e8ca | 217 | LDLIBS += -lasound |
218 | endif | |
07c13dfd | 219 | ifneq ($(findstring sdl,$(SOUND_DRIVERS)),) |
220 | plugins/dfsound/out.o: CFLAGS += -DHAVE_SDL | |
d8a2f79b | 221 | OBJS += plugins/dfsound/sdl.o |
222 | endif | |
07c13dfd | 223 | ifneq ($(findstring pulseaudio,$(SOUND_DRIVERS)),) |
224 | plugins/dfsound/out.o: CFLAGS += -DHAVE_PULSE | |
225 | OBJS += plugins/dfsound/pulseaudio.o | |
226 | endif | |
227 | ifneq ($(findstring libretro,$(SOUND_DRIVERS)),) | |
228 | plugins/dfsound/out.o: CFLAGS += -DHAVE_LIBRETRO | |
de38f20e | 229 | endif |
230 | ||
61bc6d40 | 231 | # builtin gpu |
232 | OBJS += plugins/gpulib/gpu.o plugins/gpulib/vout_pl.o | |
61bc6d40 | 233 | ifeq "$(BUILTIN_GPU)" "neon" |
79c4d434 | 234 | CFLAGS += -DGPU_NEON |
57467c77 | 235 | OBJS += plugins/gpu_neon/psx_gpu_if.o |
90ca4913 | 236 | plugins/gpu_neon/psx_gpu_if.o: CFLAGS += -DNEON_BUILD -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP |
237 | plugins/gpu_neon/psx_gpu_if.o: plugins/gpu_neon/psx_gpu/*.c | |
57467c77 | 238 | frontend/menu.o frontend/plugin_lib.o: CFLAGS += -DBUILTIN_GPU_NEON |
239 | ifeq "$(HAVE_NEON_ASM)" "1" | |
240 | OBJS += plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.o | |
241 | else | |
242 | OBJS += plugins/gpu_neon/psx_gpu/psx_gpu_simd.o | |
243 | plugins/gpu_neon/psx_gpu_if.o: CFLAGS += -DSIMD_BUILD | |
244 | plugins/gpu_neon/psx_gpu/psx_gpu_simd.o: CFLAGS += -DSIMD_BUILD | |
245 | endif | |
61bc6d40 | 246 | endif |
247 | ifeq "$(BUILTIN_GPU)" "peops" | |
79c4d434 | 248 | CFLAGS += -DGPU_PEOPS |
2ef486ee | 249 | # note: code is not safe for strict-aliasing? (Castlevania problems) |
62d7fa95 | 250 | plugins/dfxvideo/gpulib_if.o: CFLAGS += -fno-strict-aliasing |
251 | plugins/dfxvideo/gpulib_if.o: plugins/dfxvideo/prim.c plugins/dfxvideo/soft.c | |
252 | OBJS += plugins/dfxvideo/gpulib_if.o | |
79c4d434 | 253 | ifeq "$(THREAD_RENDERING)" "1" |
254 | CFLAGS += -DTHREAD_RENDERING | |
255 | OBJS += plugins/gpulib/gpulib_thread_if.o | |
256 | endif | |
90ca4913 | 257 | endif |
e0c692d9 | 258 | |
4cfc568d | 259 | ifeq "$(BUILTIN_GPU)" "unai" |
79c4d434 | 260 | CFLAGS += -DGPU_UNAI |
261 | CFLAGS += -DUSE_GPULIB=1 | |
4cfc568d | 262 | OBJS += plugins/gpu_unai/gpulib_if.o |
0bfe8d59 | 263 | ifeq "$(ARCH)" "arm" |
4cfc568d | 264 | OBJS += plugins/gpu_unai/gpu_arm.o |
0bfe8d59 | 265 | endif |
5ddc3a7a | 266 | ifeq "$(THREAD_RENDERING)" "1" |
267 | CFLAGS += -DTHREAD_RENDERING | |
268 | OBJS += plugins/gpulib/gpulib_thread_if.o | |
269 | endif | |
270 | ifneq "$(GPU_UNAI_NO_OLD)" "1" | |
271 | OBJS += plugins/gpu_unai/old/if.o | |
272 | else | |
273 | CFLAGS += -DGPU_UNAI_NO_OLD | |
274 | endif | |
275 | plugins/gpu_unai/gpulib_if.o: CFLAGS += -DREARMED -DUSE_GPULIB=1 | |
276 | plugins/gpu_unai/gpulib_if.o \ | |
277 | plugins/gpu_unai/old/if.o: CFLAGS += -O3 | |
0bfe8d59 | 278 | CC_LINK = $(CXX) |
279 | endif | |
280 | ||
a51adab4 | 281 | # libchdr |
79c4d434 | 282 | ifeq "$(HAVE_CHD)" "1" |
58126d96 | 283 | LCHDR = deps/libchdr |
8c065899 | 284 | LCHDR_LZMA = $(LCHDR)/deps/lzma-24.05 |
285 | LCHDR_ZSTD = $(LCHDR)/deps/zstd-1.5.6/lib | |
58126d96 | 286 | OBJS += $(LCHDR)/src/libchdr_bitstream.o |
287 | OBJS += $(LCHDR)/src/libchdr_cdrom.o | |
288 | OBJS += $(LCHDR)/src/libchdr_chd.o | |
289 | OBJS += $(LCHDR)/src/libchdr_flac.o | |
290 | OBJS += $(LCHDR)/src/libchdr_huffman.o | |
a4c71501 | 291 | $(LCHDR)/src/%.o: CFLAGS += -Wno-unused -Wno-maybe-uninitialized -std=gnu11 |
58126d96 | 292 | OBJS += $(LCHDR_LZMA)/src/Alloc.o |
58126d96 | 293 | OBJS += $(LCHDR_LZMA)/src/CpuArch.o |
294 | OBJS += $(LCHDR_LZMA)/src/Delta.o | |
295 | OBJS += $(LCHDR_LZMA)/src/LzFind.o | |
58126d96 | 296 | OBJS += $(LCHDR_LZMA)/src/LzmaDec.o |
297 | OBJS += $(LCHDR_LZMA)/src/LzmaEnc.o | |
298 | OBJS += $(LCHDR_LZMA)/src/Sort.o | |
8c065899 | 299 | $(LCHDR_LZMA)/src/%.o: CFLAGS += -Wno-unused -DZ7_ST -I$(LCHDR_LZMA)/include |
58126d96 | 300 | $(LCHDR)/src/%.o: CFLAGS += -I$(LCHDR_LZMA)/include |
58126d96 | 301 | OBJS += $(LCHDR_ZSTD)/common/entropy_common.o |
302 | OBJS += $(LCHDR_ZSTD)/common/error_private.o | |
303 | OBJS += $(LCHDR_ZSTD)/common/fse_decompress.o | |
58126d96 | 304 | OBJS += $(LCHDR_ZSTD)/common/xxhash.o |
305 | OBJS += $(LCHDR_ZSTD)/common/zstd_common.o | |
306 | OBJS += $(LCHDR_ZSTD)/decompress/huf_decompress.o | |
8c065899 | 307 | OBJS += $(LCHDR_ZSTD)/decompress/huf_decompress_amd64.o |
58126d96 | 308 | OBJS += $(LCHDR_ZSTD)/decompress/zstd_ddict.o |
309 | OBJS += $(LCHDR_ZSTD)/decompress/zstd_decompress_block.o | |
310 | OBJS += $(LCHDR_ZSTD)/decompress/zstd_decompress.o | |
311 | $(LCHDR_ZSTD)/common/%.o \ | |
8c065899 | 312 | $(LCHDR_ZSTD)/decompress/%.o: CFLAGS += -I$(LCHDR_ZSTD) |
58126d96 | 313 | $(LCHDR)/src/%.o: CFLAGS += -I$(LCHDR_ZSTD) |
68e7d409 | 314 | libpcsxcore/cdriso.o: CFLAGS += -Wno-unused-function |
58126d96 | 315 | CFLAGS += -DHAVE_CHD -I$(LCHDR)/include |
79c4d434 | 316 | endif |
e906c010 | 317 | |
cc56203b | 318 | # frontend/gui |
c82f907a | 319 | OBJS += frontend/cspace.o |
57467c77 | 320 | ifeq "$(HAVE_NEON_ASM)" "1" |
c82f907a | 321 | OBJS += frontend/cspace_neon.o |
9b592b3f | 322 | frontend/cspace.o: CFLAGS += -DHAVE_bgr555_to_rgb565 -DHAVE_bgr888_to_x |
d57557c0 | 323 | else |
324 | ifeq "$(ARCH)" "arm" | |
325 | OBJS += frontend/cspace_arm.o | |
57467c77 | 326 | frontend/cspace.o: CFLAGS += -DHAVE_bgr555_to_rgb565 |
d57557c0 | 327 | endif |
c82f907a | 328 | endif |
329 | ||
4132e8ca | 330 | ifeq "$(PLATFORM)" "generic" |
5b9aa749 | 331 | OBJS += frontend/libpicofe/in_sdl.o |
332 | OBJS += frontend/libpicofe/plat_sdl.o | |
cc56203b | 333 | OBJS += frontend/libpicofe/plat_dummy.o |
334 | OBJS += frontend/libpicofe/linux/in_evdev.o | |
5b9aa749 | 335 | OBJS += frontend/plat_sdl.o |
336 | ifeq "$(HAVE_GLES)" "1" | |
2c616080 | 337 | OBJS += frontend/libpicofe/gl.o frontend/libpicofe/gl_platform.o |
5b9aa749 | 338 | LDLIBS += $(LDLIBS_GLES) |
339 | frontend/libpicofe/plat_sdl.o: CFLAGS += -DHAVE_GLES $(CFLAGS_GLES) | |
2c616080 | 340 | frontend/libpicofe/gl_platform.o: CFLAGS += -DHAVE_GLES $(CFLAGS_GLES) |
5b9aa749 | 341 | frontend/libpicofe/gl.o: CFLAGS += -DHAVE_GLES $(CFLAGS_GLES) |
342 | frontend/plat_sdl.o: CFLAGS += -DHAVE_GLES $(CFLAGS_GLES) | |
343 | endif | |
cc56203b | 344 | USE_PLUGIN_LIB = 1 |
38c2028e | 345 | USE_FRONTEND = 1 |
4132e8ca | 346 | endif |
55b0eeea | 347 | ifeq "$(PLATFORM)" "pandora" |
cc56203b | 348 | OBJS += frontend/libpicofe/pandora/plat.o |
349 | OBJS += frontend/libpicofe/linux/fbdev.o frontend/libpicofe/linux/xenv.o | |
350 | OBJS += frontend/libpicofe/linux/in_evdev.o | |
351 | OBJS += frontend/plat_pandora.o frontend/plat_omap.o | |
da710571 | 352 | frontend/main.o frontend/menu.o: CFLAGS += -include frontend/pandora/ui_feat.h |
3aba4185 | 353 | frontend/libpicofe/linux/plat.o: CFLAGS += -DPANDORA |
cc56203b | 354 | USE_PLUGIN_LIB = 1 |
38c2028e | 355 | USE_FRONTEND = 1 |
fad9f755 | 356 | CFLAGS += -gdwarf-3 |
4132e8ca | 357 | endif |
55b0eeea | 358 | ifeq "$(PLATFORM)" "caanoo" |
cc56203b | 359 | OBJS += frontend/libpicofe/gp2x/in_gp2x.o frontend/warm/warm.o |
360 | OBJS += frontend/libpicofe/gp2x/soc_pollux.o | |
361 | OBJS += frontend/libpicofe/linux/in_evdev.o | |
faf2b2aa | 362 | OBJS += frontend/plat_pollux.o frontend/in_tsbutton.o frontend/blit320.o |
da710571 | 363 | frontend/main.o frontend/menu.o: CFLAGS += -include frontend/320240/ui_gp2x.h |
cc56203b | 364 | USE_PLUGIN_LIB = 1 |
38c2028e | 365 | USE_FRONTEND = 1 |
366 | endif | |
367 | ifeq "$(PLATFORM)" "maemo" | |
baaef67b | 368 | OBJS += maemo/hildon.o maemo/main.o maemo/maemo_xkb.o frontend/pl_gun_ts.o |
38c2028e | 369 | maemo/%.o: maemo/%.c |
cc56203b | 370 | USE_PLUGIN_LIB = 1 |
a76fd953 | 371 | LDFLAGS += $(shell pkg-config --libs hildon-1 libpulse) |
7010034e | 372 | CFLAGS += $(shell pkg-config --cflags hildon-1) -DHAVE_TSLIB |
a76fd953 PI |
373 | CFLAGS += `pkg-config --cflags glib-2.0 libosso dbus-1 hildon-fm-2` |
374 | LDFLAGS += `pkg-config --libs glib-2.0 libosso dbus-1 hildon-fm-2` | |
38c2028e | 375 | endif |
376 | ifeq "$(PLATFORM)" "libretro" | |
835c219c | 377 | ifneq "$(HAVE_PHYSICAL_CDROM)$(USE_LIBRETRO_VFS)" "00" |
378 | OBJS += deps/libretro-common/compat/compat_strl.o | |
379 | OBJS += deps/libretro-common/file/file_path.o | |
380 | OBJS += deps/libretro-common/string/stdstring.o | |
381 | OBJS += deps/libretro-common/vfs/vfs_implementation.o | |
382 | endif | |
383 | ifeq "$(HAVE_PHYSICAL_CDROM)" "1" | |
e0216409 | 384 | OBJS += frontend/libretro-cdrom.o |
385 | OBJS += deps/libretro-common/lists/string_list.o | |
835c219c | 386 | OBJS += deps/libretro-common/memmap/memalign.o |
387 | OBJS += deps/libretro-common/vfs/vfs_implementation_cdrom.o | |
388 | CFLAGS += -DHAVE_CDROM | |
389 | endif | |
390 | ifeq "$(USE_LIBRETRO_VFS)" "1" | |
391 | OBJS += deps/libretro-common/compat/compat_posix_string.o | |
392 | OBJS += deps/libretro-common/compat/fopen_utf8.o | |
393 | OBJS += deps/libretro-common/encodings/encoding_utf.o | |
394 | OBJS += deps/libretro-common/streams/file_stream.o | |
395 | OBJS += deps/libretro-common/streams/file_stream_transforms.o | |
396 | OBJS += deps/libretro-common/time/rtime.o | |
397 | CFLAGS += -DUSE_LIBRETRO_VFS | |
398 | endif | |
38c2028e | 399 | OBJS += frontend/libretro.o |
46aa5b98 | 400 | CFLAGS += -DFRONTEND_SUPPORTS_RGB565 |
0b1633d7 | 401 | CFLAGS += -DHAVE_LIBRETRO |
402 | INC_LIBRETRO_COMMON := 1 | |
ce0e7ac9 | 403 | |
a4c71501 | 404 | ifneq ($(DYNAREC),lightrec) |
ce0e7ac9 | 405 | ifeq ($(MMAP_WIN32),1) |
406 | OBJS += libpcsxcore/memmap_win32.o | |
407 | endif | |
38c2028e | 408 | endif |
0b1633d7 | 409 | endif # $(PLATFORM) == "libretro" |
410 | ||
411 | ifeq "$(USE_RTHREADS)" "1" | |
412 | OBJS += frontend/libretro-rthreads.o | |
413 | OBJS += deps/libretro-common/features/features_cpu.o | |
d135f6d2 | 414 | frontend/main.o: CFLAGS += -DHAVE_RTHREADS |
0b1633d7 | 415 | INC_LIBRETRO_COMMON := 1 |
416 | endif | |
417 | ifeq "$(INC_LIBRETRO_COMMON)" "1" | |
418 | CFLAGS += -Ideps/libretro-common/include | |
a4c71501 | 419 | endif |
cc56203b | 420 | |
421 | ifeq "$(USE_PLUGIN_LIB)" "1" | |
38c2028e | 422 | OBJS += frontend/plugin_lib.o |
cc56203b | 423 | OBJS += frontend/libpicofe/linux/plat.o |
424 | OBJS += frontend/libpicofe/readpng.o frontend/libpicofe/fonts.o | |
a4da039c | 425 | frontend/libpicofe/linux/plat.o: CFLAGS += -DNO_HOME_DIR |
57467c77 | 426 | ifeq "$(HAVE_NEON_ASM)" "1" |
cc56203b | 427 | OBJS += frontend/libpicofe/arm/neon_scale2x.o |
428 | OBJS += frontend/libpicofe/arm/neon_eagle2x.o | |
429 | frontend/libpicofe/arm/neon_scale2x.o: CFLAGS += -DDO_BGR_TO_RGB | |
430 | frontend/libpicofe/arm/neon_eagle2x.o: CFLAGS += -DDO_BGR_TO_RGB | |
431 | endif | |
432 | endif | |
433 | ifeq "$(USE_FRONTEND)" "1" | |
434 | OBJS += frontend/menu.o | |
435 | OBJS += frontend/libpicofe/input.o | |
436 | frontend/menu.o: frontend/libpicofe/menu.c | |
38c2028e | 437 | ifeq "$(HAVE_TSLIB)" "1" |
438 | frontend/%.o: CFLAGS += -DHAVE_TSLIB | |
439 | OBJS += frontend/pl_gun_ts.o | |
440 | endif | |
441 | else | |
442 | CFLAGS += -DNO_FRONTEND | |
55b0eeea | 443 | endif |
a80ae4a0 | 444 | |
cc56203b | 445 | # misc |
446 | OBJS += frontend/main.o frontend/plugin.o | |
0d87d062 | 447 | frontend/main.o: CFLAGS += -DBUILTIN_GPU=$(BUILTIN_GPU) |
e0aec5ee | 448 | |
a1a232ad | 449 | frontend/menu.o frontend/main.o: frontend/revision.h |
450 | frontend/plat_sdl.o frontend/libretro.o: frontend/revision.h | |
3c70c47b | 451 | |
fad9f755 | 452 | CFLAGS += $(CFLAGS_LAST) |
453 | ||
cc56203b | 454 | frontend/libpicofe/%.c: |
fa56d360 | 455 | @echo "libpicofe module is missing, please run:" |
456 | @echo "git submodule init && git submodule update" | |
457 | @exit 1 | |
458 | ||
59774ed0 | 459 | libpcsxcore/gte_nf.o: libpcsxcore/gte.c |
460 | $(CC) -c -o $@ $^ $(CFLAGS) -DFLAGLESS | |
461 | ||
3c70c47b | 462 | frontend/revision.h: FORCE |
4527b1fd | 463 | @(git describe --always || echo) | sed -e 's/.*/#define REV "\0"/' > $@_ |
3c70c47b | 464 | @diff -q $@_ $@ > /dev/null 2>&1 || cp $@_ $@ |
465 | @rm $@_ | |
3c70c47b | 466 | |
90ca4913 | 467 | %.o: %.S |
9aff1963 | 468 | $(CC_AS) $(CFLAGS) -c $^ -o $@ |
80c2304e | 469 | |
e0aec5ee | 470 | |
38c2028e | 471 | target_: $(TARGET) |
472 | ||
80c2304e | 473 | $(TARGET): $(OBJS) |
20a25fd7 | 474 | ifeq ($(PARTIAL_LINKING), 1) |
a6a0a4d3 | 475 | $(LD) -o $(basename $(TARGET))1.o -r --gc-sections $(addprefix -u , $(shell cat frontend/libretro-extern)) $^ |
20a25fd7 | 476 | $(OBJCOPY) --keep-global-symbols=frontend/libretro-extern $(basename $(TARGET))1.o $(basename $(TARGET)).o |
477 | $(AR) rcs $@ $(basename $(TARGET)).o | |
478 | else ifeq ($(STATIC_LINKING), 1) | |
479 | $(AR) rcs $@ $^ | |
480 | else | |
07f64ac7 | 481 | $(CC_LINK) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) $(EXTRA_LDFLAGS) |
20a25fd7 | 482 | endif |
80c2304e | 483 | |
dd4d5a35 | 484 | clean: $(PLAT_CLEAN) clean_plugins |
20a25fd7 | 485 | $(RM) $(TARGET) *.o $(OBJS) $(TARGET).map frontend/revision.h |
0d464c77 | 486 | |
4132e8ca | 487 | ifneq ($(PLUGINS),) |
dd4d5a35 | 488 | plugins_: $(PLUGINS) |
489 | ||
ee78346e | 490 | $(PLUGINS): |
4cccc4d2 | 491 | $(MAKE) -C $(dir $@) |
f932e54b | 492 | |
ee78346e | 493 | clean_plugins: |
4cccc4d2 | 494 | $(MAKE) -C plugins/gpulib/ clean |
ee78346e | 495 | for dir in $(PLUGINS) ; do \ |
496 | $(MAKE) -C $$(dirname $$dir) clean; done | |
dd4d5a35 | 497 | else |
498 | plugins_: | |
499 | clean_plugins: | |
4132e8ca | 500 | endif |
80c2304e | 501 | |
fa56d360 | 502 | .PHONY: all clean target_ plugins_ clean_plugins FORCE |
503 | ||
857275a9 | 504 | ifneq "$(PLATFORM)" "pandora" |
505 | ifdef CPATH | |
506 | $(warning warning: CPATH is defined) | |
507 | endif | |
508 | endif | |
509 | ||
303ee308 | 510 | # ----------- release ----------- |
511 | ||
4527b1fd | 512 | VER ?= $(shell git describe --always HEAD) |
4132e8ca | 513 | |
dd4d5a35 | 514 | ifeq "$(PLATFORM)" "generic" |
515 | OUT = pcsx_rearmed_$(VER) | |
516 | ||
517 | rel: pcsx $(PLUGINS) \ | |
518 | frontend/pandora/skin readme.txt COPYING | |
519 | rm -rf $(OUT) | |
520 | mkdir -p $(OUT)/plugins | |
521 | mkdir -p $(OUT)/bios | |
522 | cp -r $^ $(OUT)/ | |
523 | mv $(OUT)/*.so* $(OUT)/plugins/ | |
524 | zip -9 -r $(OUT).zip $(OUT) | |
525 | endif | |
526 | ||
4132e8ca | 527 | ifeq "$(PLATFORM)" "pandora" |
303ee308 | 528 | PND_MAKE ?= $(HOME)/dev/pnd/src/pandora-libraries/testdata/scripts/pnd_make.sh |
529 | ||
8886a808 | 530 | rel: pcsx plugins/dfsound/pcsxr_spu_area3.out $(PLUGINS) \ |
9e0630ab | 531 | frontend/pandora/pcsx.sh frontend/pandora/pcsx.pxml.templ frontend/pandora/pcsx.png \ |
532 | frontend/pandora/picorestore frontend/pandora/skin readme.txt COPYING | |
303ee308 | 533 | rm -rf out |
bbd837c6 | 534 | mkdir -p out/plugins |
303ee308 | 535 | cp -r $^ out/ |
3938f69a | 536 | sed -e 's/%PR%/$(VER)/g' out/pcsx.pxml.templ > out/pcsx.pxml |
537 | rm out/pcsx.pxml.templ | |
bbd837c6 | 538 | mv out/*.so out/plugins/ |
9e0630ab | 539 | $(PND_MAKE) -p pcsx_rearmed_$(VER).pnd -d out -x out/pcsx.pxml -i frontend/pandora/pcsx.png -c |
4132e8ca | 540 | endif |
541 | ||
542 | ifeq "$(PLATFORM)" "caanoo" | |
543 | PLAT_CLEAN = caanoo_clean | |
544 | ||
545 | caanoo_clean: | |
546 | $(RM) frontend/320240/pollux_set | |
547 | ||
4132e8ca | 548 | rel: pcsx $(PLUGINS) \ |
549 | frontend/320240/caanoo.gpe frontend/320240/pcsx26.png \ | |
550 | frontend/320240/pcsxb.png frontend/320240/skin \ | |
551 | frontend/warm/bin/warm_2.6.24.ko frontend/320240/pollux_set \ | |
552 | frontend/320240/pcsx_rearmed.ini frontend/320240/haptic_w.cfg \ | |
553 | frontend/320240/haptic_s.cfg \ | |
554 | readme.txt COPYING | |
555 | rm -rf out | |
556 | mkdir -p out/pcsx_rearmed/plugins | |
557 | cp -r $^ out/pcsx_rearmed/ | |
4132e8ca | 558 | mv out/pcsx_rearmed/*.so out/pcsx_rearmed/plugins/ |
559 | mv out/pcsx_rearmed/caanoo.gpe out/pcsx_rearmed/pcsx.gpe | |
560 | mv out/pcsx_rearmed/pcsx_rearmed.ini out/ | |
561 | mkdir out/pcsx_rearmed/lib/ | |
562 | cp ./lib/libbz2.so.1 out/pcsx_rearmed/lib/ | |
563 | mkdir out/pcsx_rearmed/bios/ | |
564 | cd out && zip -9 -r ../pcsx_rearmed_$(VER)_caanoo.zip * | |
565 | endif |