Skip to content

Instantly share code, notes, and snippets.

@gebi
Last active December 12, 2015 02:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gebi/4702669 to your computer and use it in GitHub Desktop.
Save gebi/4702669 to your computer and use it in GitHub Desktop.
go cross compile/update helper script
#!/bin/bash
set -e
cd /opt/go/src/
echo "### UPDATING SOURCE"
hg pull
hg update -C release
echo "### BUILDING NATIVE TOOLCHAIN"
CGO_ENABLE=1 ./all.bash
echo "### BUILDING TOOLCHAIN: linux/i386"
GOOS=linux GOARCH=386 CGO_ENABLED=0 ./make.bash --no-clean
echo "### BUILDING TOOLCHAIN: linux/arm"
GOOS=linux GOARCH=arm CGO_ENABLED=0 ./make.bash --no-clean
echo "### BUILDING TOOLCHAIN: windows/amd64"
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 ./make.bash --no-clean
echo "### BUILDING TOOLCHAIN: windows/i386"
GOOS=windows GOARCH=386 CGO_ENABLED=0 ./make.bash --no-clean
echo "### UPDATING TIMESTAMPS (GO FIXES)"
find /opt/go/pkg/ -print0 |xargs -0r touch
go install std
cd ~
export GOPATH=~/go
go get code.google.com/p/go.tools/cmd/...
echo "### SUCCESS"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment