forked from pforemski/dingo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·34 lines (26 loc) · 664 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
#!/bin/bash
[ -z "$1" ] && { echo "Usage: build.sh VERSION" >&1; exit 1; }
VERSION="$1"
DEST="$HOME/tmp/dingo-$VERSION"
###############################################
function build()
{
TARGET="$1"
echo "Building dingo v. $VERSION for $TARGET"
GOOS="${TARGET%-*}" GOARCH="${TARGET##*-}" go build \
-o $DEST/dingo-$TARGET \
./*.go
}
###############################################
echo "Building in $DEST"
rm -fr $DEST
mkdir -p $DEST
for target in \
darwin-386 darwin-amd64 \
freebsd-386 freebsd-amd64 \
linux-386 linux-amd64 \
netbsd-386 netbsd-amd64 \
openbsd-386 openbsd-amd64 \
windows-386 windows-amd64; do
build $target || exit 1
done