make_all: generate executables for all GOOSes

...well, maybe not _all_ GOOSes, but at least the important ones.

And git should ignore the executables so that we don't accidentally
check them in.
This commit is contained in:
Brian Cunnie
2020-12-01 16:08:44 -08:00
parent 62a95f04b7
commit 3578d96970
2 changed files with 18 additions and 0 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
.DS_Store
# We don't check-in JetBrains's Goland settings
.idea
bin/sslip.io-dns-server-*

17
bin/make_all Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
#
# Build binaries for macOS, Windows, Linux, FreeBSD
#
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd $DIR/../src
export GOOS GOARCH
for GOOS in darwin linux freebsd; do
for GOARCH in amd64; do
go build -o $DIR/sslip.io-dns-server-$GOOS-$GOARCH main.go
done
done
# Windows has a custom extension
GOOS=windows GOARCH=amd64
go build -o $DIR/sslip.io-dns-server-$GOOS-$GOARCH.exe main.go