From 20d6fcf7ebe82de759359bf628ad4dc53a440367 Mon Sep 17 00:00:00 2001 From: Rolf Neugebauer Date: Wed, 7 Jun 2017 18:13:57 +0100 Subject: [PATCH] build: Make GOOS and GOARCH over-writeable The GOOS and GOARCH are currently set based on the host 'make' is executed on. On macOS this sets up cross compilation with a Linux container. Making them over-writeable allows users to test different cross compilations, e.g., trying to build Linux binaries on macOS. Signed-off-by: Rolf Neugebauer --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e6b1525e0..ed5ec0f47 100644 --- a/Makefile +++ b/Makefile @@ -9,8 +9,8 @@ GO_COMPILE=linuxkit/go-compile:6579a00b44686d0e504d513fc4860094769fe7df MOBY?=bin/moby LINUXKIT?=bin/linuxkit -GOOS=$(shell uname -s | tr '[:upper:]' '[:lower:]') -GOARCH=amd64 +GOOS?=$(shell uname -s | tr '[:upper:]' '[:lower:]') +GOARCH?=amd64 ifneq ($(GOOS),linux) CROSS=-e GOOS=$(GOOS) -e GOARCH=$(GOARCH) endif