From b8a3689de7a348b58911da92dabbd1962cb54a4a Mon Sep 17 00:00:00 2001 From: Joshua Rich Date: Tue, 25 Apr 2017 12:47:37 +1000 Subject: [PATCH] Add cross compile back to Makefile. --- .travis.yml | 2 +- Makefile | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4e89a63..5a284ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ services: language: go go: - - 1.6 + - 1.7 os: - linux diff --git a/Makefile b/Makefile index 147eb79..d9c0aa9 100644 --- a/Makefile +++ b/Makefile @@ -45,3 +45,19 @@ before-build: # Collects all dependencies and then calls update .PHONY: collect collect: + +.PHONY: cross +cross: + test -d dist || mkdir dist + echo "Building Windows 32-bit..." + env GOOS=windows GOARCH=386 go build -o dist/pingbeat-windows-32.exe + echo "Building Windows 64-bit..." + env GOOS=windows GOARCH=amd64 go build -o dist/pingbeat-windows-64.exe + echo "Building Linux 32-bit..." + env GOOS=linux GOARCH=386 go build -o dist/pingbeat-linux-32.exe + echo "Building Linux 64-bit..." + env GOOS=linux GOARCH=amd64 go build -o dist/pingbeat-linux-64.exe + echo "Building OSX 32-bit..." + env GOOS=darwin GOARCH=386 go build -o dist/pingbeat-darwin-32.exe + echo "Building OSX 64-bit..." + env GOOS=darwin GOARCH=amd64 go build -o dist/pingbeat-darwin-64.exe