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
|
|
|
|
|
|
|
|
PS4_TITLE_ID := RETROARCH
|
|
|
|
PS4_TITLE_NAME := RetroArch
|
|
|
|
|
|
|
|
PC_DEVELOPMENT_IP_ADDRESS =
|
|
|
|
PC_DEVELOPMENT_UDP_PORT =
|
|
|
|
|
|
|
|
OBJ :=
|
|
|
|
|
|
|
|
DEFINES :=
|
|
|
|
|
|
|
|
ifeq ($(GRIFFIN_BUILD), 1)
|
|
|
|
OBJ += griffin/griffin.o
|
|
|
|
DEFINES += -DHAVE_GRIFFIN=1
|
|
|
|
DEFINES += -DHAVE_MENU -DHAVE_LIBRETRODB
|
2019-07-25 06:07:24 +00:00
|
|
|
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DHAVE_CC_RESAMPLER
|
2018-12-27 19:16:43 +00:00
|
|
|
ifeq ($(DEBUG), 1)
|
|
|
|
DEFINES += -DHAVE_NETLOGGER
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
|
|
|
|
HAVE_FILTERS_BUILTIN := 1
|
|
|
|
HAVE_LANGEXTRA := 0
|
|
|
|
HAVE_RPNG := 1
|
|
|
|
HAVE_RJPEG := 1
|
|
|
|
HAVE_RBMP := 1
|
|
|
|
HAVE_RTGA := 1
|
2019-01-03 08:46:04 +00:00
|
|
|
HAVE_ZLIB := 1
|
2019-02-03 06:00:41 +00:00
|
|
|
HAVE_OVERLAY := 1
|
2019-05-12 23:57:26 +00:00
|
|
|
HAVE_VIDEO_LAYOUT := 0
|
2018-12-27 19:16:43 +00:00
|
|
|
HAVE_7ZIP := 1
|
|
|
|
HAVE_EGL := 1
|
2019-05-03 13:55:13 +00:00
|
|
|
HAVE_MENU_WIDGETS := 1
|
2019-07-20 16:35:32 +00:00
|
|
|
HAVE_GLSL := 1
|
2019-02-03 06:00:41 +00:00
|
|
|
HAVE_OPENGLES := 1
|
2018-12-27 19:16:43 +00:00
|
|
|
HAVE_NETWORKING := 0
|
|
|
|
HAVE_SOCKET_LEGACY := 0
|
|
|
|
HAVE_MENU := 1
|
|
|
|
HAVE_MENU_COMMON := 1
|
2018-12-29 23:10:37 +00:00
|
|
|
HAVE_RGUI := 0
|
2019-02-03 06:00:41 +00:00
|
|
|
HAVE_MATERIALUI := 0
|
|
|
|
HAVE_XMB := 1
|
2018-12-27 19:16:43 +00:00
|
|
|
HAVE_THREADS := 1
|
|
|
|
HAVE_LIBRETRODB := 1
|
|
|
|
HAVE_CC_RESAMPLER := 1
|
|
|
|
HAVE_CHEEVOS := 1
|
|
|
|
RARCH_CONSOLE := 1
|
|
|
|
HAVE_STATIC_VIDEO_FILTERS = 1
|
|
|
|
HAVE_STATIC_AUDIO_FILTERS = 1
|
|
|
|
|
|
|
|
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
|
|
|
BLACKLIST :=
|
|
|
|
OBJ := $(filter-out $(BLACKLIST),$(OBJ))
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(strip $(PS4SDK)),)
|
|
|
|
$(error "Please set PS4SDK in your environment. export PS4SDK=<path to>ps4sdk")
|
|
|
|
endif
|
|
|
|
|
|
|
|
export PATH := $(PATH):$(PS4SDK)/bin
|
|
|
|
|
|
|
|
PREFIX :=
|
|
|
|
|
|
|
|
CC := $(PREFIX)clang
|
|
|
|
CXX := $(PREFIX)clang
|
|
|
|
AS := $(PREFIX)clang
|
|
|
|
AR := $(PREFIX)ar
|
|
|
|
OBJCOPY := $(PREFIX)objcopy
|
|
|
|
STRIP := $(PREFIX)strip
|
|
|
|
NM := $(PREFIX)nm
|
|
|
|
LD := $(CXX)
|
|
|
|
|
2019-07-25 07:56:57 +00:00
|
|
|
INCDIRS := -I. -Ideps/7zip -Ilibretro-common/include -Ideps/stb -Ilibretro-common/include/compat/zlib
|
2018-12-27 19:16:43 +00:00
|
|
|
LIBDIRS := -L.
|
|
|
|
|
|
|
|
ARCHFLAGS := -m64 -DORBIS
|
|
|
|
CFLAGS += $(ARCHFLAGS) -std=c11 -mcmodel=large -ffreestanding -nostdlib -nostdinc -fno-builtin -fno-stack-protector
|
|
|
|
|
|
|
|
ifeq ($(DEBUG), 1)
|
|
|
|
CFLAGS += -O2 -g
|
|
|
|
else
|
|
|
|
CFLAGS += -O3
|
|
|
|
endif
|
|
|
|
|
|
|
|
ASFLAGS := $(ARCHFLAGS) -I$(PS4SDK)/include -target x86_64-scei-ps4-elf -fPIE
|
|
|
|
LDFLAGS := -O3 -Wall -m64 -nostartfiles -nostdlib -L$(PS4SDK)/lib -pie
|
|
|
|
ARFLAGS := rcs
|
|
|
|
|
|
|
|
CRTFILE ?= $(PS4SDK)/crt0.s
|
|
|
|
|
|
|
|
CFLAGS += -Wall -pedantic -Wno-zero-length-array -Wno-format-pedantic
|
|
|
|
CFLAGS += -D__PS4__ -I$(PS4SDK)/include -I $(PS4SDK)/include/sce
|
|
|
|
CFLAGS += -target x86_64-scei-ps4-elf -fPIE
|
|
|
|
CFLAGS += -DRARCH_INTERNAL -DRARCH_CONSOLE
|
|
|
|
CFLAGS += -DHAVE_FILTERS_BUILTIN $(DEFINES)
|
|
|
|
|
|
|
|
ifneq ($(PC_DEVELOPMENT_IP_ADDRESS),)
|
|
|
|
CFLAGS += -DPC_DEVELOPMENT_IP_ADDRESS='"$(PC_DEVELOPMENT_IP_ADDRESS)"'
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(PC_DEVELOPMENT_UDP_PORT),)
|
|
|
|
CFLAGS += -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(WHOLE_ARCHIVE_LINK), 1)
|
|
|
|
WHOLE_START := -Wl,--whole-archive
|
|
|
|
WHOLE_END := -Wl,--no-whole-archive
|
|
|
|
endif
|
2019-02-03 23:49:35 +00:00
|
|
|
CXXFLAGS := $(CFLAGS)
|
2018-12-27 19:16:43 +00:00
|
|
|
|
2019-01-03 08:46:04 +00:00
|
|
|
PS4_LIBS := -lps4link -ldebugnet -lorbisFile -lelfloader -lorbisKeyboard -lorbis2d -lpng -lz -lorbisGl -lorbisPad -lorbisAudio -lmod -lorbisFileBrowser -lorbisXbmFont -lSceNet_stub -lScePigletv2VSH_stub -lSceSystemService_stub -lSceUserService_stub -lScePad_stub -lSceAudioOut_stub -lSceIme_stub -lSceSysmodule_stub \
|
2018-12-29 23:10:37 +00:00
|
|
|
-lPs4_extension_kernel_call_standard -lPs4_extension_kernel_execute_dynlib_prepare_dlclose -lPs4_common_kernel -lPs4_common_user -lPs4_common_generic -lPs4LibCInternalAdaptive_stub -lPs4LibKernelAdaptive_stub -lSceLibcInternal_stub -lkernel_stub -lps4Kernel_stub -lPs4_base_stub_resolve_minimal -lPs4_base_kernel_dlsym_standard -lPs4_base_kernel_seek_elf_address_standard -lPs4_base_assembler_register_parameter_standard -lPs4_base_assembler_system_call_standard
|
2018-12-27 19:16:43 +00:00
|
|
|
|
2019-02-03 23:49:35 +00:00
|
|
|
LIBS := $(WHOLE_START) -lretro_orbis $(WHOLE_END) $(PS4_LIBS)
|
2018-12-27 19:16:43 +00:00
|
|
|
|
|
|
|
TARGETS := $(TARGET).elf
|
|
|
|
|
|
|
|
DEPFLAGS = -MT $@ -MMD -MP -MF $*.Tdepend
|
|
|
|
POSTCOMPILE = mv -f $*.Tdepend $*.depend
|
|
|
|
|
|
|
|
all: $(TARGETS)
|
|
|
|
|
|
|
|
%.o: %.cpp
|
|
|
|
%.o: %.cpp %.depend
|
|
|
|
$(CXX) -c -o $@ $< $(CXXFLAGS) $(INCDIRS) $(DEPFLAGS)
|
|
|
|
$(POSTCOMPILE)
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
%.o: %.c %.depend
|
|
|
|
$(CC) -c -o $@ $< $(CFLAGS) $(INCDIRS) $(DEPFLAGS)
|
|
|
|
$(POSTCOMPILE)
|
|
|
|
|
|
|
|
%.o: %.S
|
|
|
|
%.o: %.S %.depend
|
|
|
|
$(CC) -c -o $@ $< $(ASFLAGS) $(INCDIRS) $(DEPFLAGS)
|
|
|
|
$(POSTCOMPILE)
|
|
|
|
|
|
|
|
%.o: %.s
|
|
|
|
%.o: %.s %.depend
|
|
|
|
$(CC) -c -o $@ $< $(ASFLAGS) $(INCDIRS) $(DEPFLAGS)
|
|
|
|
$(POSTCOMPILE)
|
|
|
|
|
|
|
|
%.depend: ;
|
|
|
|
|
|
|
|
$(TARGET).elf: $(OBJ) libretro_orbis.a
|
|
|
|
$(LD) $(CRTFILE) $(OBJ) $(LDFLAGS) $(LIBDIRS) $(LIBS) -o $@
|
|
|
|
|
|
|
|
clean:
|
2019-02-03 23:49:35 +00:00
|
|
|
rm -f $(OBJ) $(TARGET).elf
|
2018-12-27 19:16:43 +00:00
|
|
|
rm -f $(OBJ:.o=.depend)
|
|
|
|
|
2019-02-03 23:49:35 +00:00
|
|
|
.PHONY: clean all
|
2018-12-27 19:16:43 +00:00
|
|
|
.PRECIOUS: %.depend
|
|
|
|
|
2019-01-05 16:34:14 +00:00
|
|
|
-include $(OBJ:.o=.depend)
|