-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·71 lines (59 loc) · 1.6 KB
/
build.sh
File metadata and controls
executable file
·71 lines (59 loc) · 1.6 KB
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
#!/bin/bash
buildfile="Resources/buildnum.txt"
rm -f *.o *.elf PARAM.SFO EBOOT.PBP buildinfo.c
if [ ! -f "$buildfile" ]; then
echo "1" >"$buildfile"
fi
buildnum=$(cat "$buildfile")
builddate=$(date "+%Y-%m-%d %H:%M")
echo "building DataDexter #$buildnum ($builddate)"
mkdir -p build
cd build
cmake_out=$(mktemp)
make_out=$(mktemp)
psp-cmake -DBUILD_PRX=1 -DENC_PRX=1 -DBUILD_DATE="$builddate" -DBUILD_NUM="$buildnum" .. >"$cmake_out" 2>&1
cmake_rc=$?
if [ $cmake_rc -ne 0 ]; then
echo "CMake configuration failed:"
sed -n '1,200p' "$cmake_out"
rm -f "$cmake_out" "$make_out"
exit $cmake_rc
fi
make >"$make_out" 2>&1
make_rc=$?
if [ $make_rc -ne 0 ]; then
echo "Build failed: "
sed -n '1,200p' "$make_out"
rm -f "$cmake_out" "$make_out"
exit $make_rc
fi
# If there are warnings, show them; otherwise remain quiet
if grep -i -n "warning" "$make_out" >/dev/null 2>&1; then
echo "Build completed, with warnings:"
grep -i "warning" -n "$make_out" | sed -n '1,200p'
fi
rm -f "$cmake_out" "$make_out"
if [ $? -eq 0 ]; then
cp EBOOT.PBP ..
cd ..
echo $((buildnum + 1)) >"$buildfile"
rm -f *.o *.elf PARAM.SFO buildinfo.c
rm -rf build
mkdir -p PSP/GAME/DataDexter
mv EBOOT.PBP PSP/GAME/DataDexter/
archive_out=$(mktemp)
7z a -t7z -mx=9 DataDexter_PSP.7z PSP >"$archive_out" 2>&1
arch_rc=$?
if [ $arch_rc -ne 0 ]; then
echo "Archiving failed??"
sed -n '1,200p' "$archive_out"
rm -f "$archive_out"
echo "done!"
else
rm -f "$archive_out"
echo "done!"
fi
else
echo "fuck!"
exit 1
fi