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