Add libnx port
@@ -97,6 +97,15 @@ else ifeq ($(platform), switch)
include $(LIBTRANSISTOR_HOME)/libtransistor.mk
CFLAGS += -Wl,-q -O3 -fno-short-enums -fno-optimize-sibling-calls
STATIC_LINKING=1
+# Nintendo Switch (libnx)
+else ifeq ($(platform), libnx)
+ include $(DEVKITPRO)/libnx/switch_rules
+ TARGET := $(TARGET_NAME)_libretro_$(platform).a
+ DEFINES += -DSWITCH=1 -D__SWITCH__ -DARM
+ CFLAGS += $(DEFINES) -fPIE -I$(LIBNX)/include/ -ffunction-sections -fdata-sections -ftls-model=local-exec
+ CFLAGS += -march=armv8-a -mtune=cortex-a57 -mtp=soft -mcpu=cortex-a57+crc+fp+simd -ffast-math
+ CXXFLAGS := $(ASFLAGS) $(CFLAGS)
+ STATIC_LINKING = 1
# Nintendo WiiU
else ifeq ($(platform), wiiu)
TARGET := $(TARGET_NAME)_libretro_$(platform).a
