forked from sandia-minimega/minimega
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.bash
executable file
·64 lines (56 loc) · 1.33 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
62
63
64
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. $SCRIPT_DIR/env.bash
# set the version from the repo
VERSION=`git --git-dir $SCRIPT_DIR/.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 | grep -v vendor | grep -v plumbing`
do
echo $i
go install $i
if [[ $? != 0 ]]; then
exit 1
fi
done
for i in `ls $SCRIPT_DIR/src/plumbing`
do
echo $i
go install plumbing/$i
if [[ $? != 0 ]]; then
exit 1
fi
done
echo
# build windows packages
echo "BUILD PACKAGES (windows)"
for i in "protonuke" "miniccc"; do
echo $i
GOOS=windows go build -o $SCRIPT_DIR/bin/$i.exe $i
if [[ $? != 0 ]]; then
exit 1
fi
done
echo
unset GOOS