From 4d92fc5f762fb02b7a8b6becdd78434d8c852874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Jos=C3=A9=20Garc=C3=ADa=20Garc=C3=ADa?= Date: Sun, 6 Nov 2022 20:40:08 +0100 Subject: [PATCH] (Orbis) Add salamander --- Makefile.orbis.salamander | 129 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 Makefile.orbis.salamander diff --git a/Makefile.orbis.salamander b/Makefile.orbis.salamander new file mode 100644 index 0000000000..6f666e4f13 --- /dev/null +++ b/Makefile.orbis.salamander @@ -0,0 +1,129 @@ +TARGET := retroarch_orbis_salamander + +DEBUG ?= 0 + + +PS4_TITLE_ID := RETROARCH +PS4_TITLE_NAME := RetroArch + +PC_DEVELOPMENT_IP_ADDRESS = 192.168.1.137 +PC_DEVELOPMENT_UDP_PORT = 18194 + +AUTH_INFO = 000000000000000000000000001C004000FF000000000080000000000000000000000000000000000000008000400040000000000000008000000000000000080040FFFF000000F000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + + + +endif + +ifeq ($(strip $(ORBISDEV)),) +$(error "Please set ORBISDEV in your environment. export ORBISDEV=orbisdev") +endif + +PREFIX := orbis- +CC := clang +CXX := clang++ +AS := $(PREFIX)as +AR := $(PREFIX)ar +OBJCOPY := $(PREFIX)objcopy +STRIP := $(PREFIX)strip +NM := $(PREFIX)nm +LD := clang + +LIBDIRS += -L. -Lcores -Lbuild -L$(ORBISDEV)/usr/lib +INCDIRS += -I. -Idefines -Ilibretro-common/include -I$(ORBISDEV)/usr/include -I$(ORBISDEV)/usr/include/c++/v1 -I$(ORBISDEV)/usr/include/orbis + +ARCHFLAGS += --target=x86_64-scei-ps4 -DORBIS -D__ORBIS__ -D__PS4__ -D_BSD_SOURCE + + +DEFINES += -DORBIS -D__ORBIS__ -DIS_SALAMANDER -DRARCH_CONSOLE -D__PS4__ -D_BSD_SOURCE + +# Compiling with -Werror and disabling some warnings +DEFINES += -Werror -Wno-macro-redefined -Wno-typedef-redefinition -Wno-non-literal-null-conversion -Wno-void-pointer-to-int-cast \ + -Wno-format -Wno-tautological-constant-out-of-range-compare -Wno-implicit-function-declaration + +ifeq ($(HAVE_FILE_LOGGER), 1) + DEFINES += -DHAVE_FILE_LOGGER +endif +ifneq ($(PC_DEVELOPMENT_IP_ADDRESS),) + DEFINES += -DPC_DEVELOPMENT_IP_ADDRESS='"$(PC_DEVELOPMENT_IP_ADDRESS)"' +endif + +ifneq ($(PC_DEVELOPMENT_UDP_PORT),) + DEFINES += -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) +endif + +PS4_LIBS += -luser_mem_sys -lkernel_stub -lSceLibcInternal_stub -lunwind -lc++ -lc++abi -lc++experimental \ + -lorbisLink -lkernelUtil -ldebugnet -lorbisNfs -lSceSysmodule_stub -lSceSystemService_stub -lSceNet_stub \ + -lSceUserService_stub -lScePigletv2VSH_stub -lSceVideoOut_stub -lSceGnmDriver_stub -lorbisPad \ + -lScePad_stub -lSceAudioOut_stub -lSceIme_stub -lSceNetCtl_stub -lSQLite + + + LIBS := $(PS4_LIBS) + + +CFLAGS := $(ARCHFLAGS) $(INCDIRS) $(DEFINES) +CXXFLAGS := $(ARCHFLAGS) $(INCDIRS) $(DEFINES) +LDFLAGS := $(LIBDIRS) -Wl,--gc-sections -Wl,-z -Wl,max-page-size=0x4000 -Wl,--dynamic-linker="/libexec/ld-elf.so.1" -Wl,-pie -Wl,--eh-frame-hdr -target x86_64-scei-ps4-elf -T $(ORBISDEV)/usr/lib/linker.x + +ifeq ($(DEBUG), 1) + CFLAGS += -O0 -fno-inline + CXXFLAGS += -O0 -fno-inline +else + CFLAGS += -O3 + CXXFLAGS += -O3 +endif + +OBJS = frontend/frontend_salamander.o \ + frontend/frontend_driver.o \ + frontend/drivers/platform_orbis.o \ + libretro-common/file/file_path.o \ + libretro-common/file/file_path_io.o \ + libretro-common/string/stdstring.o \ + libretro-common/lists/string_list.o \ + libretro-common/lists/dir_list.o \ + libretro-common/file/retro_dirent.o \ + libretro-common/encodings/encoding_utf.o \ + libretro-common/compat/compat_strl.o \ + libretro-common/compat/compat_strcasestr.o \ + libretro-common/compat/fopen_utf8.o \ + libretro-common/file/config_file.o \ + libretro-common/streams/file_stream.o \ + libretro-common/vfs/vfs_implementation.o \ + libretro-common/hash/lrc_hash.o \ + libretro-common/time/rtime.o \ + network/net_logger.o \ + verbosity.o + +TARGETS := $(TARGET).elf + +all: $(TARGETS) + +OBJOUT = -o + +%.o: %.c + $(CC) $(CFLAGS) -c $(OBJOUT)$@ $< + +%.o: %.cpp + $(CXX) $(CXXFLAGS) -c $(OBJOUT)$@ $< + +%.o: %.S + $(CC) $(CFLAGS) -c $(OBJOUT)$@ $< + +%.o: %.s + $(CC) -c $(OBJOUT)$@ $< + +$(TARGET).elf: $(OBJ) + $(LD) $(ORBISDEV)/usr/lib/crt0.o $(OBJ) $(LDFLAGS) $(LIBS) -o $(TARGET).elf + +install: + @cp homebrew.self $(SELF_PATH_INSTALL) + @echo "Installed!" +oelf: + @orbis-elf-create $(TARGET).elf homebrew.oelf +eboot: + python $(ORBISDEV)/bin/make_fself.py --auth-info $(AUTH_INFO) homebrew.oelf homebrew.self + +clean: + rm -f $(OBJ) $(TARGET).elf $(TARGET).oelf + +.PHONY: clean all