+ DYNAREC ?= lightrec
+ TARGET := $(TARGET_NAME)_libretro.dylib
+ fpic := -fPIC
+ fpic += -mmacosx-version-min=10.1
+ifeq ($(DYNAREC),lightrec)
+ # Override
+ DYNAREC = 0
+ TARGET := $(TARGET_NAME)_interpreter_libretro.dylib
+endif
+
+# iOS
+else ifeq ($(platform),$(filter $(platform),ios-arm64))
+ ARCH := arm64
+ HAVE_NEON = 0
+ BUILTIN_GPU = peops
+ 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
+ DYNAREC ?= ari64
+ HAVE_NEON = 1
+ BUILTIN_GPU = neon
+ TARGET := $(TARGET_NAME)_libretro_ios.dylib
+ifeq ($(DYNAREC),lightrec)
+ # Override
+ DYNAREC = 0
+ TARGET := $(TARGET_NAME)_interpreter_libretro_ios.dylib
+endif
+ fpic := -fPIC
+
+ ifeq ($(IOSSDK),)
+ IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path)
+ endif
+
+ CC = clang -arch armv7 -isysroot $(IOSSDK)
+ CXX = clang++ -arch armv7 -isysroot $(IOSSDK)
+ CC_AS = perl ./tools/gas-preprocessor.pl $(CC)
+ CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -marm
+ ASFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon
+ CFLAGS += -DIOS
+ifeq ($(platform),ios9)
+ CC += -miphoneos-version-min=8.0
+ CXX += -miphoneos-version-min=8.0
+ CC_AS += -miphoneos-version-min=8.0
+ CFLAGS += -miphoneos-version-min=8.0
+else
+ CC += -miphoneos-version-min=5.0
+ CXX += -miphoneos-version-min=5.0
+ CC_AS += -miphoneos-version-min=5.0
+ 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