Created
September 11, 2013 05:16
-
-
Save lintianzhi/6519591 to your computer and use it in GitHub Desktop.
go build different os arch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -lt 1 ]; then | |
echo xxx | |
exit 0 | |
fi | |
GOOS=windows | |
GOARCH=386 | |
go build | |
mv $1.exe $1_win_32.exe | |
GOOS=windows | |
GOARCH=amd64 | |
go build | |
mv $1.exe $1_win_64.exe | |
GOOS=linux | |
GOARCH=amd64 | |
go build | |
mv $1 $1_linux_32 | |
GOOS=linux | |
GOARCH=amd64 | |
go build | |
mv $1 $1_linux_64 | |
GOOS=darwin | |
GOARCH=386 | |
go build | |
mv $1 $1_darwin_32 | |
GOOS=darwin | |
GOARCH=amd64 | |
go build | |
mv $1 $1_darwin_64 | |
tar cf $1.tar $1_*_* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment