forked from sandia-minimega/minimega
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.bash
executable file
·61 lines (53 loc) · 1.32 KB
/
build.bash
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
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. $SCRIPT_DIR/env.bash
# set the version from the repo
VERSION=`git rev-parse HEAD`
DATE=`date --rfc-3339=date`
echo "package version
var (
Revision = \"$VERSION\"
Date = \"$DATE\"
)
" > $SCRIPT_DIR/src/version/version.go
# build packages with race detection
#echo "BUILD RACE PACKAGES (linux)"
#echo "protonuke"
#go install -race protonuke
#mv $SCRIPT_DIR/bin/protonuke $SCRIPT_DIR/bin/protonuke_race
#echo "minimega"
#go install -race minimega
#mv $SCRIPT_DIR/bin/minimega $SCRIPT_DIR/bin/minimega_race
#echo "miniccc"
#go install -race miniccc
#mv $SCRIPT_DIR/bin/miniccc $SCRIPT_DIR/bin/miniccc_race
#echo "vmbetter"
#go install -race vmbetter
#mv $SCRIPT_DIR/bin/vmbetter $SCRIPT_DIR/bin/vmbetter_race
#echo
# build packages
echo "BUILD PACKAGES (linux)"
for i in `ls $SCRIPT_DIR/src`
do
echo $i
go install $i
done
echo
# build windows packages
echo "BUILD PACKAGES (windows)"
echo "protonuke"
GOOS=windows go install protonuke
echo "miniccc"
GOOS=windows go install miniccc
echo
unset GOOS
# build python bindings
echo "BUILD PYTHON BINDINGS"
$SCRIPT_DIR/misc/python/genapi.py $SCRIPT_DIR/bin/minimega > \
$SCRIPT_DIR/misc/python/minimega.py 2> /dev/null
if [[ $? != 0 ]]; then
echo "minimega.py - FAILED"
else
echo "minimega.py - OK"
fi
echo