Skip to content

Commit

Permalink
Use gox to cross compile the binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
ncw committed Mar 6, 2014
1 parent bda37d5 commit 4419c80
Showing 1 changed file with 6 additions and 37 deletions.
43 changes: 6 additions & 37 deletions cross-compile
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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 )

0 comments on commit 4419c80

Please sign in to comment.