-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathbuild_daedalus.sh
100 lines (80 loc) · 2.33 KB
/
build_daedalus.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
#!/bin/bash
function usage() {
echo "Usage ./build_daedalus.sh BUILD_TYPE"
echo "Build Types:"
echo "PSP Release = PSP_RELEASE"
echo "PSP Debug = PSP_DEBUG"
echo "Linux Release = LINUX_RELEASE"
echo "Mac Release = MAC_RELEASE"
echo "3DS Release = CTR_RELEASE"
exit
}
function pre_prep(){
if [ -d $PWD/daedbuild ]; then
echo "Removing previous build attempt"
rm -r "$PWD/daedbuild"
mkdir "$PWD/daedbuild"
fi
if [ -d $PWD/DaedalusX64 ]; then
rm -r $PWD/DaedalusX64/EBOOT.PBP
else
mkdir $PWD/DaedalusX64
mkdir ../DaedalusX64/SaveStates
mkdir ../DaedalusX64/SaveGames
mkdir ../DaedalusX64/Roms
fi
}
function finalPrep() {
if [ ! -d ../DaedalusX64 ]; then
mkdir ../DaedalusX64/SaveStates
mkdir ../DaedalusX64/SaveGames
mkdir ../DaedalusX64/Roms
fi
if [ -f "$PWD/EBOOT.PBP" ]; then
mv "$PWD/EBOOT.PBP" ../DaedalusX64/
cp -r ../Data/* ../DaedalusX64/
else
cp -r ../Data/* ../DaedalusX64/
cp ../Source/SysGL/HLEGraphics/n64.psh ../DaedalusX64
fi
}
function buildPSP() {
make -C "$PWD/../Source/SysPSP/PRX/DveMgr"
make -C "$PWD/../Source/SysPSP/PRX/ExceptionHandler"
make -C "$PWD/../Source/SysPSP/PRX/KernelButtons"
make -C "$PWD/../Source/SysPSP/PRX/MediaEngine"
make -j8
#No point continuing if the elf file doesn't exist
if [ -f "$PWD/daedalus.elf" ]; then
#Pack PBP
psp-fixup-imports daedalus.elf
mksfoex -d MEMSIZE=1 DaedalusX64 PARAM.SFO
psp-prxgen daedalus.elf daedalus.prx
cp ../Source/SysPSP/Resources/eboot_icons/* "$PWD"
pack-pbp EBOOT.PBP PARAM.SFO icon0.png NULL NULL pic1.png NULL daedalus.prx NULL
finalPrep
fi
}
## Main loop
if [ "$1" = "PSP_RELEASE" ] || [ "$1" = "PSP_DEBUG" ]; then
pre_prep
mkdir "$PWD/daedbuild"
cd "$PWD/daedbuild"
cmake -DCMAKE_TOOLCHAIN_FILE=../Tools/psptoolchain.cmake -D"$1=1" ../Source
buildPSP
elif [ "$1" = "CTR_RELEASE" ]; then
mkdir "$PWD/daedbuild"
cd "$PWD/daedbuild"
cmake -D"$1=1" ../Source -DCMAKE_TOOLCHAIN_FILE=../Tools/3dstoolchain.cmake -G "Unix Makefiles"
make
elif [ "$1" = "LINUX_RELEASE" ] || [ "$1" = "MAC_RELEASE" ]; then
pre_prep
mkdir "$PWD/daedbuild"
cd "$PWD/daedbuild"
cmake -D"$1=1" ../Source
make
finalPrep
cp daedalus ../DaedalusX64
else
usage
fi