1 # Makefile for PCSX ReARMed
3 # default stuff goes here, so that config can override
5 CFLAGS += -Wall -Iinclude -ffast-math
11 ifneq ($(DEBUG)$(DEBUG_SYMS), 00)
20 ifeq ($(LOG_UNHANDLED), 1)
21 CFLAGS += -DLOG_UNHANDLED
24 AUTODEPFLAGS += -MMD -MP
26 ifeq ($(DEBUG_ASAN), 1)
27 CFLAGS += -fsanitize=address
28 LDFLAGS += -fsanitize=address
29 #LDFLAGS += -static-libasan
31 ifeq ($(DEBUG_UBSAN), 1)
32 CFLAGS += -fsanitize=undefined -fno-sanitize=shift-base
33 LDFLAGS += -fsanitize=undefined
38 # Suppress minor warnings for dependencies
39 deps/%: CFLAGS += -Wno-unused -Wno-unused-function
41 all: config.mak target_ plugins_
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
51 @echo "Please run ./configure before running make!"
58 -include Makefile.local
62 LDFLAGS += $(MAIN_LDFLAGS)
63 #EXTRA_LDFLAGS ?= -Wl,-Map=$@.map # not on some linkers
64 LDLIBS += $(MAIN_LDLIBS)
69 ifneq ($(NO_FSECTIONS), 1)
70 CFLAGS += -ffunction-sections -fdata-sections
71 ifeq ($(GNU_LINKER),1)
72 FSECTIONS_LDFLAGS ?= -Wl,--gc-sections
73 LDFLAGS += $(FSECTIONS_LDFLAGS)
76 CFLAGS += -DP_HAVE_MMAP=$(if $(NO_MMAP),0,1) \
77 -DP_HAVE_PTHREAD=$(if $(NO_PTHREAD),0,1) \
78 -DP_HAVE_POSIX_MEMALIGN=$(if $(NO_POSIX_MEMALIGN),0,1) \
83 OBJS += libpcsxcore/cdriso.o libpcsxcore/cdrom.o libpcsxcore/cdrom-async.o \
84 libpcsxcore/cheat.o libpcsxcore/database.o \
85 libpcsxcore/decode_xa.o libpcsxcore/mdec.o \
86 libpcsxcore/misc.o libpcsxcore/plugins.o libpcsxcore/ppf.o libpcsxcore/psxbios.o \
87 libpcsxcore/psxcommon.o libpcsxcore/psxcounters.o libpcsxcore/psxdma.o \
88 libpcsxcore/psxhw.o libpcsxcore/psxinterpreter.o libpcsxcore/psxmem.o \
89 libpcsxcore/psxevents.o libpcsxcore/r3000a.o \
90 libpcsxcore/sio.o libpcsxcore/spu.o libpcsxcore/gpu.o
91 OBJS += libpcsxcore/gte.o libpcsxcore/gte_nf.o libpcsxcore/gte_divider.o
92 #OBJS += libpcsxcore/debug.o libpcsxcore/socket.o libpcsxcore/disr3000a.o
95 ZLIB_DIR = deps/libchdr/deps/zlib-1.3.1
96 CFLAGS += -I$(ZLIB_DIR)
97 OBJS += $(ZLIB_DIR)/adler32.o \
98 $(ZLIB_DIR)/compress.o \
100 $(ZLIB_DIR)/deflate.o \
101 $(ZLIB_DIR)/gzclose.o \
102 $(ZLIB_DIR)/gzlib.o \
103 $(ZLIB_DIR)/gzread.o \
104 $(ZLIB_DIR)/gzwrite.o \
105 $(ZLIB_DIR)/infback.o \
106 $(ZLIB_DIR)/inffast.o \
107 $(ZLIB_DIR)/inflate.o \
108 $(ZLIB_DIR)/inftrees.o \
109 $(ZLIB_DIR)/trees.o \
110 $(ZLIB_DIR)/uncompr.o \
112 $(ZLIB_DIR)/%.o: CFLAGS += -DHAVE_UNISTD_H
116 OBJS += libpcsxcore/gte_arm.o
118 ifeq "$(HAVE_NEON_ASM)" "1"
119 OBJS += libpcsxcore/gte_neon.o
121 libpcsxcore/psxbios.o: CFLAGS += -Wno-nonnull
123 ifeq ($(MMAP_WIN32),1)
124 CFLAGS += -Iinclude/mman -Ideps/mman
125 OBJS += deps/mman/mman.o
127 ifeq "$(USE_ASYNC_CDROM)" "1"
128 libpcsxcore/cdrom-async.o: CFLAGS += -DUSE_ASYNC_CDROM
129 frontend/libretro.o: CFLAGS += -DUSE_ASYNC_CDROM
130 frontend/menu.o: CFLAGS += -DUSE_ASYNC_CDROM
133 ifeq "$(USE_ASYNC_GPU)" "1"
134 frontend/libretro.o: CFLAGS += -DUSE_ASYNC_GPU
135 frontend/menu.o: CFLAGS += -DUSE_ASYNC_GPU
140 ifeq "$(DYNAREC)" "lightrec"
141 CFLAGS += -Ideps/lightning/include -Ideps/lightrec -Iinclude/lightning -Iinclude/lightrec \
142 -DLIGHTREC -DLIGHTREC_STATIC
143 ifeq ($(LIGHTREC_DEBUG),1)
144 deps/lightrec/%.o: CFLAGS += -DLOG_LEVEL=DEBUG_L
145 libpcsxcore/lightrec/plugin.o: CFLAGS += -DLIGHTREC_DEBUG=1
146 frontend/main.o: CFLAGS += -DLIGHTREC_DEBUG=1
147 deps/lightning/%.o: CFLAGS += -DDISASSEMBLER=1 -DBINUTILS_2_38=1 -DBINUTILS_2_29=1 \
148 -DHAVE_DISASSEMBLE_INIT_FOR_TARGET=1 -DPACKAGE_VERSION=1
149 LDFLAGS += -lopcodes -lbfd
151 LIGHTREC_CUSTOM_MAP ?= 0
152 LIGHTREC_CUSTOM_MAP_OBJ ?= libpcsxcore/lightrec/mem.o
153 LIGHTREC_THREADED_COMPILER ?= 0
154 LIGHTREC_CODE_INV ?= 0
155 CFLAGS += -DLIGHTREC_CUSTOM_MAP=$(LIGHTREC_CUSTOM_MAP) \
156 -DLIGHTREC_CODE_INV=$(LIGHTREC_CODE_INV) \
157 -DLIGHTREC_ENABLE_THREADED_COMPILER=$(LIGHTREC_THREADED_COMPILER) \
158 -DLIGHTREC_ENABLE_DISASSEMBLER=$(or $(LIGHTREC_DEBUG),0) \
159 -DLIGHTREC_NO_DEBUG=$(if $(LIGHTREC_DEBUG),0,1)
160 ifeq ($(LIGHTREC_CUSTOM_MAP),1)
162 OBJS += $(LIGHTREC_CUSTOM_MAP_OBJ)
164 ifeq ($(NEED_SYSCONF),1)
165 OBJS += libpcsxcore/lightrec/sysconf.o
167 ifeq ($(LIGHTREC_THREADED_COMPILER),1)
168 OBJS += deps/lightrec/recompiler.o \
169 deps/lightrec/reaper.o
171 OBJS += deps/lightrec/tlsf/tlsf.o
172 OBJS += libpcsxcore/lightrec/plugin.o
173 OBJS += deps/lightning/lib/jit_disasm.o \
174 deps/lightning/lib/jit_memory.o \
175 deps/lightning/lib/jit_names.o \
176 deps/lightning/lib/jit_note.o \
177 deps/lightning/lib/jit_print.o \
178 deps/lightning/lib/jit_size.o \
179 deps/lightning/lib/lightning.o \
180 deps/lightrec/blockcache.o \
181 deps/lightrec/constprop.o \
182 deps/lightrec/disassembler.o \
183 deps/lightrec/emitter.o \
184 deps/lightrec/interpreter.o \
185 deps/lightrec/lightrec.o \
186 deps/lightrec/memmanager.o \
187 deps/lightrec/optimizer.o \
188 deps/lightrec/regcache.o
189 deps/lightning/%.o: CFLAGS += -DHAVE_MMAP=P_HAVE_MMAP
190 deps/lightning/%: CFLAGS += -Wno-uninitialized
191 deps/lightrec/%: CFLAGS += -Wno-uninitialized
192 libpcsxcore/lightrec/mem.o: CFLAGS += -D_GNU_SOURCE
193 ifeq ($(MMAP_WIN32),1)
194 deps/lightning/lib/lightning.o: CFLAGS += -Dmprotect=_mprotect # deps/mman
195 deps/lightning/lib/jit_print.o: CFLAGS += -w
197 else ifeq "$(DYNAREC)" "ari64"
198 OBJS += libpcsxcore/new_dynarec/new_dynarec.o
199 OBJS += libpcsxcore/new_dynarec/pcsxmem.o
201 OBJS += libpcsxcore/new_dynarec/linkage_arm.o
202 else ifneq (,$(findstring $(ARCH),aarch64 arm64))
203 OBJS += libpcsxcore/new_dynarec/linkage_arm64.o
205 $(error no dynarec support for architecture $(ARCH))
207 ifeq "$(NDRC_THREAD)" "1"
208 libpcsxcore/new_dynarec/new_dynarec.o: CFLAGS += -DNDRC_THREAD
209 libpcsxcore/new_dynarec/emu_if.o: CFLAGS += -DNDRC_THREAD
210 frontend/libretro.o: CFLAGS += -DNDRC_THREAD
214 CFLAGS += -DDRC_DISABLE
216 OBJS += libpcsxcore/new_dynarec/emu_if.o
218 libpcsxcore/new_dynarec/emu_if.o: CFLAGS += -D_FILE_OFFSET_BITS=64
221 ifeq "$(BASE_ADDR_DYNAMIC)" "1"
222 libpcsxcore/new_dynarec/%.o: CFLAGS += -DBASE_ADDR_DYNAMIC=1
226 OBJS += plugins/dfsound/dma.o plugins/dfsound/freeze.o \
227 plugins/dfsound/registers.o plugins/dfsound/spu.o \
228 plugins/dfsound/out.o plugins/dfsound/nullsnd.o
230 OBJS += plugins/dfsound/arm_utils.o
232 ifeq "$(HAVE_C64_TOOLS)" "1"
233 plugins/dfsound/%.o: CFLAGS += -DC64X_DSP -DWANT_THREAD_CODE
234 frontend/menu.o: CFLAGS += -DC64X_DSP
236 ifneq ($(findstring oss,$(SOUND_DRIVERS)),)
237 plugins/dfsound/out.o: CFLAGS += -DHAVE_OSS
238 OBJS += plugins/dfsound/oss.o
240 ifneq ($(findstring alsa,$(SOUND_DRIVERS)),)
241 plugins/dfsound/out.o: CFLAGS += -DHAVE_ALSA
242 OBJS += plugins/dfsound/alsa.o
245 ifneq ($(findstring sdl,$(SOUND_DRIVERS)),)
246 plugins/dfsound/out.o: CFLAGS += -DHAVE_SDL
247 OBJS += plugins/dfsound/sdl.o
249 ifneq ($(findstring pulseaudio,$(SOUND_DRIVERS)),)
250 plugins/dfsound/out.o: CFLAGS += -DHAVE_PULSE
251 OBJS += plugins/dfsound/pulseaudio.o
253 ifneq ($(findstring libretro,$(SOUND_DRIVERS)),)
254 plugins/dfsound/out.o: CFLAGS += -DHAVE_LIBRETRO
257 # supported gpu list in menu
258 ifeq "$(HAVE_NEON_GPU)" "1"
259 frontend/menu.o: CFLAGS += -DGPU_NEON
261 ifeq "$(HAVE_GLES)" "1"
262 frontend/menu.o: CFLAGS += -DHAVE_GLES
266 OBJS += plugins/gpulib/gpu.o plugins/gpulib/vout_pl.o plugins/gpulib/prim.o
267 ifeq "$(USE_ASYNC_GPU)" "1"
268 OBJS += plugins/gpulib/gpu_async.o
269 plugins/gpulib/%.o: CFLAGS += -DUSE_ASYNC_GPU
271 ifeq "$(BUILTIN_GPU)" "neon"
273 OBJS += plugins/gpu_neon/psx_gpu_if.o
274 plugins/gpu_neon/psx_gpu_if.o: CFLAGS += -DNEON_BUILD -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP
275 frontend/menu.o frontend/plugin_lib.o: CFLAGS += -DBUILTIN_GPU_NEON
276 ifeq "$(HAVE_NEON_ASM)" "1"
277 OBJS += plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.o
279 OBJS += plugins/gpu_neon/psx_gpu/psx_gpu_simd.o
280 plugins/gpu_neon/psx_gpu_if.o: CFLAGS += -DSIMD_BUILD
281 plugins/gpu_neon/psx_gpu/psx_gpu_simd.o: CFLAGS += -DSIMD_BUILD
284 ifeq "$(BUILTIN_GPU)" "peops"
285 CFLAGS += -DGPU_PEOPS
286 # note: code is not safe for strict-aliasing? (Castlevania problems)
287 plugins/dfxvideo/gpulib_if.o: CFLAGS += -fno-strict-aliasing
288 frontend/menu.o frontend/plugin_lib.o: CFLAGS += -DBUILTIN_GPU_PEOPS
289 OBJS += plugins/dfxvideo/gpulib_if.o
292 ifeq "$(BUILTIN_GPU)" "unai"
294 CFLAGS += -DUSE_GPULIB=1
295 OBJS += plugins/gpu_unai/gpulib_if.o
297 OBJS += plugins/gpu_unai/gpu_arm.o
299 ifneq "$(GPU_UNAI_NO_OLD)" "1"
300 OBJS += plugins/gpu_unai/old/if.o
302 CFLAGS += -DGPU_UNAI_NO_OLD
304 plugins/gpu_unai/gpulib_if.o: plugins/gpu_unai/*.h
305 plugins/gpu_unai/gpulib_if.o: CFLAGS += -DREARMED -DUSE_GPULIB=1
306 frontend/menu.o frontend/plugin_lib.o: CFLAGS += -DBUILTIN_GPU_UNAI
308 plugins/gpu_unai/gpulib_if.o \
309 plugins/gpu_unai/old/if.o: CFLAGS += -O3
315 ifeq "$(HAVE_CHD)" "1"
317 LCHDR_LZMA = $(LCHDR)/deps/lzma-24.05
318 LCHDR_ZSTD = $(LCHDR)/deps/zstd-1.5.6/lib
319 OBJS += $(LCHDR)/src/libchdr_bitstream.o
320 OBJS += $(LCHDR)/src/libchdr_cdrom.o
321 OBJS += $(LCHDR)/src/libchdr_chd.o
322 OBJS += $(LCHDR)/src/libchdr_flac.o
323 OBJS += $(LCHDR)/src/libchdr_huffman.o
324 $(LCHDR)/src/%.o: CFLAGS += -Wno-unused -Wno-maybe-uninitialized -std=gnu11
325 OBJS += $(LCHDR_LZMA)/src/Alloc.o
326 OBJS += $(LCHDR_LZMA)/src/CpuArch.o
327 OBJS += $(LCHDR_LZMA)/src/Delta.o
328 OBJS += $(LCHDR_LZMA)/src/LzFind.o
329 OBJS += $(LCHDR_LZMA)/src/LzmaDec.o
330 OBJS += $(LCHDR_LZMA)/src/LzmaEnc.o
331 OBJS += $(LCHDR_LZMA)/src/Sort.o
332 $(LCHDR_LZMA)/src/%.o: CFLAGS += -Wno-unused -DZ7_ST -I$(LCHDR_LZMA)/include
333 $(LCHDR)/src/%.o: CFLAGS += -I$(LCHDR_LZMA)/include
334 OBJS += $(LCHDR_ZSTD)/common/entropy_common.o
335 OBJS += $(LCHDR_ZSTD)/common/error_private.o
336 OBJS += $(LCHDR_ZSTD)/common/fse_decompress.o
337 OBJS += $(LCHDR_ZSTD)/common/xxhash.o
338 OBJS += $(LCHDR_ZSTD)/common/zstd_common.o
339 OBJS += $(LCHDR_ZSTD)/decompress/huf_decompress.o
340 OBJS += $(LCHDR_ZSTD)/decompress/huf_decompress_amd64.o
341 OBJS += $(LCHDR_ZSTD)/decompress/zstd_ddict.o
342 OBJS += $(LCHDR_ZSTD)/decompress/zstd_decompress_block.o
343 OBJS += $(LCHDR_ZSTD)/decompress/zstd_decompress.o
344 $(LCHDR_ZSTD)/common/%.o \
345 $(LCHDR_ZSTD)/decompress/%.o: CFLAGS += -I$(LCHDR_ZSTD)
346 $(LCHDR)/src/%.o: CFLAGS += -I$(LCHDR_ZSTD)
347 libpcsxcore/cdriso.o: CFLAGS += -Wno-unused-function
348 CFLAGS += -DHAVE_CHD -I$(LCHDR)/include
352 OBJS += frontend/cspace.o
353 ifeq "$(HAVE_NEON_ASM)" "1"
354 OBJS += frontend/cspace_neon.o
355 frontend/cspace.o: CFLAGS += -DHAVE_bgr555_to_rgb565 -DHAVE_bgr888_to_x
358 OBJS += frontend/cspace_arm.o
359 frontend/cspace.o: CFLAGS += -DHAVE_bgr555_to_rgb565
363 ifeq "$(PLATFORM)" "generic"
364 OBJS += frontend/libpicofe/in_sdl.o
365 #OBJS += frontend/libpicofe/plat_sdl.o
366 OBJS += frontend/libpicofe/plat_dummy.o
367 OBJS += frontend/plat_sdl.o
368 frontend/plat_sdl.o frontend/libpicofe/plat_sdl.o: CFLAGS += -DSDL_OVERLAY_2X
369 frontend/menu.o: CFLAGS += -DSDL_OVERLAY_2X -DMENU_SHOW_VARSCALER=1
370 ifeq "$(HAVE_EVDEV)" "1"
371 OBJS += frontend/libpicofe/linux/in_evdev.o
373 ifeq "$(HAVE_GLES)" "1"
374 OBJS += frontend/libpicofe/gl.o frontend/libpicofe/gl_platform.o
375 OBJS += frontend/libpicofe/gl_loader.o
376 #LDLIBS += $(LDLIBS_GLES) # loaded dynamically now
377 frontend/libpicofe/plat_sdl.o: CFLAGS += -DHAVE_GLES $(CFLAGS_GLES)
378 frontend/libpicofe/gl_platform.o: CFLAGS += -DHAVE_GLES $(CFLAGS_GLES)
379 frontend/libpicofe/gl.o: CFLAGS += -DHAVE_GLES $(CFLAGS_GLES)
380 frontend/plat_sdl.o: CFLAGS += -DHAVE_GLES $(CFLAGS_GLES)
385 ifeq "$(PLATFORM)" "pandora"
386 OBJS += frontend/libpicofe/pandora/plat.o
387 OBJS += frontend/libpicofe/linux/fbdev.o frontend/libpicofe/linux/xenv.o
388 OBJS += frontend/libpicofe/linux/in_evdev.o
389 OBJS += frontend/plat_pandora.o frontend/plat_omap.o
390 frontend/main.o frontend/menu.o: CFLAGS += -include frontend/pandora/ui_feat.h
391 frontend/main.o frontend/plugin_lib.o: CFLAGS += -DPANDORA
392 frontend/libpicofe/linux/plat.o: CFLAGS += -DPANDORA
397 ifeq "$(PLATFORM)" "caanoo"
398 OBJS += frontend/libpicofe/gp2x/in_gp2x.o frontend/warm/warm.o
399 OBJS += frontend/libpicofe/gp2x/soc_pollux.o
400 OBJS += frontend/libpicofe/linux/in_evdev.o
401 OBJS += frontend/plat_pollux.o frontend/in_tsbutton.o frontend/blit320.o
402 frontend/main.o frontend/menu.o: CFLAGS += -include frontend/320240/ui_gp2x.h
406 ifeq "$(PLATFORM)" "miyoo"
408 OBJS += frontend/libpicofe/in_sdl.o
409 OBJS += frontend/libpicofe/linux/in_evdev.o
410 OBJS += frontend/libpicofe/plat_dummy.o
411 OBJS += frontend/plat_sdl.o
412 frontend/main.o frontend/menu.o: CFLAGS += -include frontend/320240/ui_miyoo.h
416 ifeq "$(PLATFORM)" "maemo"
417 OBJS += maemo/hildon.o maemo/main.o maemo/maemo_xkb.o frontend/pl_gun_ts.o
419 LDFLAGS += $(shell pkg-config --libs hildon-1 libpulse)
420 CFLAGS += $(shell pkg-config --cflags hildon-1) -DHAVE_TSLIB
421 CFLAGS += `pkg-config --cflags glib-2.0 libosso dbus-1 hildon-fm-2`
422 LDFLAGS += `pkg-config --libs glib-2.0 libosso dbus-1 hildon-fm-2`
424 ifeq "$(PLATFORM)" "libretro"
425 ifneq "$(HAVE_PHYSICAL_CDROM)$(USE_LIBRETRO_VFS)" "00"
426 OBJS += deps/libretro-common/compat/compat_strl.o
427 OBJS += deps/libretro-common/file/file_path.o
428 OBJS += deps/libretro-common/string/stdstring.o
429 OBJS += deps/libretro-common/vfs/vfs_implementation.o
431 ifeq "$(HAVE_PHYSICAL_CDROM)" "1"
432 OBJS += frontend/libretro-cdrom.o
433 OBJS += deps/libretro-common/lists/string_list.o
434 OBJS += deps/libretro-common/memmap/memalign.o
435 OBJS += deps/libretro-common/vfs/vfs_implementation_cdrom.o
436 CFLAGS += -DHAVE_CDROM
438 ifeq "$(USE_LIBRETRO_VFS)" "1"
439 OBJS += deps/libretro-common/compat/compat_posix_string.o
440 OBJS += deps/libretro-common/compat/fopen_utf8.o
441 OBJS += deps/libretro-common/encodings/encoding_utf.o
442 OBJS += deps/libretro-common/streams/file_stream.o
443 OBJS += deps/libretro-common/streams/file_stream_transforms.o
444 OBJS += deps/libretro-common/time/rtime.o
445 CFLAGS += -DUSE_LIBRETRO_VFS
447 OBJS += frontend/libretro.o
448 CFLAGS += -DHAVE_LIBRETRO
449 INC_LIBRETRO_COMMON := 1
451 endif # $(PLATFORM) == "libretro"
453 ifeq "$(USE_RTHREADS)" "1"
454 OBJS += frontend/pcsxr-threads.o
455 OBJS += deps/libretro-common/features/features_cpu.o
456 frontend/main.o: CFLAGS += -DHAVE_RTHREADS
457 INC_LIBRETRO_COMMON := 1
459 ifeq "$(INC_LIBRETRO_COMMON)" "1"
460 CFLAGS += -Ideps/libretro-common/include
463 ifeq "$(USE_PLUGIN_LIB)" "1"
464 OBJS += frontend/plugin_lib.o
465 OBJS += frontend/libpicofe/linux/plat.o
466 OBJS += frontend/libpicofe/readpng.o frontend/libpicofe/fonts.o
467 frontend/libpicofe/linux/plat.o: CFLAGS += -DNO_HOME_DIR
468 ifeq "$(HAVE_NEON_ASM)" "1"
469 OBJS += frontend/libpicofe/arm/neon_scale2x.o
470 OBJS += frontend/libpicofe/arm/neon_eagle2x.o
471 frontend/libpicofe/arm/neon_scale2x.o: CFLAGS += -DDO_BGR_TO_RGB
472 frontend/libpicofe/arm/neon_eagle2x.o: CFLAGS += -DDO_BGR_TO_RGB
475 ifeq "$(USE_FRONTEND)" "1"
476 OBJS += frontend/menu.o
477 OBJS += frontend/libpicofe/input.o
478 frontend/libpicofe/input.o: CFLAGS += -Wno-array-bounds
479 ifeq "$(HAVE_TSLIB)" "1"
480 frontend/%.o: CFLAGS += -DHAVE_TSLIB
481 OBJS += frontend/pl_gun_ts.o
484 CFLAGS += -DNO_FRONTEND
488 OBJS += frontend/main.o frontend/plugin.o
489 frontend/main.o libpcsxcore/misc.o: CFLAGS += -DBUILTIN_GPU=$(BUILTIN_GPU)
491 frontend/menu.o frontend/main.o: include/revision.h
492 frontend/plat_sdl.o frontend/libretro.o: include/revision.h
493 libpcsxcore/misc.o: include/revision.h
495 CFLAGS += $(CFLAGS_LAST)
497 frontend/libpicofe/%.c:
498 @echo "libpicofe module is missing, please run:"
499 @echo "git submodule init && git submodule update"
502 libpcsxcore/gte_nf.o: libpcsxcore/gte.c
503 $(CC) -c -o $@ $< $(CFLAGS) $(AUTODEPFLAGS) -DFLAGLESS
505 include/revision.h: FORCE
506 @(git describe --always || echo) | sed -e 's/.*/#define REV "\0"/' > $@_
507 @diff -q $@_ $@ > /dev/null 2>&1 || cp $@_ $@
511 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(AUTODEPFLAGS) -c $< -o $@
514 $(CC) $(CPPFLAGS) $(CFLAGS) $(AUTODEPFLAGS) -c $< -o $@
517 $(CC_AS) $(CPPFLAGS) $(CFLAGS) $(AUTODEPFLAGS) -c $< -o $@
523 ifeq ($(PARTIAL_LINKING), 1)
524 $(LD) -o $(basename $(TARGET))1.o -r --gc-sections $(addprefix -u ,$(shell cat frontend/libretro-extern)) $(addprefix -u ,$(EXTRA_EXTERN_SYMS)) $^
525 $(OBJCOPY) --keep-global-symbols=frontend/libretro-extern $(addprefix -G ,$(EXTRA_EXTERN_SYMS)) $(basename $(TARGET))1.o $(basename $(TARGET)).o
526 $(AR) rcs $@ $(basename $(TARGET)).o
527 else ifeq ($(STATIC_LINKING), 1)
530 $(CC_LINK) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) $(EXTRA_LDFLAGS)
533 clean: $(PLAT_CLEAN) clean_plugins
534 $(RM) $(TARGET) *.o $(OBJS) $(OBJS:.o=.d) $(TARGET).map include/revision.h
539 plugins/gpulib/gpulib.$(ARCH).a:
540 $(MAKE) -C plugins/gpulib/
542 $(PLUGINS): plugins/gpulib/gpulib.$(ARCH).a
546 $(MAKE) -C plugins/gpulib/ clean
547 for dir in $(PLUGINS) ; do \
548 $(MAKE) -C $$(dirname $$dir) clean; done
556 -include $(OBJS:.o=.d)
559 .PHONY: all clean target_ plugins_ clean_plugins FORCE
561 ifneq "$(PLATFORM)" "pandora"
563 $(warning warning: CPATH is defined)
567 # ----------- release -----------
569 VER ?= $(shell git describe --always HEAD)
571 ifeq "$(PLATFORM)" "generic"
572 OUT = pcsx_rearmed_$(VER)
574 rel: pcsx $(PLUGINS) \
575 frontend/pandora/skin README.md COPYING
577 mkdir -p $(OUT)/plugins
580 -mv $(OUT)/*.so* $(OUT)/plugins/
581 zip -9 -r $(OUT).zip $(OUT)
584 ifeq "$(PLATFORM)" "pandora"
585 PND_MAKE ?= $(HOME)/dev/pnd/src/pandora-libraries/testdata/scripts/pnd_make.sh
587 rel: pcsx plugins/dfsound/pcsxr_spu_area3.out $(PLUGINS) \
588 frontend/pandora/pcsx.sh frontend/pandora/pcsx.pxml.templ frontend/pandora/pcsx.png \
589 frontend/pandora/picorestore frontend/pandora/skin frontend/pandora/readme.txt COPYING
593 sed -e 's/%PR%/$(VER)/g' out/pcsx.pxml.templ > out/pcsx.pxml
594 rm out/pcsx.pxml.templ
595 -mv out/*.so out/plugins/
596 $(PND_MAKE) -p pcsx_rearmed_$(VER).pnd -d out -x out/pcsx.pxml -i frontend/pandora/pcsx.png -c
599 ifeq "$(PLATFORM)" "miyoo"
601 rel: pcsx $(PLUGINS) \
602 frontend/320240/pcsx26.png \
603 frontend/320240/skin \
606 mkdir -p out/pcsx_rearmed/plugins
607 cp -r $^ out/pcsx_rearmed/
608 -mv out/pcsx_rearmed/*.so out/pcsx_rearmed/plugins/
609 mkdir out/pcsx_rearmed/lib/
610 mkdir out/pcsx_rearmed/bios/
611 cd out && zip -9 -r ../pcsx_rearmed_$(VER)_miyoo.zip *
614 VERSION="$(VER)" gm2xpkg -q -f miyoo/pkg.cfg
615 mv pcsx.ipk pcsx_rearmed.ipk
618 ifeq "$(PLATFORM)" "caanoo"
619 PLAT_CLEAN = caanoo_clean
622 $(RM) frontend/320240/pollux_set
624 rel: pcsx $(PLUGINS) \
625 frontend/320240/caanoo.gpe frontend/320240/pcsx26.png \
626 frontend/320240/pcsxb.png frontend/320240/skin \
627 frontend/warm/bin/warm_2.6.24.ko frontend/320240/pollux_set \
628 frontend/320240/pcsx_rearmed.ini frontend/320240/haptic_w.cfg \
629 frontend/320240/haptic_s.cfg \
632 mkdir -p out/pcsx_rearmed/plugins
633 cp -r $^ out/pcsx_rearmed/
634 -mv out/pcsx_rearmed/*.so out/pcsx_rearmed/plugins/
635 mv out/pcsx_rearmed/caanoo.gpe out/pcsx_rearmed/pcsx.gpe
636 mv out/pcsx_rearmed/pcsx_rearmed.ini out/
637 mkdir out/pcsx_rearmed/lib/
638 cp ./lib/libbz2.so.1 out/pcsx_rearmed/lib/
639 mkdir out/pcsx_rearmed/bios/
640 cd out && zip -9 -r ../pcsx_rearmed_$(VER)_caanoo.zip *