forked from jarvinet/orienteering-game
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·97 lines (78 loc) · 1.88 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash
THIS_NAME=$(basename "$0")
BINARY_NAME="open-forest"
function do_build()
{
# FIXME: cd to THIS_PATH
mkdir -p build/cmake
cd build/cmake
cmake -DCMAKE_BUILD_TYPE=None "$@" ../.. && make
}
function do_make()
{
# FIXME: cd to THIS_PATH
cd build/cmake
make
}
function do_make_openforest()
{
# FIXME: cd to THIS_PATH
cd build/cmake
make open-forest/fast
}
function do_clean()
{
# FIXME: cd to THIS_PATH
cd build
rm -rf cmake
# (ignoring build/open-forest)
}
function do_init-submodules()
{
# FIXME: cd to THIS_PATH
# create git submodules (libs/)
git submodule init
git submodule update
}
function do_usage()
{
echo "usage: $THIS_NAME : same as '$THIS_NAME build'"
echo " $THIS_NAME build : configure and build into './build' folder, using CMake"
echo " $THIS_NAME make : make preconfigured CMake by 'build'"
echo " $THIS_NAME make-openforest : make openforest part of preconfigured CMake by 'build'"
echo " $THIS_NAME clean : clean build"
echo " $THIS_NAME init-submodules : retrieve git-submodules (only needed for first build)"
}
################################################################################
# main
if [ "$#" -eq 0 ] ; then
# build program, default
echo ""
echo "running '$THIS_NAME build'. use '$THIS_NAME help' for other options."
do_build
else
# handle arguments
case "$1" in
"build")
do_build
;;
"make")
do_make
;;
"make-openforest")
do_make_openforest
;;
"clean")
do_clean
;;
"init-submodules")
do_init-submodules
;;
"help")
do_usage
;;
*)
do_usage
;;
esac
fi