RetroArch/Makefile.orbis

214 lines
5.9 KiB
Makefile
Raw Normal View History

2018-12-28 00:27:13 +00:00
TARGET := retroarch_orbis
2018-12-27 19:16:43 +00:00
DEBUG ?= 0
GRIFFIN_BUILD = 0
WHOLE_ARCHIVE_LINK = 0
HAVE_STATIC_DUMMY ?= 0
2020-06-20 21:05:20 +00:00
HAVE_GLES3 ?= 0
HAVE_MOUSE ?= 0
HAVE_KEYBOARD ?= 0
2018-12-27 19:16:43 +00:00
PS4_TITLE_ID := RETROARCH
PS4_TITLE_NAME := RetroArch
2021-09-18 22:43:42 +00:00
PC_DEVELOPMENT_IP_ADDRESS = 192.168.1.137
2021-09-01 22:39:09 +00:00
PC_DEVELOPMENT_UDP_PORT = 18194
2021-09-01 22:39:09 +00:00
AUTH_INFO = 000000000000000000000000001C004000FF000000000080000000000000000000000000000000000000008000400040000000000000008000000000000000080040FFFF000000F000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
2018-12-27 19:16:43 +00:00
2021-10-12 20:55:29 +00:00
OBJ += deps/xxHash/xxhash.o \
2020-06-20 21:05:20 +00:00
# input/drivers/ps4_input.o \
# input/drivers_joypad/ps4_joypad.o \
# audio/drivers/psp_audio.o \
# gfx/drivers_context/orbis_ctx.o \
# frontend/drivers/platform_orbis.o
ifeq ($(HAVE_GLES3),1)
DEFINES += -DHAVE_OPENGLES3
endif
ifeq ($(HAVE_STATIC_DUMMY),1)
DEFINES += -DHAVE_STATIC_DUMMY
endif
2018-12-27 19:16:43 +00:00
ifeq ($(GRIFFIN_BUILD), 1)
OBJ += griffin/griffin.o
DEFINES += -DHAVE_GRIFFIN=1
2020-06-20 21:05:20 +00:00
DEFINES += -DHAVE_MENU -DHAVE_LIBRETRODB -DHAVE_CONFIGFILE
2019-07-25 06:07:24 +00:00
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DHAVE_CC_RESAMPLER
DEFINES += -DHAVE_CORE_INFO_CACHE
2018-12-27 19:16:43 +00:00
ifeq ($(DEBUG), 1)
DEFINES += -DHAVE_NETLOGGER
endif
else
HAVE_FILTERS_BUILTIN := 1
2020-06-20 21:05:20 +00:00
HAVE_LANGEXTRA := 1
HAVE_IMAGEVIEWER := 1
HAVE_RPNG := 1
HAVE_RJPEG := 1
HAVE_RBMP := 1
HAVE_RTGA := 1
HAVE_ZLIB := 1
HAVE_BUILTINZLIB := 1
HAVE_OVERLAY := 1
HAVE_7ZIP := 1
HAVE_EGL := 1
HAVE_GFX_WIDGETS := 1
HAVE_GLSL := 1
HAVE_SHADERPIPELINE := 1
HAVE_OPENGL := 1
HAVE_OPENGLES := 1
HAVE_OPENGLES2 := 1
HAVE_NETWORKING := 0
2022-08-01 05:51:02 +00:00
HAVE_IFINFO := 0
2020-06-20 21:05:20 +00:00
HAVE_SOCKET_LEGACY := 1
HAVE_MENU := 1
HAVE_MENU_COMMON := 1
HAVE_RGUI := 1
HAVE_STB_FONT := 1
HAVE_STB_VORBIS := 1
HAVE_DR_FLAC := 1
HAVE_DR_MP3 := 1
HAVE_MATERIALUI := 1
HAVE_XMB := 1
HAVE_OZONE := 1
HAVE_RGUI := 1
HAVE_THREADS := 1
HAVE_THREAD_ATTR := 1
HAVE_LIBRETRODB := 1
HAVE_CC_RESAMPLER := 1
2023-05-15 00:22:20 +00:00
HAVE_CHEEVOS := 0
2020-06-20 21:05:20 +00:00
HAVE_RUNAHEAD := 1
RARCH_CONSOLE := 1
HAVE_MAIN := 1
HAVE_ONLINE_UPDATER := 1
HAVE_COMPRESSION := 1
HAVE_UPDATE_ASSETS := 1
HAVE_UPDATE_CORES := 1
HAVE_UPDATE_CORE_INFO := 1
2020-06-20 21:05:20 +00:00
HAVE_CONFIGFILE := 1
HAVE_CHD := 1
2018-12-27 19:16:43 +00:00
HAVE_STATIC_VIDEO_FILTERS = 1
HAVE_STATIC_AUDIO_FILTERS = 1
HAVE_CORE_INFO_CACHE := 1
2018-12-27 19:16:43 +00:00
ifeq ($(DEBUG), 1)
HAVE_NETLOGGER = 1
endif
include Makefile.common
2019-01-05 16:34:14 +00:00
CFLAGS += $(DEF_FLAGS)
2018-12-27 19:16:43 +00:00
OBJ := $(filter-out $(BLACKLIST),$(OBJ))
endif
2020-06-20 21:05:20 +00:00
ifeq ($(strip $(ORBISDEV)),)
$(error "Please set ORBISDEV in your environment. export ORBISDEV=<path to>orbisdev")
2018-12-27 19:16:43 +00:00
endif
PREFIX := orbis-
CC := clang
CXX := clang++
2020-06-20 21:05:20 +00:00
AS := $(PREFIX)as
AR := $(PREFIX)ar
2018-12-27 19:16:43 +00:00
OBJCOPY := $(PREFIX)objcopy
STRIP := $(PREFIX)strip
NM := $(PREFIX)nm
LD := clang
2018-12-27 19:16:43 +00:00
2021-10-12 19:40:15 +00:00
LIBDIRS += -L. -Lcores -Lbuild -L$(ORBISDEV)/usr/lib
INCDIRS += -I. -Idefines -Ideps -Ideps/7zip -Ideps/libz -Ilibretro-common/include -Ideps/stb \
2020-06-20 21:05:20 +00:00
-Ilibretro-common/include/compat/zlib -Ideps/rcheevos/include -I$(ORBISDEV)/usr/include -I$(ORBISDEV)/usr/include/c++/v1 -I$(ORBISDEV)/usr/include/orbis
2018-12-27 19:16:43 +00:00
ARCHFLAGS += --target=x86_64-scei-ps4 -DORBIS -D__ORBIS__ -D__PS4__ -D_BSD_SOURCE
2020-06-20 21:05:20 +00:00
DEFINES += -DRARCH_INTERNAL -DRARCH_CONSOLE -DHAVE_FILTERS_BUILTIN \
2023-05-15 00:22:20 +00:00
-DHAVE_XMB -DHAVE_RGUI -DHAVE_OZONE \
-DHAVE_ONLINE_UPDATER -DHAVE_UPDATE_CORES -DHAVE_UPDATE_CORE_INFO -DHAVE_UPDATE_ASSETS \
# 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
2018-12-27 19:16:43 +00:00
2020-06-20 21:05:20 +00:00
ifeq ($(HAVE_KEYBOARD), 1)
DEFINES += -DHAVE_KEYBOARD
PS4_LIBS += -lSceDbgKeyboard_stub
2018-12-27 19:16:43 +00:00
endif
2020-06-20 21:05:20 +00:00
ifeq ($(HAVE_MOUSE),1)
DEFINES += -DHAVE_MOUSE
PS4_LIBS += -lSceMouse_stub
endif
2018-12-27 19:16:43 +00:00
ifneq ($(PC_DEVELOPMENT_IP_ADDRESS),)
2020-06-20 21:05:20 +00:00
DEFINES += -DPC_DEVELOPMENT_IP_ADDRESS='"$(PC_DEVELOPMENT_IP_ADDRESS)"'
2018-12-27 19:16:43 +00:00
endif
ifneq ($(PC_DEVELOPMENT_UDP_PORT),)
2020-06-20 21:05:20 +00:00
DEFINES += -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
2018-12-27 19:16:43 +00:00
endif
ifeq ($(WHOLE_ARCHIVE_LINK), 1)
2020-06-20 21:05:20 +00:00
WHOLE_START := --whole-archive
WHOLE_END := --no-whole-archive
2018-12-27 19:16:43 +00:00
endif
2021-10-12 22:43:09 +00:00
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
2021-09-18 22:43:42 +00:00
ifeq ($(HAVE_STATIC_DUMMY),1)
LIBS := $(PS4_LIBS)
else
2021-10-12 22:32:10 +00:00
LIBS := $(WHOLE_START) -lretro_orbis $(WHOLE_END) $(PS4_LIBS)
endif
2018-12-27 19:16:43 +00:00
CFLAGS := $(ARCHFLAGS) $(INCDIRS) $(DEFINES)
CXXFLAGS := $(ARCHFLAGS) $(INCDIRS) $(DEFINES)
2021-10-12 20:55:29 +00:00
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
2020-06-20 21:05:20 +00:00
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -fno-inline
CXXFLAGS += -O0 -fno-inline
2020-06-20 21:05:20 +00:00
else
CFLAGS += -O3
CXXFLAGS += -O3
endif
2018-12-27 19:16:43 +00:00
2022-11-08 20:30:47 +00:00
TARGETS := $(TARGET).self
2018-12-27 19:16:43 +00:00
all: $(TARGETS)
OBJOUT = -o
2018-12-27 19:16:43 +00:00
%.o: %.c
$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c $(OBJOUT)$@ $<
2018-12-27 19:16:43 +00:00
%.o: %.S
$(CC) $(CFLAGS) -c $(OBJOUT)$@ $<
2018-12-27 19:16:43 +00:00
%.o: %.s
$(CC) -c $(OBJOUT)$@ $<
2018-12-27 19:16:43 +00:00
2020-06-20 21:05:20 +00:00
$(TARGET).elf: $(OBJ)
2021-10-12 20:55:29 +00:00
$(LD) $(ORBISDEV)/usr/lib/crt0.o $(OBJ) $(LDFLAGS) $(LIBS) -o $(TARGET).elf
2018-12-27 19:16:43 +00:00
2022-11-08 20:30:47 +00:00
$(TARGET).oelf: $(TARGET).elf
@orbis-elf-create $(TARGET).elf $(TARGET).oelf
$(TARGET).self: $(TARGET).oelf
python $(ORBISDEV)/bin/make_fself.py --auth-info $(AUTH_INFO) $(TARGET).oelf $(TARGET).self
2021-09-01 22:39:09 +00:00
install:
2022-11-08 20:30:47 +00:00
@cp $(TARGET).self $(SELF_PATH_INSTALL)/homebrew.self
2021-09-01 22:39:09 +00:00
@echo "Installed!"
2018-12-27 19:16:43 +00:00
clean:
2022-11-08 20:30:47 +00:00
rm -f $(OBJ) $(TARGET).elf $(TARGET).oelf $(TARGET).self
2018-12-27 19:16:43 +00:00
2019-02-03 23:49:35 +00:00
.PHONY: clean all