-
Notifications
You must be signed in to change notification settings - Fork 1
Compile tableconverter for any OS
David Valentim Dias edited this page Dec 3, 2015
·
1 revision
If you want to create binaries to another operation system besides your own.
You need go at version >= 1.5, check typing go version
Create genBinaries file with the content below and save inside the tableconverter cloned directory.
#!/bin/sh
# create binaries for each popular OS
# ./genBinaries
# DESTDIR="bin" ./genBinaries
DESTDIR=${DESTDIR-"bin"}
mkdir $DESTDIR
# linux amd64
export GOOS=linux
export GOARCH=amd64
go build -v -o ${DESTDIR}/tableconverter-${GOOS}-${GOARCH}
# linux 386
export GOOS=linux
export GOARCH=386
go build -v -o ${DESTDIR}/tableconverter-${GOOS}-${GOARCH}
# windows amd64
export GOOS=windows
export GOARCH=amd64
go build -v -o ${DESTDIR}/tableconverter-${GOOS}-${GOARCH}.exe
# windows 386
export GOOS=windows
export GOARCH=386
go build -v -o ${DESTDIR}/tableconverter-${GOOS}-${GOARCH}.exe
# macos amd64
export GOOS=darwin
export GOARCH=amd64
go build -v -o ${DESTDIR}/tableconverter-${GOOS}-${GOARCH}
# macos 386
export GOOS=darwin
export GOARCH=386
go build -v -o ${DESTDIR}/tableconverter-${GOOS}-${GOARCH}
Make this file executable with chmod +x genBinaries
and run ./genBinaries
to create a directory named bin/ with binaries for some popular OS.