-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathenv-setup
62 lines (57 loc) · 1.65 KB
/
env-setup
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
#!/bin/bash
if [ ${0##*/} != 'env-setup' ]
then
export BUILD_ROOT=$(realpath .)
rgbds_build() {
cd "${BUILD_ROOT}" &&
echo "Build rgbds..." &&
make -C rgbds &&
[ -z "${PATH_EXPORTED}" ] && {
export PATH="$(realpath rgbds):${PATH}"
PATH_EXPORTED=y
}
}
if which rgbasm >/dev/null
then
rgbasm -V
echo 'if rgbasm < v0.6.0, run "rgbds_build" instead'
else
rgbds_build
fi
pmc_init() {
cd "${BUILD_ROOT}" &&
mkdir -p build &&
rsync -avz --exclude=".git" pokecrystal_cn/ build/
}
pmc_finit() {
cd "${BUILD_ROOT}" &&
mkdir -p build &&
rsync -avz --delete --delete-excluded --exclude=".git" pokecrystal_cn/ build/
}
pmc_itext() {
cd "${BUILD_ROOT}" &&
patch -d build/ -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