-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_dependencies.sh
executable file
·71 lines (59 loc) · 1.1 KB
/
get_dependencies.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
#!/bin/bash
deps_dir=$(readlink -f "$(dirname "$0")")/deps
selected_step="$1"
step_make_deps_dir() {
mkdir -p "$deps_dir"
}
step_get_git() {
#TODO
echo "get git"
}
step_get_python() {
brew install python
}
step_get_naken_asm() {
cd "$deps_dir"
git clone https://github.com/mikeakohn/naken_asm.git
cd naken_asm
./configure
make
}
step_get_tiled() {
brew install tiled
}
total_steps=0
failed_steps=0
step() {
if [ ! -z "$selected_step" -a "$selected_step" != "$1" ]; then
return
fi
echo
echo "========================================================="
echo " STEP $1"
echo "========================================================="
echo
total_steps=$((total_steps + 1))
cmd="step_$1"
$cmd
if [ $? -ne 0 ]; then
failed_steps=$((failed_steps + 1))
echo "FAIL: $1"
return 1
else
echo "SUCCESS: $1"
fi
}
step make_deps_dir
step get_git
step get_python
step get_naken_asm
step get_tiled
if [ "$failed_steps" -ne 0 ]; then
echo "$failed_steps failed steps"
else
echo
echo "Depencies ready in $deps_dir"
echo
echo "build:"
echo "NAKEN_BIN='$deps_dir/naken_asm/naken_asm' ./build.sh"
fi