Skip to content

Commit

Permalink
Cross compile it up.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikegehard committed Aug 24, 2013
1 parent 63f2948 commit fdb7d87
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ _testmain.go
*.exe

out/
release/
32 changes: 32 additions & 0 deletions bin/build-all
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

set -e

echo "Creating release dir..."
mkdir -p release

EXECUTABLE_NAME="exercism"

PLATFORMS="darwin/386 darwin/amd64 linux/386 linux/amd64 windows/386 windows/amd64"

function build-architecture {
GOOS=${1%/*}
GOARCH=${1#*/}
echo "Creating $GOOS $GOARCH binary..."

GOOS=$GOOS GOARCH=$GOARCH "$(dirname $0)/build"
cd out

if [ $GOOS == windows ]; then
mv $EXECUTABLE_NAME $EXECUTABLE_NAME.exe
tar cvzf ../release/$EXECUTABLE_NAME-$GOOS-$GOARCH.tgz $EXECUTABLE_NAME.exe
else
tar cvzf ../release/$EXECUTABLE_NAME-$GOOS-$GOARCH.tgz $EXECUTABLE_NAME
fi

cd ..
}

for PLATFORM in $PLATFORMS; do
build-architecture $PLATFORM
done

0 comments on commit fdb7d87

Please sign in to comment.