X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Makefile.libretro;h=3efe8f95c805efc3c2c8ab45b7912c194cb3e224;hb=1a32b0f81d56e67157e13ab46735eeaee2bbf9d5;hp=5d380b658bc27c5e620311e780aa9e17ab8f5afb;hpb=4e0deb4b36b49a45061098fc531556bb6cea3e9e;p=pcsx_rearmed.git diff --git a/Makefile.libretro b/Makefile.libretro index 5d380b65..3efe8f95 100644 --- a/Makefile.libretro +++ b/Makefile.libretro @@ -2,6 +2,10 @@ DEBUG ?= 0 WANT_ZLIB ?= 1 +HAVE_CHD ?= 1 + +# Dynarec options: lightrec, ari64 +DYNAREC ?= lightrec ifeq ($(platform),) platform = unix @@ -44,6 +48,7 @@ EXTRA_LDFLAGS = ifeq ($(platform), unix) TARGET := $(TARGET_NAME)_libretro.so fpic := -fPIC + THREAD_RENDERING = 1 ifneq ($(findstring SunOS,$(shell uname -s)),) CC = gcc endif @@ -66,31 +71,32 @@ else ifeq ($(platform), linux-portable) # OS X else ifeq ($(platform), osx) - USE_DYNAREC ?= 1 + DYNAREC ?= lightrec TARGET := $(TARGET_NAME)_libretro.dylib fpic := -fPIC fpic += -mmacosx-version-min=10.1 -ifeq ($(USE_DYNAREC),0) - # Override - TARGET := $(TARGET_NAME)_interpreter_libretro.dylib -endif # iOS else ifeq ($(platform),$(filter $(platform),ios-arm64)) ARCH := arm64 - USE_DYNAREC = 0 HAVE_NEON = 0 BUILTIN_GPU = peops - TARGET := $(TARGET_NAME)_libretro_ios.dylib + DYNAREC = 0 + TARGET := $(TARGET_NAME)_interpreter_libretro_ios.dylib + + CC = clang -arch arm64 -isysroot $(IOSSDK) -miphoneos-version-min=8.0 + CXX = clang++ -arch arm64 -isysroot $(IOSSDK) -miphoneos-version-min=8.0 + CFLAGS += -marm -DIOS else ifneq (,$(findstring ios,$(platform))) ARCH := arm - USE_DYNAREC ?= 1 +# DYNAREC ?= ari64 HAVE_NEON = 1 BUILTIN_GPU = neon TARGET := $(TARGET_NAME)_libretro_ios.dylib -ifeq ($(USE_DYNAREC),0) +ifeq ($(DYNAREC),lightrec) # Override + DYNAREC = 0 TARGET := $(TARGET_NAME)_interpreter_libretro_ios.dylib endif fpic := -fPIC @@ -117,6 +123,32 @@ else CFLAGS += -miphoneos-version-min=5.0 endif +# Nintendo Switch (libnx) +else ifeq ($(platform), libnx) + export DEPSDIR := $(CURDIR)/ + include $(DEVKITPRO)/libnx/switch_rules + TARGET := $(TARGET_NAME)_libretro_$(platform).a + ARCH := arm64 + BUILTIN_GPU = unai + HAVE_VFS_FD = 0 + CFLAGS += -O3 -fomit-frame-pointer -ffast-math -I$(DEVKITPRO)/libnx/include/ -fPIE -Wl,--allow-multiple-definition -include $(LIBNX)/include/switch.h + CFLAGS += -specs=$(DEVKITPRO)/libnx/switch.specs -DNO_OS -DNO_DYLIB -DNO_SOCKET -D__arm64__ -D__ARM_NEON__ + CFLAGS += -D__SWITCH__ + CFLAGS += -DARM -D__aarch64__=1 -march=armv8-a -mtune=cortex-a57 -mtp=soft -DHAVE_INTTYPES -DLSB_FIRST -ffast-math -mcpu=cortex-a57+crc+fp+simd -ffunction-sections + CFLAGS += -ftree-vectorize + CFLAGS += -Ifrontend/switch -ftree-vectorize + LIBPTHREAD := + STATIC_LINKING=1 + +# Lakka Switch (arm64) +else ifeq ($(platform), arm64) + TARGET := $(TARGET_NAME)_libretro.so + ARCH := arm64 + BUILTIN_GPU = unai + fpic := -fPIC + CFLAGS := $(filter-out -O2, $(CFLAGS)) + CFLAGS += -O3 -ftree-vectorize + # PS3 else ifeq ($(platform), ps3) TARGET := $(TARGET_NAME)_libretro_ps3.a @@ -163,7 +195,7 @@ else ifeq ($(platform), vita) HAVE_NEON = 1 BUILTIN_GPU = neon - USE_DYNAREC = 1 + DYNAREC = ari64 DRC_CACHE_BASE = 0 ARCH = arm @@ -175,20 +207,22 @@ else ifeq ($(platform), ctr) CC = $(DEVKITARM)/bin/arm-none-eabi-gcc$(EXE_EXT) CXX = $(DEVKITARM)/bin/arm-none-eabi-g++$(EXE_EXT) AR = $(DEVKITARM)/bin/arm-none-eabi-ar$(EXE_EXT) - CFLAGS += -DARM11 -D_3DS -DNO_OS -DNO_DYLIB -DNO_SOCKET + CFLAGS += -DARM11 -D_3DS -DNO_OS -DNO_DYLIB -DNO_SOCKET -DTHREAD_ENABLED -DGPU_UNAI_USE_FLOATMATH -DGPU_UNAI_USE_FLOAT_DIV_MULTINV CFLAGS += -march=armv6k -mtune=mpcore -mfloat-abi=hard -marm -mfpu=vfp -mtp=soft CFLAGS += -Wall -mword-relocations - CFLAGS += -fomit-frame-pointer -ffast-math - CFLAGS += -Ifrontend/3ds + CFLAGS += -fomit-frame-pointer -ffast-math -funroll-loops + CFLAGS += -Ifrontend/3ds -I$(CTRULIB)/include CFLAGS += -Werror=implicit-function-declaration + OBJS += frontend/3ds/utils.o + # CFLAGS += -DPCSX -# BUILTIN_GPU = unai - USE_DYNAREC = 1 + BUILTIN_GPU = unai + THREAD_RENDERING = 1 + DYNAREC = ari64 DRC_CACHE_BASE = 0 ARCH = arm HAVE_NEON = 0 - STATIC_LINKING = 1 # Xbox 360 @@ -219,7 +253,7 @@ else ifeq ($(platform), qnx) CC = qcc -Vgcc_ntoarmv7le CC_AS = $(CC) HAVE_NEON = 1 - USE_DYNAREC = 1 + DYNAREC = ari64 DRC_CACHE_BASE = 0 BUILTIN_GPU = neon ARCH = arm @@ -239,7 +273,7 @@ else ifeq ($(platform), rpi2) HAVE_NEON = 1 ARCH = arm BUILTIN_GPU = neon - USE_DYNAREC = 1 + DYNAREC = ari64 #Raspberry Pi 3 else ifeq ($(platform), rpi3) @@ -250,7 +284,18 @@ else ifeq ($(platform), rpi3) HAVE_NEON = 1 ARCH = arm BUILTIN_GPU = neon - USE_DYNAREC = 1 + DYNAREC = ari64 + +#Raspberry Pi 4 +else ifeq ($(platform), rpi4) + TARGET := $(TARGET_NAME)_libretro.so + fpic := -fPIC + CFLAGS += -marm -mcpu=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard + ASFLAGS += -mcpu=cortex-a72 -mfpu=neon-fp-armv8 -mfloat-abi=hard + HAVE_NEON = 1 + ARCH = arm + BUILTIN_GPU = neon + DYNAREC = ari64 # Classic Platforms #################### # Platform affix = classic__<µARCH> @@ -275,7 +320,7 @@ else ifeq ($(platform), classic_armv7_a7) HAVE_NEON = 1 ARCH = arm BUILTIN_GPU = neon - USE_DYNAREC = 1 + DYNAREC = ari64 ifeq ($(shell echo `$(CC) -dumpversion` "< 4.9" | bc -l), 1) CFLAGS += -march=armv7-a else @@ -297,7 +342,7 @@ else ifeq ($(platform), classic_armv8_a35) HAVE_NEON = 1 ARCH = arm BUILTIN_GPU = neon - USE_DYNAREC = 1 + DYNAREC = ari64 LDFLAGS += -static-libgcc -static-libstdc++ -fPIC ####################################### @@ -335,7 +380,15 @@ else ifneq (,$(findstring armv,$(platform))) ASFLAGS += -mfloat-abi=hard endif ARCH = arm - USE_DYNAREC = 1 + DYNAREC = ari64 + +# Emscripten +else ifeq ($(platform), emscripten) + TARGET := $(TARGET_NAME)_libretro_$(platform).bc + fpic := -fPIC + SHARED := -shared -Wl,--no-undefined -Wl,--version-script=link.T + CFLAGS += -DNO_DYLIB -DNO_SOCKET + STATIC_LINKING = 1 # Windows else @@ -381,9 +434,9 @@ NO_CONFIG_MAK = yes # what does this do #libretro_all: all #ifeq ($(platform),ios) -#ifeq ($(USE_DYNAREC),1) -# make -f Makefile.libretro USE_DYNAREC=0 platform=$(platform) clean -# make -f Makefile.libretro USE_DYNAREC=0 platform=$(platform) +#ifeq ($(DYNAREC),1) +# make -f Makefile.libretro DYNAREC=0 platform=$(platform) clean +# make -f Makefile.libretro DYNAREC=0 platform=$(platform) #endif #endif