X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Makefile;h=f293903af69c519c10d0fdeab4d2540f0edbcc6d;hb=e2fb1389dc12376acb84e4993ed3b08760257252;hp=d1585a17594b8664bab62f94fe3633fa8ac5cd60;hpb=720b0c92478386b1705688ec8c24b8e09395d80c;p=pcsx_rearmed.git diff --git a/Makefile b/Makefile index d1585a17..f293903a 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,13 @@ else CFLAGS += -O2 -DNDEBUG endif endif +ifeq ($(DEBUG_ASAN), 1) +CFLAGS += -fsanitize=address +endif +CFLAGS += -DP_HAVE_MMAP=$(if $(NO_MMAP),0,1) \ + -DP_HAVE_PTHREAD=$(if $(NO_PTHREAD),0,1) \ + -DP_HAVE_POSIX_MEMALIGN=$(if $(NO_POSIX_MEMALIGN),0,1) \ + -DDISABLE_MEM_LUTS=0 CXXFLAGS += $(CFLAGS) #DRC_DBG = 1 #PCNT = 1 @@ -41,50 +48,52 @@ endif CC_LINK ?= $(CC) CC_AS ?= $(CC) LDFLAGS += $(MAIN_LDFLAGS) +ifeq ($(DEBUG_ASAN), 1) +LDFLAGS += -static-libasan +endif EXTRA_LDFLAGS ?= -Wl,-Map=$@.map LDLIBS += $(MAIN_LDLIBS) ifdef PCNT CFLAGS += -DPCNT endif -LIGHTREC_CUSTOM_MAP ?= 0 -CFLAGS += -DLIGHTREC_CUSTOM_MAP=$(LIGHTREC_CUSTOM_MAP) - # core OBJS += libpcsxcore/cdriso.o libpcsxcore/cdrom.o libpcsxcore/cheat.o libpcsxcore/database.o \ libpcsxcore/decode_xa.o libpcsxcore/mdec.o \ libpcsxcore/misc.o libpcsxcore/plugins.o libpcsxcore/ppf.o libpcsxcore/psxbios.o \ - libpcsxcore/psxcommon.o libpcsxcore/psxcounters.o libpcsxcore/psxdma.o libpcsxcore/psxhle.o \ - libpcsxcore/psxhw.o libpcsxcore/psxinterpreter.o libpcsxcore/psxmem.o libpcsxcore/r3000a.o \ - libpcsxcore/sio.o libpcsxcore/spu.o + libpcsxcore/psxcommon.o libpcsxcore/psxcounters.o libpcsxcore/psxdma.o \ + libpcsxcore/psxhw.o libpcsxcore/psxinterpreter.o libpcsxcore/psxmem.o \ + libpcsxcore/psxevents.o libpcsxcore/r3000a.o \ + libpcsxcore/sio.o libpcsxcore/spu.o libpcsxcore/gpu.o OBJS += libpcsxcore/gte.o libpcsxcore/gte_nf.o libpcsxcore/gte_divider.o ifeq ($(DEBUG), 1) -OBJS += libpcsxcore/debug.o libpcsxcore/socket.o libpcsxcore/disr3000a.o +#OBJS += libpcsxcore/debug.o libpcsxcore/socket.o libpcsxcore/disr3000a.o endif ifeq ($(WANT_ZLIB),1) -CFLAGS += -Ideps/libchdr/deps/zlib-1.2.11 -OBJS += deps/libchdr/deps/zlib-1.2.11/adler32.o \ - deps/libchdr/deps/zlib-1.2.11/compress.o \ - deps/libchdr/deps/zlib-1.2.11/crc32.o \ - deps/libchdr/deps/zlib-1.2.11/deflate.o \ - deps/libchdr/deps/zlib-1.2.11/gzclose.o \ - deps/libchdr/deps/zlib-1.2.11/gzlib.o \ - deps/libchdr/deps/zlib-1.2.11/gzread.o \ - deps/libchdr/deps/zlib-1.2.11/gzwrite.o \ - deps/libchdr/deps/zlib-1.2.11/infback.o \ - deps/libchdr/deps/zlib-1.2.11/inffast.o \ - deps/libchdr/deps/zlib-1.2.11/inflate.o \ - deps/libchdr/deps/zlib-1.2.11/inftrees.o \ - deps/libchdr/deps/zlib-1.2.11/trees.o \ - deps/libchdr/deps/zlib-1.2.11/uncompr.o \ - deps/libchdr/deps/zlib-1.2.11/zutil.o +CFLAGS += -Ideps/libchdr/deps/zlib-1.2.13 +OBJS += deps/libchdr/deps/zlib-1.2.13/adler32.o \ + deps/libchdr/deps/zlib-1.2.13/compress.o \ + deps/libchdr/deps/zlib-1.2.13/crc32.o \ + deps/libchdr/deps/zlib-1.2.13/deflate.o \ + deps/libchdr/deps/zlib-1.2.13/gzclose.o \ + deps/libchdr/deps/zlib-1.2.13/gzlib.o \ + deps/libchdr/deps/zlib-1.2.13/gzread.o \ + deps/libchdr/deps/zlib-1.2.13/gzwrite.o \ + deps/libchdr/deps/zlib-1.2.13/infback.o \ + deps/libchdr/deps/zlib-1.2.13/inffast.o \ + deps/libchdr/deps/zlib-1.2.13/inflate.o \ + deps/libchdr/deps/zlib-1.2.13/inftrees.o \ + deps/libchdr/deps/zlib-1.2.13/trees.o \ + deps/libchdr/deps/zlib-1.2.13/uncompr.o \ + deps/libchdr/deps/zlib-1.2.13/zutil.o +deps/libchdr/deps/zlib-1.2.13/%.o: CFLAGS += -DHAVE_UNISTD_H endif ifeq "$(ARCH)" "arm" OBJS += libpcsxcore/gte_arm.o endif -ifeq "$(HAVE_NEON)" "1" +ifeq "$(HAVE_NEON_ASM)" "1" OBJS += libpcsxcore/gte_neon.o endif libpcsxcore/psxbios.o: CFLAGS += -Wno-nonnull @@ -92,12 +101,26 @@ libpcsxcore/psxbios.o: CFLAGS += -Wno-nonnull # dynarec ifeq "$(DYNAREC)" "lightrec" CFLAGS += -Ideps/lightning/include -Ideps/lightrec -Iinclude/lightning -Iinclude/lightrec \ - -DLIGHTREC -DLIGHTREC_STATIC -DHAVE_MMAP + -DLIGHTREC -DLIGHTREC_STATIC +LIGHTREC_CUSTOM_MAP ?= 0 +LIGHTREC_CUSTOM_MAP_OBJ ?= libpcsxcore/lightrec/mem.o +LIGHTREC_THREADED_COMPILER ?= 0 +CFLAGS += -DLIGHTREC_CUSTOM_MAP=$(LIGHTREC_CUSTOM_MAP) \ + -DLIGHTREC_ENABLE_THREADED_COMPILER=$(LIGHTREC_THREADED_COMPILER) ifeq ($(LIGHTREC_CUSTOM_MAP),1) LDLIBS += -lrt -OBJS += libpcsxcore/lightrec/mem.o +OBJS += $(LIGHTREC_CUSTOM_MAP_OBJ) +endif +ifeq ($(NEED_SYSCONF),1) +OBJS += libpcsxcore/lightrec/sysconf.o endif -OBJS += libpcsxcore/lightrec/plugin.o +ifeq ($(LIGHTREC_THREADED_COMPILER),1) +OBJS += deps/lightrec/recompiler.o \ + deps/lightrec/reaper.o +endif +OBJS += deps/lightrec/tlsf/tlsf.o +OBJS += libpcsxcore/lightrec/plugin.o \ + libpcsxcore/lightrec/internals.o OBJS += deps/lightning/lib/jit_disasm.o \ deps/lightning/lib/jit_memory.o \ deps/lightning/lib/jit_names.o \ @@ -106,18 +129,20 @@ OBJS += deps/lightning/lib/jit_disasm.o \ deps/lightning/lib/jit_size.o \ deps/lightning/lib/lightning.o \ deps/lightrec/blockcache.o \ + deps/lightrec/constprop.o \ deps/lightrec/disassembler.o \ deps/lightrec/emitter.o \ deps/lightrec/interpreter.o \ deps/lightrec/lightrec.o \ deps/lightrec/memmanager.o \ deps/lightrec/optimizer.o \ - deps/lightrec/regcache.o \ - deps/lightrec/recompiler.o \ - deps/lightrec/reaper.o + deps/lightrec/regcache.o +deps/lightning/%.o: CFLAGS += -DHAVE_MMAP=P_HAVE_MMAP +deps/lightning/%: CFLAGS += -w +deps/lightrec/%: CFLAGS += -w libpcsxcore/lightrec/mem.o: CFLAGS += -D_GNU_SOURCE ifeq ($(MMAP_WIN32),1) -CFLAGS += -Iinclude/mman +CFLAGS += -Iinclude/mman -I deps/mman OBJS += deps/mman/mman.o endif else ifeq "$(DYNAREC)" "ari64" @@ -155,7 +180,7 @@ ifeq "$(ARCH)" "arm" OBJS += plugins/dfsound/arm_utils.o endif ifeq "$(HAVE_C64_TOOLS)" "1" -plugins/dfsound/spu.o: CFLAGS += -DC64X_DSP +plugins/dfsound/%.o: CFLAGS += -DC64X_DSP -DWANT_THREAD_CODE plugins/dfsound/spu.o: plugins/dfsound/spu_c64x.c frontend/menu.o: CFLAGS += -DC64X_DSP endif @@ -185,13 +210,16 @@ OBJS += plugins/gpulib/gpu.o plugins/gpulib/vout_pl.o ifeq "$(BUILTIN_GPU)" "neon" CFLAGS += -DGPU_NEON OBJS += plugins/gpu_neon/psx_gpu_if.o -ifeq "$(HAVE_NEON)" "1" -OBJS += plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.o plugins/gpu_neon/psx_gpu_if.o: CFLAGS += -DNEON_BUILD -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP -else -plugins/gpu_neon/psx_gpu_if.o: CFLAGS += -DTEXTURE_CACHE_4BPP -DTEXTURE_CACHE_8BPP -endif plugins/gpu_neon/psx_gpu_if.o: plugins/gpu_neon/psx_gpu/*.c +frontend/menu.o frontend/plugin_lib.o: CFLAGS += -DBUILTIN_GPU_NEON + ifeq "$(HAVE_NEON_ASM)" "1" + OBJS += plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.o + else + OBJS += plugins/gpu_neon/psx_gpu/psx_gpu_simd.o + plugins/gpu_neon/psx_gpu_if.o: CFLAGS += -DSIMD_BUILD + plugins/gpu_neon/psx_gpu/psx_gpu_simd.o: CFLAGS += -DSIMD_BUILD + endif endif ifeq "$(BUILTIN_GPU)" "peops" CFLAGS += -DGPU_PEOPS @@ -248,18 +276,15 @@ CFLAGS += -DHAVE_CHD -D_7ZIP_ST LDFLAGS += -lm endif -# dfinput -ifneq "$(PLATFORM)" "libretro" -OBJS += plugins/dfinput/main.o plugins/dfinput/pad.o plugins/dfinput/guncon.o -endif - # frontend/gui OBJS += frontend/cspace.o -ifeq "$(HAVE_NEON)" "1" +ifeq "$(HAVE_NEON_ASM)" "1" OBJS += frontend/cspace_neon.o +frontend/cspace.o: CFLAGS += -DHAVE_bgr555_to_rgb565 -DHAVE_bgr888_to_x else ifeq "$(ARCH)" "arm" OBJS += frontend/cspace_arm.o +frontend/cspace.o: CFLAGS += -DHAVE_bgr555_to_rgb565 endif endif @@ -289,6 +314,8 @@ frontend/main.o frontend/menu.o: CFLAGS += -include frontend/pandora/ui_feat.h frontend/libpicofe/linux/plat.o: CFLAGS += -DPANDORA USE_PLUGIN_LIB = 1 USE_FRONTEND = 1 +CFLAGS += -gdwarf-3 -ffunction-sections -fdata-sections +LDFLAGS += -Wl,--gc-sections endif ifeq "$(PLATFORM)" "caanoo" OBJS += frontend/libpicofe/gp2x/in_gp2x.o frontend/warm/warm.o @@ -309,21 +336,31 @@ CFLAGS += `pkg-config --cflags glib-2.0 libosso dbus-1 hildon-fm-2` LDFLAGS += `pkg-config --libs glib-2.0 libosso dbus-1 hildon-fm-2` endif ifeq "$(PLATFORM)" "libretro" +ifneq "$(HAVE_PHYSICAL_CDROM)$(USE_LIBRETRO_VFS)" "00" +OBJS += deps/libretro-common/compat/compat_strl.o +OBJS += deps/libretro-common/file/file_path.o +OBJS += deps/libretro-common/string/stdstring.o +OBJS += deps/libretro-common/vfs/vfs_implementation.o +endif +ifeq "$(HAVE_PHYSICAL_CDROM)" "1" +OBJS += frontend/libretro-cdrom.o +OBJS += deps/libretro-common/lists/string_list.o +OBJS += deps/libretro-common/memmap/memalign.o +OBJS += deps/libretro-common/rthreads/rthreads.o +OBJS += deps/libretro-common/vfs/vfs_implementation_cdrom.o +CFLAGS += -DHAVE_CDROM +endif ifeq "$(USE_LIBRETRO_VFS)" "1" -OBJS += libretro-common/compat/compat_posix_string.o -OBJS += libretro-common/compat/fopen_utf8.o -OBJS += libretro-common/encodings/compat_strl.o -OBJS += libretro-common/encodings/encoding_utf.o -OBJS += libretro-common/file/file_path.o -OBJS += libretro-common/streams/file_stream.o -OBJS += libretro-common/streams/file_stream_transforms.o -OBJS += libretro-common/string/stdstring.o -OBJS += libretro-common/time/rtime.o -OBJS += libretro-common/vfs/vfs_implementation.o +OBJS += deps/libretro-common/compat/compat_posix_string.o +OBJS += deps/libretro-common/compat/fopen_utf8.o +OBJS += deps/libretro-common/encodings/encoding_utf.o +OBJS += deps/libretro-common/streams/file_stream.o +OBJS += deps/libretro-common/streams/file_stream_transforms.o +OBJS += deps/libretro-common/time/rtime.o CFLAGS += -DUSE_LIBRETRO_VFS endif OBJS += frontend/libretro.o -CFLAGS += -Ilibretro-common/include +CFLAGS += -Ideps/libretro-common/include CFLAGS += -DFRONTEND_SUPPORTS_RGB565 CFLAGS += -DHAVE_LIBRETRO @@ -339,7 +376,7 @@ OBJS += frontend/plugin_lib.o OBJS += frontend/libpicofe/linux/plat.o OBJS += frontend/libpicofe/readpng.o frontend/libpicofe/fonts.o frontend/libpicofe/linux/plat.o: CFLAGS += -DNO_HOME_DIR -ifeq "$(HAVE_NEON)" "1" +ifeq "$(HAVE_NEON_ASM)" "1" OBJS += frontend/libpicofe/arm/neon_scale2x.o OBJS += frontend/libpicofe/arm/neon_eagle2x.o frontend/libpicofe/arm/neon_scale2x.o: CFLAGS += -DDO_BGR_TO_RGB @@ -360,7 +397,7 @@ endif # misc OBJS += frontend/main.o frontend/plugin.o - +frontend/main.o: CFLAGS += -DBUILTIN_GPU=$(BUILTIN_GPU) frontend/menu.o frontend/main.o: frontend/revision.h frontend/plat_sdl.o frontend/libretro.o: frontend/revision.h @@ -393,7 +430,7 @@ $(TARGET): $(OBJS) ifeq ($(STATIC_LINKING), 1) $(AR) rcs $@ $(OBJS) else - $(CC_LINK) -o $@ $^ $(LDFLAGS) $(LDLIBS) $(EXTRA_LDFLAGS) + $(CC_LINK) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) $(EXTRA_LDFLAGS) endif clean: $(PLAT_CLEAN) clean_plugins @@ -403,10 +440,10 @@ ifneq ($(PLUGINS),) plugins_: $(PLUGINS) $(PLUGINS): - make -C $(dir $@) + $(MAKE) -C $(dir $@) clean_plugins: - make -C plugins/gpulib/ clean + $(MAKE) -C plugins/gpulib/ clean for dir in $(PLUGINS) ; do \ $(MAKE) -C $$(dirname $$dir) clean; done else