forked from libretro/RetroArch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.ps2
120 lines (91 loc) · 3.32 KB
/
Makefile.ps2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
BUILD_PRX = 0
DEBUG = 0
HAVE_KERNEL_PRX = 0
HAVE_LOGGER = 0
HAVE_FILE_LOGGER = 0
HAVE_THREADS = 0
BIG_STACK = 0
MUTE_WARNINGS = 1
PS2_IP = 192.168.1.150
TARGET = retroarchps2.elf
TARGET_RELEASE = retroarchps2-release.elf
# Lib CDVD
CDVD_DIR = ps2/libcdvd
# Compile the IRXs first
IRX_DIR = ps2/irx
IRX_FILES = $(wildcard ps2/irx/*.c)
ifeq ($(DEBUG), 1)
OPTIMIZE_LV := -O0 -g
RARCH_DEFINES += -DDEBUG
else
OPTIMIZE_LV := -O2
LDFLAGS := -s
endif
ifeq ($(MUTE_WARNINGS), 1)
DISABLE_WARNINGS := -Wno-sign-compare -Wno-unused -Wno-parentheses
endif
INCDIR = -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/ports/include -I$(CDVD_DIR)/ee
INCDIR += -Ips2 -Ips2/include -Ilibretro-common/include -Ilibretro-common/include/compat/zlib
INCDIR += -Ideps -Ideps/stb -Ideps/libz -Ideps/7zip -Ideps/pthreads -Ideps/pthreads/platform/ps2 -Ideps/pthreads/platform/helper
GPVAL = -G0
CFLAGS = $(OPTIMIZE_LV) $(DISABLE_WARNINGS) -ffast-math -fsingle-precision-constant
ASFLAGS = $(CFLAGS)
RARCH_DEFINES += -DPS2 -DUSE_IOP_CTYPE_MACRO -D_MIPS_ARCH_R5900 -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG
RARCH_DEFINES += -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_RGUI -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP -DHAVE_CC_RESAMPLER
LIBDIR =
LDFLAGS += -L$(PS2SDK)/ports/lib -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ee/lib -L$(CDVD_DIR)/lib -L.
LIBS += -lretro_ps2 -lgskit -ldmakit -lgskit_toolkit -laudsrv -lmf -lpadx -lmtap -lmc -lhdd -lsdl -lfileXio -lz
LIBS += -lcdvdfs -lpatches -lpoweroff
ifeq ($(HAVE_THREADS), 1)
RARCH_DEFINES += -DHAVE_THREADS
endif
ifeq ($(HAVE_FILE_LOGGER), 1)
CFLAGS += -DHAVE_FILE_LOGGER
endif
ifeq ($(HAVE_KERNEL_PRX), 1)
CFLAGS += -DHAVE_KERNEL_PRX
endif
ifeq ($(BIG_STACK), 1)
CFLAGS += -DBIG_STACK
endif
CFLAGS += $(RARCH_DEFINES)
# All the IRX objects
EE_OBJS += $(IRX_DIR)/freemtap_irx.o $(IRX_DIR)/freepad_irx.o $(IRX_DIR)/freesio2_irx.o $(IRX_DIR)/iomanX_irx.o
EE_OBJS += $(IRX_DIR)/fileXio_irx.o $(IRX_DIR)/mcman_irx.o $(IRX_DIR)/mcserv_irx.o $(IRX_DIR)/usbd_irx.o
EE_OBJS += $(IRX_DIR)/usbhdfsd_irx.o $(IRX_DIR)/freesd_irx.o $(IRX_DIR)/audsrv_irx.o $(IRX_DIR)/poweroff_irx.o
EE_OBJS += $(IRX_DIR)/cdvd_irx.o
# Missing objecst on the PS2SDK
EE_OBJS += ps2/compat_files/compat_ctype.o ps2/compat_files/time.o ps2/compat_files/ps2_devices.o
EE_OBJS += ps2/compat_files/fileXio_cdvd.o ps2/compat_files/ps2_descriptor.o
#EE_OBJS = griffin/griffin.o bootstrap/ps2/kernel_functions.o
EE_OBJS += griffin/griffin.o
EE_CFLAGS = $(CFLAGS)
EE_CXXFLAGS = $(CFLAGS)
EE_LDFLAGS = $(LDFLAGS)
EE_LIBS = $(LIBS)
EE_ASFLAGS = $(ASFLAGS)
EE_INCS = $(INCDIR)
EE_BIN = $(TARGET)
EE_GPVAL = $(GPVAL)
all: irxdir $(EE_BIN)
irxdir:
$(MAKE) -C $(IRX_DIR)
clean:
rm -f $(EE_BIN) $(EE_OBJS)
$(MAKE) -C $(IRX_DIR) clean
prepare:
ps2client -h $(PS2_IP) reset
ps2client -h $(PS2_IP) netdump
run:
ps2client -h $(PS2_IP) execee host:$(EE_BIN)
debug: clean prepare all run
package:
ps2-packer $(EE_BIN) $(TARGET_RELEASE)
release: clean all package
#Include preferences
include $(PS2SDK)/samples/Makefile.pref
include $(PS2SDK)/samples/Makefile.eeglobal
#Linking with C++
$(EE_BIN): $(EE_OBJS) $(PS2SDK)/ee/startup/crt0.o
$(EE_CXX) $(EE_NO_CRT) -T$(PS2SDK)/ee/startup/linkfile $(EE_CXXFLAGS) \
-o $(EE_BIN) $(PS2SDK)/ee/startup/crt0.o $(CRTI_OBJ) $(CRTBEGIN_OBJ) $(EE_OBJS) $(CRTEND_OBJ) $(CRTN_OBJ) $(EE_LDFLAGS) $(EE_LIBS)