Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions backends/platform/libretro/build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ else ifneq ($(findstring Darwin,$(shell uname -a)),)
ifeq ($(shell uname -p),powerpc)
arch = ppc
endif
else ifneq (,$(findstring armv,$(platform)))
ifeq (,$(findstring classic_,$(platform)))
override platform += unix
endif
else ifneq ($(findstring win,$(shell uname -a)),)
platform = win
endif
Expand Down Expand Up @@ -180,6 +184,36 @@ else ifneq (,$(findstring armv,$(platform)))
USE_THEORADEC = 0
USE_TREMOR = 1
HAVE_MT32EMU = 0

# 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
DEFINES := -fPIC -marm -mcpu=cortex-a7 -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
LDFLAGS += -shared -Wl,--version-script=../link.T -fPIC -Wl,--no-undefined -mcpu=cortex-a7 -mtune=cortex-a7 -static-libgcc -static-libstdc++
USE_VORBIS = 0
USE_THEORADEC = 0
USE_TREMOR = 1
HAVE_MT32EMU = 0
HAVE_NEON = 1

# (armv8 a35, hard point, neon based) ###
# Playstation Classic
else ifeq ($(platform), classic_armv8_a35)
TARGET := $(TARGET_NAME)_libretro.so
DEFINES := -fPIC -marm -mcpu=cortex-a35 -mtune=cortex-a35 -mfpu=neon-fp-armv8 -mfloat-abi=hard
LDFLAGS += -shared -Wl,--version-script=../link.T -fPIC -Wl,--no-undefined -mcpu=cortex-a35 -mtune=cortex-a35 -static-libgcc -static-libstdc++
USE_VORBIS = 0
USE_THEORADEC = 0
USE_TREMOR = 1
HAVE_MT32EMU = 0
HAVE_NEON = 1

#######################################

ifneq (,$(findstring cortexa8,$(platform)))
DEFINES += -marm -mcpu=cortex-a8
else ifneq (,$(findstring cortexa9,$(platform)))
Expand Down Expand Up @@ -419,12 +453,20 @@ $(TARGET): $(OBJS) libdeps.a
$(AR) $@ $(wildcard *.o) $(wildcard */*.o) $(wildcard */*/*.o) $(wildcard */*/*/*.o) $(wildcard */*/*/*/*.o) $(wildcard */*/*/*/*/*.o)
else
$(TARGET): $(OBJS) libdeps.a

@echo "** BUILDING $(TARGET) FOR PLATFORM $(platform) **"
$(CXX) $(LDFLAGS) $+ $(LIBS) -o $@
@echo "** BUILD SUCCESSFUL! GG NO RE **"

$(LD) $(LDFLAGS) $+ $(LIBS) $(LINKOUT)$@

endif

libdeps.a: $(OBJS_DEPS)
ifeq ($(platform), libnx)
$(AR) -rc $@ $^
else ifeq ($(platform), classic_armv8_a35)
$(AR) -rc $@ $^
else
$(AR) $@ $^
endif
Expand Down
2 changes: 1 addition & 1 deletion backends/platform/libretro/deps/libjpeg/jerror.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "jpeglib.h"
#include "jversion.h"
#include "jerror.h"

#include <stdlib.h>
#ifdef USE_WINDOWS_MESSAGEBOX
#include <windows.h>
#endif
Expand Down
2 changes: 2 additions & 0 deletions rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ $(MODULE_LIB-$(MODULE)): $(MODULE_OBJS-$(MODULE))
$(QUIET)-$(RM) $@
ifeq ($(platform), libnx)
$(QUIET_AR)$(AR) -rc $@ $+
else ifeq ($(platform), classic_armv8_a35)
$(QUIET_AR)$(AR) -rc $@ $+
else
$(QUIET_AR)$(AR) $@ $+
endif
Expand Down