forked from DrChat/Gmod-vphysics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
62 lines (49 loc) · 828 Bytes
/
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
#!/bin/sh
# Settings
WORKING_DIR=$(pwd)
BULLET_PROJ_DIR=$WORKING_DIR/bullet/proj
init() {
NUM_THREADS="1"
CLEAN=""
CONFIG="release"
while test $# -gt 0; do
case "$1" in
"-numthreads")
NUM_THREADS="$2"
shift ;;
"-clean")
CLEAN="yes"
;;
"-config")
CONFIG="$2"
shift ;;
esac
shift # Shifts command line arguments var or something whatever
done
}
usage() {
echo "Usage: $0 <num threads>"
exit 1
}
build_bullet() {
if test -n $BULLET_PROJ_DIR; then
cd "$BULLET_PROJ_DIR"
./premake4 gmake
cd gmake
if test -n "$CLEAN"; then
make clean
fi
make -j$NUM_THREADS "config=$CONFIG"
fi
}
build_vphysics() {
cd "$WORKING_DIR/src"
if test -n "$CLEAN"; then
make clean
fi
make -j$NUM_THREADS "CONFIGURATION=$CONFIG"
}
init $*
build_bullet
build_vphysics
cd "$WORKING_DIR"