RetroArch/Makefile.ps2

130 lines
2.9 KiB
Makefile
Raw Permalink Normal View History

TARGET := retroarch_ps2
TARGET_RELEASE = retroarchps2.elf
2020-06-05 13:01:10 -07:00
BUILD_FOR_PCSX2 = 0
2019-02-25 14:43:34 -08:00
DEBUG = 0
SCREEN_DEBUG = 0
GRIFFIN_BUILD = 0
2018-09-17 23:08:06 -07:00
HAVE_THREADS = 0
MUTE_WARNINGS = 1
WHOLE_ARCHIVE_LINK = 0
HAVE_STATIC_DUMMY ?= 0
PS2_IP = 192.168.1.10
2018-09-17 23:08:06 -07:00
ifeq ($(DEBUG), 1)
OPTIMIZE_LV := -O0 -g
DEFINES += -DDEBUG
2018-09-17 23:08:06 -07:00
else
2020-06-07 10:42:29 -07:00
OPTIMIZE_LV := -O3
2018-09-17 23:08:06 -07:00
endif
2019-01-03 16:30:56 -08:00
ifeq ($(MUTE_WARNINGS), 1)
2021-01-30 06:46:02 -08:00
DISABLE_WARNINGS := -Wno-unused -Wno-format -Wno-format-truncation
2019-01-03 16:30:56 -08:00
endif
ifeq ($(HAVE_STATIC_DUMMY),1)
DEFINES += -DHAVE_STATIC_DUMMY
else
LIBS += -lretro_ps2
endif
2018-09-17 23:08:06 -07:00
ifeq ($(SCREEN_DEBUG), 1)
LIBS += -ldebug
2022-03-15 14:48:43 -07:00
DEFINES += -DSCREEN_DEBUG
endif
ifeq ($(BUILD_FOR_PCSX2), 1)
2022-03-15 14:48:43 -07:00
DEFINES += -DBUILD_FOR_PCSX2
endif
2018-09-17 23:08:06 -07:00
DEFINES += -DRARCH_INTERNAL -DRARCH_CONSOLE
ifeq ($(GRIFFIN_BUILD), 1)
OBJ += griffin/griffin.o
DEFINES += -DHAVE_GRIFFIN=1 -DHAVE_SCREENSHOTS -DHAVE_REWIND -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_CHEATS
DEFINES += -DHAVE_ZLIB -DHAVE_NO_BUILTINZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP -D_7ZIP_ST -DHAVE_CC_RESAMPLER -DHAVE_AUDIOMIXER
DEFINES += -DHAVE_VIDEO_FILTER -DHAVE_RGUI -DHAVE_WINDOW_OFFSET
DEFINES += -DHAVE_DSP_FILTER
else
HAVE_CC_RESAMPLER = 1
HAVE_MENU_COMMON = 1
HAVE_RPNG = 1
HAVE_RJPEG = 1
HAVE_RBMP = 1
HAVE_MENU = 1
HAVE_CONFIGFILE = 1
HAVE_PATCH = 1
XDelta patch support (Take 2) (#15915) * Add xdelta in deps * Include <assert.h> in xdelta3.h - Otherwise the static_assert calls can fail * Build xdelta3 in Makefile.common * Add xdelta support to the softpatching infrastructure - The patching itself isn't fully implemented yet * Adjust how xdelta3.h checks the sizes of some types - Now checks max values instead of relying on autotools * Add some enums that were excluded by the cherry-pick * Remove stray whitespace * Adjust SIZE macros in xdelta3.h - Move them outside the XD3_USE_LARGEFILE64 block - Add more SIZE declarations - Make SIZEOF_UNSIGNED_LONG_LONG contingent on the presence of ULLONG_MAX * Reintegrate xdelta support * Enable support for xdelta's secondary compressors - Necessary for some patches * Fix some format specifiers * Remove unnecessary files from xdelta * Include xdelta3.h with a relative path * Add xdelta3 headers to HEADERS variable * Gate Xdelta support behind HAVE_XDELTA - HAVE_XDELTA is on by default - HAVE_PATCH is still required for HAVE_XDELTA to be meaningful - Support is mostly contingent on the availability of LZMA - Anything modern should be okay - Legacy platforms (e.g. DOS) may need to have Xdelta support disabled - At least until some other solution can be found * Disable HAVE_XDELTA on platforms where the build recently failed - These come from looking at the failed builds on GitHub - These are guesses, and may turn out to be wrong * Fix a potential memory leak - Whoops, looks like I need to call two cleanup functions - xd3_close_stream exists separately from xd3_free_stream * Split the --help printout for --xdelta into its own strlcat call - GCC was complaining about #ifdefs within macro arguments being non-portable * Fix some incorrect printf format specifiers * Modify Xdelta to adhere to C89 - It's mostly using RetroArch's INLINE macro instead of the inline keyword * Slight cleanups * Remove a stray comma that was hindering C89 builds * Add XDelta support to CHANGES.md * Change how the xdelta patch's name is computed - To be in line with other recent refactoring * Fix an incorrect merge - Whoops, this part was from before I figured out how to get the size of a patched file * Explain the song-and-dance behind computing a patched file's size * Define some XDelta3-related constants to 0 on 32-bit platforms * Adjust some Xdelta-related macro definitions - Exclude the encoder, since we're not making patches - Move some #defines to after inclusion of <stdint.h>, to fix undefined behavior - Remove _WIN32_WINNT overrides, since they were for code that we're not using * Fix Xdelta support * Wrap an encoder-only function in `#if XD3_ENCODER`
2023-11-23 20:19:07 -08:00
HAVE_PATCH = 0 # disabled because <lzma.h> isn't available (or we haven't figured out how to install it)
HAVE_CHEATS = 1
HAVE_RGUI = 1
HAVE_MATERIALUI = 0
HAVE_XMB = 0
HAVE_OZONE = 0
HAVE_ZLIB = 1
HAVE_NO_BUILTINZLIB = 1
HAVE_7ZIP = 1
HAVE_SCREENSHOTS = 1
HAVE_REWIND = 1
HAVE_AUDIOMIXER = 1
HAVE_RWAV = 1
HAVE_DSP_FILTER = 1
HAVE_VIDEO_FILTER = 1
HAVE_FILTERS_BUILTIN = 1
HAVE_WINDOW_OFFSET = 1
include Makefile.common
CFLAGS += $(DEF_FLAGS)
BLACKLIST :=
OBJ := $(filter-out $(BLACKLIST),$(OBJ))
INCDIRS += $(INCLUDE_DIRS)
2018-09-17 23:08:06 -07:00
endif
ifeq ($(strip $(PS2SDK)),)
$(error "Please set PS2SDK in your environment. export PS2SDK=<path to>ps2sdk")
endif
2018-09-17 23:08:06 -07:00
INCDIR = -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/ports/include
INCDIR += -Ilibretro-common/include -Ideps -Ideps/stb -Ideps/7zip
LDFLAGS += -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ports/lib -L.
# Lib cdvd is needed to get proper time
LIBS += -lpatches -lgskit -ldmakit -lps2_drivers -lz -lelf-loader
CFLAGS = $(OPTIMIZE_LV) $(DISABLE_WARNINGS) $(DEFINES) -DPS2 -ffast-math -fsingle-precision-constant
ASFLAGS = $(CFLAGS)
EE_OBJS += $(OBJ)
2018-09-17 23:08:06 -07:00
EE_CFLAGS = $(CFLAGS)
2019-01-07 12:49:55 -08:00
EE_CXXFLAGS = $(CFLAGS)
2018-09-17 23:08:06 -07:00
EE_LDFLAGS = $(LDFLAGS)
EE_LIBS = $(LIBS)
EE_ASFLAGS = $(ASFLAGS)
EE_INCS = $(INCDIR)
EE_BIN = $(TARGET).elf
2018-09-17 23:08:06 -07:00
EE_GPVAL = $(GPVAL)
all: $(EE_BIN)
2018-09-17 23:08:06 -07:00
clean:
2019-02-25 14:43:34 -08:00
rm -f $(EE_BIN) $(EE_OBJS)
2018-09-17 23:08:06 -07:00
prepare:
ps2client -h $(PS2_IP) reset
ps2client -h $(PS2_IP) netdump
run:
ps2client -h $(PS2_IP) execee host:$(EE_BIN)
sim:
PCSX2 --elf=$(PWD)/$(EE_BIN) --nogui
debug: clean all run
2018-09-17 23:08:06 -07:00
release: all
2018-12-26 04:40:20 -08:00
ps2-packer $(EE_BIN) $(TARGET_RELEASE)
2018-09-17 23:08:06 -07:00
#Include preferences
2019-02-03 15:49:35 -08:00
include $(PS2SDK)/samples/Makefile.pref
include $(PS2SDK)/samples/Makefile.eeglobal_cpp