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