#DRC_DBG = 1
#PCNT = 1
+# Suppress minor warnings for dependencies
+deps/%: CFLAGS += -Wno-unused -Wno-unused-function
+
all: config.mak target_ plugins_
ifndef NO_CONFIG_MAK
libpcsxcore/psxbios.o: CFLAGS += -Wno-nonnull
# dynarec
-ifeq "$(USE_DYNAREC)" "1"
+ifeq "$(DYNAREC)" "lightrec"
+CFLAGS += -Ideps/lightning/include -Ideps/lightrec -Iinclude/lightning -Iinclude/lightrec \
+ -DLIGHTREC -DLIGHTREC_STATIC
+LIGHTREC_CUSTOM_MAP ?= 0
+LIGHTREC_CUSTOM_MAP_OBJ ?= libpcsxcore/lightrec/mem.o
+LIGHTREC_THREADED_COMPILER ?= 0
+LIGHTREC_CODE_INV ?= 0
+CFLAGS += -DLIGHTREC_CUSTOM_MAP=$(LIGHTREC_CUSTOM_MAP) \
+ -DLIGHTREC_CODE_INV=$(LIGHTREC_CODE_INV) \
+ -DLIGHTREC_ENABLE_THREADED_COMPILER=$(LIGHTREC_THREADED_COMPILER)
+ifeq ($(LIGHTREC_CUSTOM_MAP),1)
+LDLIBS += -lrt
+OBJS += $(LIGHTREC_CUSTOM_MAP_OBJ)
+endif
+ifeq ($(NEED_SYSCONF),1)
+OBJS += libpcsxcore/lightrec/sysconf.o
+endif
+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
+OBJS += deps/lightning/lib/jit_disasm.o \
+ deps/lightning/lib/jit_memory.o \
+ deps/lightning/lib/jit_names.o \
+ deps/lightning/lib/jit_note.o \
+ deps/lightning/lib/jit_print.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/lightning/%.o: CFLAGS += -DHAVE_MMAP=P_HAVE_MMAP
+deps/lightning/%: CFLAGS += -Wno-uninitialized
+deps/lightrec/%: CFLAGS += -Wno-uninitialized
+libpcsxcore/lightrec/mem.o: CFLAGS += -D_GNU_SOURCE
+ifeq ($(MMAP_WIN32),1)
+CFLAGS += -Iinclude/mman -I deps/mman
+OBJS += deps/mman/mman.o
+endif
+else ifeq "$(DYNAREC)" "ari64"
OBJS += libpcsxcore/new_dynarec/new_dynarec.o
OBJS += libpcsxcore/new_dynarec/pcsxmem.o
ifeq "$(ARCH)" "arm"
OBJS += $(LCHDR)/src/libchdr_chd.o
OBJS += $(LCHDR)/src/libchdr_flac.o
OBJS += $(LCHDR)/src/libchdr_huffman.o
-$(LCHDR)/src/%.o: CFLAGS += -Wno-unused -std=gnu11
+$(LCHDR)/src/%.o: CFLAGS += -Wno-unused -Wno-maybe-uninitialized -std=gnu11
OBJS += $(LCHDR_LZMA)/src/Alloc.o
OBJS += $(LCHDR_LZMA)/src/CpuArch.o
OBJS += $(LCHDR_LZMA)/src/Delta.o
OBJS += frontend/libretro.o
CFLAGS += -DFRONTEND_SUPPORTS_RGB565
+ifneq ($(DYNAREC),lightrec)
ifeq ($(MMAP_WIN32),1)
OBJS += libpcsxcore/memmap_win32.o
endif
endif
+endif
ifeq "$(USE_PLUGIN_LIB)" "1"
OBJS += frontend/plugin_lib.o
platform_list="generic pandora maemo caanoo libretro"
platform="generic"
builtin_gpu_list="neon peops unai unai_old"
+dynarec_list="ari64 lightrec none"
builtin_gpu=""
sound_driver_list="oss alsa pulseaudio sdl libretro"
sound_drivers=""
have_tslib=""
have_gles=""
have_c64x_dsp=""
-enable_dynarec="yes"
+dynarec=""
need_sdl="no"
need_xlib="no"
need_libpicofe="yes"
;;
--disable-neon) have_arm_neon="no"
;;
- --disable-dynarec) enable_dynarec="no"
+ --dynarec=*) dynarec="$optarg"
+ ;;
+ --disable-dynarec) dynarec="no"
;;
*) echo "ERROR: unknown option $opt"; show_help="yes"
;;
echo " available: $sound_driver_list"
echo " --enable-neon"
echo " --disable-neon enable/disable ARM NEON optimizations [guessed]"
- echo " --disable-dynarec disable dynamic recompiler"
- echo " (dynarec is only available and enabled on ARM)"
+ echo " --dynarec=NAME select dynamic recompiler [guessed]"
+ echo " available: $dynarec_list"
echo "influential environment variables:"
echo " CROSS_COMPILE CC CXX AS AR CFLAGS ASFLAGS LDFLAGS LDLIBS"
exit 1
have_armv5=`check_define HAVE_ARMV5 && echo yes` || true
fi
+ if [ "x$dynarec" = "x" ]; then
+ dynarec="ari64"
+ fi
+
if [ "x$builtin_gpu" = "x" ]; then
if [ "$have_arm_neon" = "yes" ]; then
builtin_gpu="neon"
aarch64)
have_arm_neon="yes"
have_arm_neon_asm="no"
+ if [ "x$dynarec" = "x" ]; then
+ dynarec="ari64"
+ fi
if [ "x$builtin_gpu" = "x" ]; then
builtin_gpu="neon"
fi
;;
x86_64)
- enable_dynarec="no"
+ if [ "x$dynarec" = "x" ]; then
+ dynarec="lightrec"
+ fi
if [ "x$builtin_gpu" = "x" ]; then
builtin_gpu="neon"
fi
;;
*)
- # dynarec only available on ARM
- enable_dynarec="no"
+ if [ "x$dynarec" = "x" ]; then
+ dynarec="lightrec"
+ fi
;;
esac
echo "C compiler flags $CFLAGS"
echo "libraries $MAIN_LDLIBS"
echo "linker flags $LDFLAGS$MAIN_LDFLAGS"
-echo "enable dynarec $enable_dynarec"
+echo "dynarec $dynarec"
if [ "$ARCH" = "arm" -o "$ARCH" = "aarch64" ]; then
echo "enable ARM NEON $have_arm_neon"
fi
echo "CFLAGS_GLES = $CFLAGS_GLES" >> $config_mak
echo "LDLIBS_GLES = $LDLIBS_GLES" >> $config_mak
fi
-if [ "$enable_dynarec" = "yes" ]; then
- echo "USE_DYNAREC = 1" >> $config_mak
-fi
+echo "DYNAREC = $dynarec" >> $config_mak
if [ "$drc_cache_base" = "yes" ]; then
echo "BASE_ADDR_DYNAMIC = 1" >> $config_mak
fi