From 4419c80e0cdc78b7d5578454dd72d354e52730ca Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 6 Mar 2014 17:32:01 +0000 Subject: [PATCH] Use gox to cross compile the binaries --- cross-compile | 43 ++++++------------------------------------- 1 file changed, 6 insertions(+), 37 deletions(-) diff --git a/cross-compile b/cross-compile index 7588934..be10592 100755 --- a/cross-compile +++ b/cross-compile @@ -1,16 +1,11 @@ -#!/bin/echo Source this file don't run it -# Cross compile all the architectures using -# http://dave.cheney.net/2012/09/08/an-introduction-to-cross-compilation-with-go +#!/bin/sh + +# This uses gox from https://github.com/mitchellh/gox +# Make sure you've run gox -build-toolchain rm -rf build -mkdir -p build -mkdir -p build/osx -mkdir -p build/windows -mkdir -p build/freebsd/386 -mkdir -p build/freebsd/amd64 -mkdir -p build/linux/386 -mkdir -p build/linux/amd64 -mkdir -p build/linux/arm + +gox -output "build/{{.OS}}/{{.Arch}}/{{.Dir}}" cat <<'#EOF' > build/README.txt This directory contains builds of the stressdisk program. @@ -28,30 +23,4 @@ The files in this directory are organised by OS and processor type #EOF -#echo darwin-386 -#go-darwin-386 build -o build/osx/386/stressdisk - -echo OSX -go-darwin-amd64 build -o build/osx/stressdisk - -echo freebsd-386 -go-freebsd-386 build -o build/freebsd/386/stressdisk - -echo freebsd-amd64 -go-freebsd-amd64 build -o build/freebsd/amd64/stressdisk - -echo linux-386 -go-linux-386 build -o build/linux/386/stressdisk - -echo linux-amd64 -go-linux-amd64 build -o build/linux/amd64/stressdisk - -echo linux-arm -go-linux-arm build -o build/linux/arm/stressdisk - -echo windows-386 -go-windows-386 build -o build/windows/stressdisk.exe - -#go-windows-amd64 build - ( cd build ; tree . >> README.txt )