-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathenv-setup-win32
76 lines (72 loc) · 2.32 KB
/
env-setup-win32
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
#!/bin/bash
if [ ${0##*/} != 'env-setup-win32' ]
then
export BUILD_ROOT=$(realpath .)
if which rgbasm >/dev/null
then
rgbasm -V
else
echo 'no rgbasm. wrong Environment?'
fi
export RM='rm -f'
if which robocopy >/dev/null
then
pmc_init() {
cd "${BUILD_ROOT}" &&
mkdir -p build &&
{ robocopy pokecrystal_cn build /e /xd .git ; [ $? -lt 8 ] ; } &&
cp -af ya_getopt/ya_getopt.* build/tools/ &&
(cd build && patch -p1 < ../tcc_winport.diff)
}
pmc_finit() {
cd "${BUILD_ROOT}" &&
mkdir -p build &&
{ robocopy pokecrystal_cn build /e /mir /xd .git ; [ $? -lt 8 ] ; } &&
cp -af ya_getopt/ya_getopt.* build/tools/ &&
(cd build && patch -p1 < ../tcc_winport.diff)
}
else
echo 'install robocopy for fast copy speed'
pmc_init() {
cd "${BUILD_ROOT}" &&
mkdir -p build &&
cp -af pokecrystal_cn/* build/ &&
cp -af ya_getopt/ya_getopt.* build/tools/ &&
(cd build && patch -p1 < ../tcc_winport.diff)
}
pmc_finit() {
cd "${BUILD_ROOT}" &&
mkdir -p build &&
rm -rf build/* &&
cp -af pokecrystal_cn/* build/ &&
cp -af ya_getopt/ya_getopt.* build/tools/ &&
(cd build && patch -p1 < ../tcc_winport.diff)
}
fi
pmc_itext() {
cd "${BUILD_ROOT}" &&
(cd build && patch -p1 < ../cn_credits.diff) &&
python3 tools/text_import_text.py
}
pmc_isys() {
cd "${BUILD_ROOT}" &&
python3 tools/text_import_sys.py
}
pmc_build() {
cd "${BUILD_ROOT}" &&
make -C build crystal11 &&
make -C build crystal11_debug
}
echo "************************"
echo " Env setuped! Usage:"
echo " Init build (fast, partial) : pmc_init"
echo " Full init build (slow, full) : pmc_finit"
echo " Import sys text to src dir: pmc_isys"
echo " Import game text to build dir: pmc_itext"
echo " Build ROM : pmc_build"
echo "************************"
else
echo "************************"
echo " Use \"source env-setup\" instead of running this script!"
echo "************************"
fi