forked from libretro/fceu-next
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile_ps3.sh
executable file
·251 lines (224 loc) · 5.11 KB
/
compile_ps3.sh
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
#!/bin/sh
FORMAT=PS3
BUILD_DIR_EXECUTABLES=`pwd`/ps3/pkg
#******************
# PROGRAM FUNCTIONS
#******************
function clean()
{
make -f Makefile.ps3 clean
}
function clean_multiman()
{
make -f ps3/Makefile-eboot-launcher clean MULTIMAN_SUPPORT=1
clean_elf
if [ -f "$BUILD_DIR_EXECUTABLES/USRDIR/EBOOT.BIN" ] ; then
echo "DELETE: $BUILD_DIR_EXECUTABLES/USRDIR/EBOOT.BIN exists, deleting.."
rm $BUILD_DIR_EXECUTABLES/USRDIR/EBOOT.BIN
else
echo "SKIP: $BUILD_DIR_EXECUTABLES/USRDIR/EBOOT.BIN doesn't exist."
fi
make -f Makefile.ps3 clean MULTIMAN_SUPPORT=1
}
function clean_elf()
{
if [ -f "$BUILD_DIR_EXECUTABLES/USRDIR/EBOOT.ELF" ] ; then
echo "DELETE: $BUILD_DIR_EXECUTABLES/USRDIR/EBOOT.ELF exists, deleting.."
rm $BUILD_DIR_EXECUTABLES/USRDIR/EBOOT.ELF
else
echo "SKIP: $BUILD_DIR_EXECUTABLES/USRDIR/EBOOT.ELF doesn't exist."
fi
if [ -f "$BUILD_DIR_EXECUTABLES/USRDIR/EBOOT.self" ] ; then
echo "DELETE: $BUILD_DIR_EXECUTABLES/USRDIR/EBOOT.self exists, deleting.."
rm $BUILD_DIR_EXECUTABLES/USRDIR/EBOOT.self
else
echo "SKIP: $BUILD_DIR_EXECUTABLES/USRDIR/EBOOT.self doesn't exist."
fi
if [ -f "$BUILD_DIR_EXECUTABLES/USRDIR/RELOAD.SELF" ] ; then
echo "DELETE: $BUILD_DIR_EXECUTABLES/USRDIR/RELOAD.SELF exists, deleting.."
rm $BUILD_DIR_EXECUTABLES/USRDIR/RELOAD.SELF
else
echo "SKIP: $BUILD_DIR_EXECUTABLES/USRDIR/RELOAD.SELF doesn't exist."
fi
}
function make_ps3()
{
make -f Makefile.ps3
}
function make_ps3_multiman()
{
make -f ps3/Makefile-eboot-launcher
make -f Makefile.ps3 MULTIMAN_SUPPORT=1
}
function make_ps3_pkg()
{
make -f Makefile.ps3 pkg
}
function make_ps3_pkg_multiman()
{
make -f ps3/Makefile-eboot-launcher pkg MULTIMAN_SUPPORT=1
clean_elf
make -f Makefile.ps3 pkg-signed MULTIMAN_SUPPORT=1
}
function make_ps3_eboot()
{
make -f ps3/Makefile-eboot-launcher
}
function debug_elf()
{
if [ -f "`pwd`/genplusnext-ps3.elf" ] ; then
ppu-addr2line -e genplusnext-ps3.elf -f
else
echo "ERROR: ELF does not exist"
fi
}
#******************
# DISPLAY FUNCTIONS
#******************
function title()
{
echo ""
echo "***********************"
echo "COMPILER SCRIPT FOR $FORMAT"
echo "***********************"
}
function display_clean()
{
echo "clean Clean the object files"
}
function display_clean_multiman()
{
echo "clean_multiman Clean the object files (multiMAN-only"
}
function display_make()
{
echo "make Compile PS3 version"
}
function display_make_multiman()
{
echo "make_multiman Compile PS3 version (multiMAN-only)"
}
function display_make_eboot()
{
echo "make_eboot Compile PS3 eboot (multiMAN-only)"
}
function display_pkg()
{
echo "pkg Create PS3 PKG"
}
function display_pkg_multiman()
{
echo "pkg_multiman Create PS3 PKG (multiMAN-only)"
}
function display_clean_elf()
{
echo "clean_elf Clean pre-existing ELF binaries"
}
function display_debug_elf()
{
echo "debug_elf Debug ELF"
}
function display_all_options()
{
display_clean
display_clean_multiman
display_clean_elf
display_debug_elf
display_make
display_make_eboot
display_make_multiman
display_pkg
display_pkg_multiman
}
function display_usage()
{
echo "Usage: compile_ps3.sh [options]"
echo "Options:"
display_all_options
}
#***********************
# MAIN CONTROL FLOW LOOP
#***********************
title
if [ ! -n "$1" ]; then
display_usage
else
for i in "$@"
do
if [ "$i" = "help" ]; then
display_usage
fi
if [ "$i" = "clean" ]; then
echo ""
echo "*************************************"
echo "DOING:"
display_clean
echo "*************************************"
clean
fi
if [ "$i" = "clean_elf" ]; then
echo ""
echo "*************************************"
echo "DOING:"
display_clean_elf
echo "*************************************"
clean_elf
fi
if [ "$i" = "clean_multiman" ]; then
echo ""
echo "*************************************"
echo "DOING:"
display_clean_multiman
echo "*************************************"
clean_multiman
fi
if [ "$i" = "debug_elf" ]; then
echo ""
echo "*************************************"
echo "DOING:"
display_debug_elf
echo "*************************************"
debug_elf
fi
if [ "$i" = "make" ]; then
echo ""
echo "*************************************"
echo "DOING:"
display_make
echo "*************************************"
make_ps3
fi
if [ "$i" = "make_multiman" ]; then
echo ""
echo "*************************************"
echo "DOING:"
display_make_multiman
echo "*************************************"
make_ps3_multiman
fi
if [ "$i" = "make_eboot" ]; then
echo ""
echo "*************************************"
echo "DOING:"
display_make_eboot
echo "*************************************"
make_ps3_eboot
fi
if [ "$1" = "pkg" ]; then
echo ""
echo "*************************************"
echo "DOING:"
display_pkg
echo "*************************************"
make_ps3_pkg
fi
if [ "$1" = "pkg_multiman" ]; then
echo ""
echo "*************************************"
echo "DOING:"
display_pkg_multiman
echo "*************************************"
make_ps3_pkg_multiman
fi
done
fi