-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
56 lines (44 loc) · 1.41 KB
/
build.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
#!/bin/bash
[[ ! -d bin ]] && mkdir bin
if [[ ! -f bin/s2p2bin ]]; then
echo "Compiling s2p2bin..."
g++ -O3 -s -o bin/s2p2bin build_source/s2p2bin.cpp build_source/KensSaxComp/S-Compressor.cpp &> /dev/null
fi
if [[ ! -f bin/fixpointer ]]; then
echo "Compiling fixpointer..."
g++ -O3 -s -o bin/fixpointer build_source/fixpointer.cpp &> /dev/null
fi
if [[ ! -f bin/fixheader ]]; then
echo "Compiling fixheader..."
g++ -O3 -s -o bin/fixheader build_source/fixheader.cpp &> /dev/null
fi
[[ -f s2built.bin ]] && mv -f s2built.bin s2built.prev.bin
rm -f s2.p s2.h s2.log
debug_syms=""
print_err="-E -q"
for n in `seq 1 2`; do
if [[ "$1" == "-ds" ]]; then
debug_syms="-g MAP"
echo "Will generate debug symbols"
elif [[ "$1" == "-pe" ]]; then
print_err=""
echo "Selected detailed assembler output"
fi
shift
done
echo Assembling...
asl -xx -c $debug_syms $print_err -A -U -L s2.asm
if [[ -f s2.log ]]; then
echo
echo "*****************************************"
echo "* *"
echo "* There were build errors/warnings. *"
echo "* *"
echo "*****************************************"
echo
cat s2.log
exit 1
fi
[[ -f s2.p ]] && bin/s2p2bin s2.p s2built.bin s2.h
[[ -f s2built.bin ]] && bin/fixpointer s2.h s2built.bin off_3A294 MapRUnc_Sonic \$2D 0 4 word_728C_user Obj5F_MapUnc_7240 2 2 1
[[ -f s2built.bin ]] && bin/fixheader s2built.bin