+# Vita
+else ifeq ($(platform), vita)
+ TARGET := $(TARGET_NAME)_libretro_vita.a
+ CFLAGS += -DVITA
+ CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -marm
+ CFLAGS += -fsingle-precision-constant -mword-relocations -fno-unwind-tables
+ CFLAGS += -fno-asynchronous-unwind-tables -ftree-vectorize -funroll-loops
+ CFLAGS += -fno-optimize-sibling-calls
+ CFLAGS += -I$(VITASDK)/include -Ifrontend/vita
+ CFLAGS += -DNO_DYLIB
+ ASFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon
+
+# CFLAGS += -U__ARM_NEON__
+ HAVE_NEON = 1
+ HAVE_NEON_ASM = 1
+ BUILTIN_GPU = neon
+
+ DYNAREC = ari64
+ ARCH = arm
+ STATIC_LINKING = 1
+ NO_PTHREAD=1
+ NO_POSIX_MEMALIGN := 1
+
+# CTR(3DS)
+else ifeq ($(platform), ctr)
+ TARGET := $(TARGET_NAME)_libretro_ctr.a
+ CFLAGS += -DARM11 -D_3DS -DNO_DYLIB -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 -funroll-loops
+ CFLAGS += -Ifrontend/3ds -I$(CTRULIB)/include
+ CFLAGS += -Werror=implicit-function-declaration
+ CFLAGS += -DHAVE_UNISTD_H
+
+ OBJS += frontend/3ds/utils.o
+
+# CFLAGS += -DPCSX
+ BUILTIN_GPU = unai
+ THREAD_RENDERING = 1
+ DYNAREC = ari64
+ ARCH = arm
+ HAVE_NEON = 0
+ STATIC_LINKING = 1
+ NO_POSIX_MEMALIGN := 1
+
+# Xbox 360
+else ifeq ($(platform), xenon)
+ TARGET := $(TARGET_NAME)_libretro_xenon360.a
+ CFLAGS += -D__LIBXENON__ -m32 -D__ppc__
+
+# Nintendo GC/Wii/WiiU
+else ifneq (,$(filter $(platform),ngc wii wiiu))
+ TARGET := $(TARGET_NAME)_libretro_$(platform).a
+ ifeq ($(platform), ngc)
+ CFLAGS += -DHW_DOL -mogc
+ NEED_SYSCONF := 1
+ else ifeq ($(platform), wii)
+ CFLAGS += -DHW_RVL -mrvl
+ NEED_SYSCONF := 1
+ else ifeq ($(platform), wiiu)
+ # -mwup was removed in newer devkitPPC versions
+ CFLAGS += -DHW_WUP
+ CFLAGS += -I frontend/wiiu
+ LIGHTREC_CUSTOM_MAP := 1
+ LIGHTREC_CUSTOM_MAP_OBJ := libpcsxcore/lightrec/mem_wiiu.o
+ endif
+ ARCH = powerpc
+ BUILTIN_GPU = peops
+ CFLAGS += -D__ppc__ -D__powerpc__
+ CFLAGS += -DGEKKO -mcpu=750 -meabi -mhard-float
+ CFLAGS += -DNO_DYLIB
+ STATIC_LINKING := 1
+ THREAD_RENDERING := 0
+ NO_PTHREAD := 1
+ NO_MMAP := 1
+ NO_POSIX_MEMALIGN := 1
+ LIBDL :=
+ LIBPTHREAD :=
+ LIBRT :=
+
+# QNX
+else ifeq ($(platform), qnx)
+ TARGET := $(TARGET_NAME)_libretro_qnx.so
+ fpic := -fPIC
+ HAVE_NEON = 1
+ HAVE_NEON_ASM = 1
+ DYNAREC = ari64
+ BUILTIN_GPU = neon
+ ARCH = arm
+ CFLAGS += -D__BLACKBERRY_QNX__ -marm -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp
+ ASFLAGS += -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp
+ MAIN_LDLIBS += -lsocket
+ LIBPTHREAD :=
+ LIBDL :=
+ LIBM :=
+
+#Raspberry Pi 1
+else ifeq ($(platform), rpi1)
+ TARGET := $(TARGET_NAME)_libretro.so
+ fpic := -fPIC
+ CFLAGS += -marm -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard
+ ASFLAGS += -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard
+ HAVE_NEON = 0
+ ARCH = arm
+ BUILTIN_GPU = unai
+ DYNAREC = ari64
+
+#Raspberry Pi 2
+else ifeq ($(platform), rpi2)
+ TARGET := $(TARGET_NAME)_libretro.so
+ fpic := -fPIC
+ CFLAGS += -marm -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
+ ASFLAGS += -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
+ HAVE_NEON = 1
+ HAVE_NEON_ASM = 1
+ ARCH = arm
+ BUILTIN_GPU = neon
+ DYNAREC = ari64
+
+#Raspberry Pi 3
+else ifeq ($(platform), rpi3)
+ TARGET := $(TARGET_NAME)_libretro.so
+ fpic := -fPIC
+ CFLAGS += -marm -mcpu=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard
+ ASFLAGS += -mcpu=cortex-a53 -mfpu=neon-fp-armv8 -mfloat-abi=hard
+ HAVE_NEON = 1
+ HAVE_NEON_ASM = 1
+ ARCH = arm
+ BUILTIN_GPU = neon
+ DYNAREC = ari64
+
+#Raspberry Pi 3 with a 64bit GNU/Linux OS
+else ifeq ($(platform), rpi3_64)
+ TARGET := $(TARGET_NAME)_libretro.so
+ ARCH := arm64
+ BUILTIN_GPU = neon
+ HAVE_NEON = 1
+ DYNAREC = ari64
+ fpic := -fPIC
+ CFLAGS += -march=armv8-a+crc+simd -mtune=cortex-a53 -ftree-vectorize
+
+#Raspberry Pi 4 with a 32bit GNU/Linux OS
+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
+ HAVE_NEON_ASM = 1
+ ARCH = arm
+ BUILTIN_GPU = neon
+ DYNAREC = ari64
+
+#Raspberry Pi 4 with a 64bit GNU/Linux OS
+else ifeq ($(platform), rpi4_64)
+ TARGET := $(TARGET_NAME)_libretro.so
+ ARCH := arm64
+ BUILTIN_GPU = neon
+ HAVE_NEON = 1
+ DYNAREC = ari64
+ fpic := -fPIC
+ CFLAGS += -march=armv8-a+crc+simd -mtune=cortex-a72 -ftree-vectorize
+
+# Classic Platforms ####################
+# Platform affix = classic_<ISA>_<µARCH>
+# Help at https://modmyclassic.com/comp
+
+# (armv7 a7, hard point, neon based) ###
+# NESC, SNESC, C64 mini
+else ifeq ($(platform), classic_armv7_a7)
+ TARGET := $(TARGET_NAME)_libretro.so
+ fpic := -fPIC
+ CFLAGS += -Ofast \
+ -flto=4 -fwhole-program -fuse-linker-plugin \
+ -fdata-sections -ffunction-sections -Wl,--gc-sections \
+ -fno-stack-protector -fno-ident -fomit-frame-pointer \
+ -falign-functions=1 -falign-jumps=1 -falign-loops=1 \
+ -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-unroll-loops \
+ -fmerge-all-constants -fno-math-errno \
+ -marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
+ CXXFLAGS += $(CFLAGS)
+ CPPFLAGS += $(CFLAGS)
+ ASFLAGS += $(CFLAGS)
+ HAVE_NEON = 1
+ HAVE_NEON_ASM = 1
+ ARCH = arm
+ BUILTIN_GPU = neon
+ DYNAREC = ari64
+ ifeq ($(shell echo `$(CC) -dumpversion` "< 4.9" | bc -l), 1)
+ CFLAGS += -march=armv7-a
+ else
+ CFLAGS += -march=armv7ve
+ # If gcc is 5.0 or later
+ ifeq ($(shell echo `$(CC) -dumpversion` ">= 5" | bc -l), 1)
+ LDFLAGS += -static-libgcc -static-libstdc++
+ endif
+ endif
+
+# (armv8 a35, hard point, neon based) ###
+# PlayStation Classic
+else ifeq ($(platform), classic_armv8_a35)
+ TARGET := $(TARGET_NAME)_libretro.so
+ fpic := -fPIC
+ CFLAGS += -Ofast \
+ -fmerge-all-constants -fno-math-errno -march=armv8-a \
+ -marm -mcpu=cortex-a35 -mtune=cortex-a35 -mfpu=neon-fp-armv8 -mfloat-abi=hard
+ HAVE_NEON = 1
+ HAVE_NEON_ASM = 1
+ ARCH = arm
+ BUILTIN_GPU = neon
+ DYNAREC = ari64
+ LDFLAGS += -static-libgcc -static-libstdc++ -fPIC
+
+#######################################
+
+# ARM
+else ifneq (,$(findstring armv,$(platform)))
+ TARGET := $(TARGET_NAME)_libretro.so
+ fpic := -fPIC
+ HAVE_NEON = 0
+ BUILTIN_GPU = peops
+ ifneq (,$(findstring cortexa8,$(platform)))
+ CFLAGS += -marm -mcpu=cortex-a8
+ ASFLAGS += -mcpu=cortex-a8
+ else ifneq (,$(findstring cortexa7,$(platform)))
+ CFLAGS += -marm -mcpu=cortex-a7
+ ASFLAGS += -mcpu=cortex-a7
+ LIBZ :=
+ else ifneq (,$(findstring cortexa9,$(platform)))
+ CFLAGS += -marm -mcpu=cortex-a9
+ ASFLAGS += -mcpu=cortex-a9
+ endif
+ CFLAGS += -marm
+ ifneq (,$(findstring neon,$(platform)))
+ CFLAGS += -mfpu=neon
+ ASFLAGS += -mfpu=neon
+ HAVE_NEON = 1
+ HAVE_NEON_ASM = 1
+ BUILTIN_GPU = neon
+ endif
+ ifneq (,$(findstring softfloat,$(platform)))
+ CFLAGS += -mfloat-abi=softfp
+ ASFLAGS += -mfloat-abi=softfp
+ else ifneq (,$(findstring hardfloat,$(platform)))
+ CFLAGS += -mfloat-abi=hard
+ ASFLAGS += -mfloat-abi=hard
+ endif
+ ARCH = arm
+ DYNAREC = ari64
+
+else ifeq ($(platform), miyoo)
+ TARGET := $(TARGET_NAME)_libretro.so
+ fpic := -fPIC
+ CFLAGS += -mcpu=arm926ej-s -fsingle-precision-constant
+ CFLAGS += -DGPULIB_USE_MMAP -DGPU_UNAI_USE_INT_DIV_MULTINV -D_MIYOO
+ ARCH = arm
+ BUILTIN_GPU = unai
+ DYNAREC = ari64
+ HAVE_NEON = 0
+
+# 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
+ STATIC_LINKING = 1
+
+# Windows