2021-12-15 18:01:56 +00:00
|
|
|
TARGET := retroarch_ps2
|
|
|
|
TARGET_RELEASE = retroarchps2.elf
|
|
|
|
|
2020-06-05 20:01:10 +00:00
|
|
|
BUILD_FOR_PCSX2 = 0
|
2019-02-25 22:43:34 +00:00
|
|
|
DEBUG = 0
|
2021-08-07 19:59:16 +00:00
|
|
|
SCREEN_DEBUG = 0
|
2021-12-15 18:01:56 +00:00
|
|
|
GRIFFIN_BUILD = 0
|
2018-09-18 06:08:06 +00:00
|
|
|
HAVE_THREADS = 0
|
2019-03-09 13:11:04 +00:00
|
|
|
MUTE_WARNINGS = 1
|
2021-12-15 18:01:56 +00:00
|
|
|
WHOLE_ARCHIVE_LINK = 0
|
|
|
|
HAVE_STATIC_DUMMY ?= 0
|
2021-01-19 13:31:45 +00:00
|
|
|
PS2_IP = 192.168.1.10
|
2018-09-18 06:08:06 +00:00
|
|
|
|
|
|
|
ifeq ($(DEBUG), 1)
|
2018-10-18 22:56:14 +00:00
|
|
|
OPTIMIZE_LV := -O0 -g
|
2021-12-15 18:01:56 +00:00
|
|
|
DEFINES += -DDEBUG
|
2018-09-18 06:08:06 +00:00
|
|
|
else
|
2020-06-07 17:42:29 +00:00
|
|
|
OPTIMIZE_LV := -O3
|
2021-12-15 18:01:56 +00:00
|
|
|
# LDFLAGS := -s
|
2018-09-18 06:08:06 +00:00
|
|
|
endif
|
|
|
|
|
2019-01-04 00:30:56 +00:00
|
|
|
ifeq ($(MUTE_WARNINGS), 1)
|
2021-01-30 14:46:02 +00:00
|
|
|
DISABLE_WARNINGS := -Wno-unused -Wno-format -Wno-format-truncation
|
2019-01-04 00:30:56 +00:00
|
|
|
endif
|
|
|
|
|
2021-12-15 18:01:56 +00:00
|
|
|
ifeq ($(HAVE_STATIC_DUMMY),1)
|
|
|
|
DEFINES += -DHAVE_STATIC_DUMMY
|
|
|
|
else
|
|
|
|
LIBS += -lretro_ps2
|
|
|
|
endif
|
2018-09-18 06:08:06 +00:00
|
|
|
|
2021-08-07 19:59:16 +00:00
|
|
|
ifeq ($(SCREEN_DEBUG), 1)
|
|
|
|
LIBS += -ldebug
|
2022-03-15 21:48:43 +00:00
|
|
|
DEFINES += -DSCREEN_DEBUG
|
2021-08-07 19:59:16 +00:00
|
|
|
endif
|
|
|
|
|
2019-09-29 20:41:51 +00:00
|
|
|
ifeq ($(BUILD_FOR_PCSX2), 1)
|
2022-03-15 21:48:43 +00:00
|
|
|
DEFINES += -DBUILD_FOR_PCSX2
|
2019-09-29 20:41:51 +00:00
|
|
|
endif
|
2018-09-18 06:08:06 +00:00
|
|
|
|
2021-12-15 18:01:56 +00: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
|
|
|
|
HAVE_CHEATS = 1
|
|
|
|
HAVE_RGUI = 1
|
2022-03-16 08:41:58 +00:00
|
|
|
HAVE_MATERIALUI = 0
|
|
|
|
HAVE_XMB = 0
|
|
|
|
HAVE_OZONE = 0
|
2021-12-15 18:01:56 +00:00
|
|
|
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-18 06:08:06 +00:00
|
|
|
endif
|
|
|
|
|
2021-12-15 18:01:56 +00:00
|
|
|
ifeq ($(strip $(PS2SDK)),)
|
|
|
|
$(error "Please set PS2SDK in your environment. export PS2SDK=<path to>ps2sdk")
|
|
|
|
endif
|
2018-09-18 06:08:06 +00:00
|
|
|
|
2021-12-15 18:01:56 +00:00
|
|
|
INCDIR = -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/ports/include
|
|
|
|
INCDIR += -Ips2/include -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 -laudsrv -lmtap -lpadx -lz -lcdvd -lelf-loader -lfileXio -lpoweroff
|
|
|
|
|
|
|
|
|
|
|
|
CFLAGS = $(OPTIMIZE_LV) $(DISABLE_WARNINGS) $(DEFINES) -DPS2 -ffast-math -fsingle-precision-constant
|
|
|
|
ASFLAGS = $(CFLAGS)
|
|
|
|
|
|
|
|
# IRX libs
|
|
|
|
IRX_FILES += sio2man.irx iomanX.irx fileXio.irx
|
|
|
|
IRX_FILES += mcman.irx mcserv.irx
|
|
|
|
IRX_FILES += usbd.irx bdm.irx bdmfs_vfat.irx usbmass_bd.irx
|
|
|
|
IRX_FILES += libsd.irx audsrv.irx
|
|
|
|
IRX_FILES += cdfs.irx
|
|
|
|
IRX_FILES += ps2dev9.irx ps2atad.irx ps2hdd.irx ps2fs.irx poweroff.irx
|
|
|
|
IRX_FILES += mtapman.irx padman.irx
|
|
|
|
EE_OBJS += $(IRX_FILES:.irx=_irx.o)
|
2019-02-25 22:43:34 +00:00
|
|
|
|
2018-09-18 06:08:06 +00:00
|
|
|
# Missing objecst on the PS2SDK
|
2021-01-23 23:04:04 +00:00
|
|
|
EE_OBJS += ps2/compat_files/ps2_devices.o
|
2018-09-18 06:08:06 +00:00
|
|
|
|
2021-12-15 18:01:56 +00:00
|
|
|
EE_OBJS += $(OBJ)
|
2018-09-18 06:08:06 +00:00
|
|
|
|
|
|
|
EE_CFLAGS = $(CFLAGS)
|
2019-01-07 20:49:55 +00:00
|
|
|
EE_CXXFLAGS = $(CFLAGS)
|
2018-09-18 06:08:06 +00:00
|
|
|
EE_LDFLAGS = $(LDFLAGS)
|
|
|
|
EE_LIBS = $(LIBS)
|
|
|
|
EE_ASFLAGS = $(ASFLAGS)
|
|
|
|
EE_INCS = $(INCDIR)
|
2021-12-15 18:01:56 +00:00
|
|
|
EE_BIN = $(TARGET).elf
|
2018-09-18 06:08:06 +00:00
|
|
|
EE_GPVAL = $(GPVAL)
|
|
|
|
|
2019-02-25 18:29:56 +00:00
|
|
|
|
2021-12-15 18:01:56 +00:00
|
|
|
all: $(EE_BIN)
|
2018-09-18 06:08:06 +00:00
|
|
|
|
|
|
|
clean:
|
2019-02-25 22:43:34 +00:00
|
|
|
rm -f $(EE_BIN) $(EE_OBJS)
|
2018-09-18 06:08:06 +00:00
|
|
|
|
|
|
|
prepare:
|
|
|
|
ps2client -h $(PS2_IP) reset
|
|
|
|
ps2client -h $(PS2_IP) netdump
|
|
|
|
|
|
|
|
run:
|
|
|
|
ps2client -h $(PS2_IP) execee host:$(EE_BIN)
|
|
|
|
|
2019-10-07 21:45:54 +00:00
|
|
|
sim:
|
|
|
|
PCSX2 --elf=$(PWD)/$(EE_BIN) --nogui
|
|
|
|
|
|
|
|
debug: clean all run
|
2018-09-18 06:08:06 +00:00
|
|
|
|
2021-12-15 18:01:56 +00:00
|
|
|
release: all
|
2018-12-26 12:40:20 +00:00
|
|
|
ps2-packer $(EE_BIN) $(TARGET_RELEASE)
|
|
|
|
|
2021-12-15 18:01:56 +00:00
|
|
|
# IRX files
|
|
|
|
%_irx.c:
|
|
|
|
$(PS2SDK)/bin/bin2c $(PS2SDK)/iop/irx/$*.irx $@ $*_irx
|
2018-12-31 12:47:58 +00:00
|
|
|
|
2018-09-18 06:08:06 +00:00
|
|
|
#Include preferences
|
2019-02-03 23:49:35 +00:00
|
|
|
include $(PS2SDK)/samples/Makefile.pref
|
2019-10-07 21:45:54 +00:00
|
|
|
include $(PS2SDK)/samples/Makefile.eeglobal_cpp
|