From 5a58e876c335c005064fe57eb6a15b5b09bf7c60 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Mon, 27 Jul 2015 11:38:30 +0200 Subject: [PATCH] Allow overriding GOARCH and GOOS in Makefile.INCLUDE. This allows building binaries for different target architectures and OSes. --- Makefile.INCLUDE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.INCLUDE b/Makefile.INCLUDE index 3a3f79517..e289fac59 100644 --- a/Makefile.INCLUDE +++ b/Makefile.INCLUDE @@ -31,7 +31,7 @@ MAKEFILE_DIR ?= $(realpath $(dir $(lastword $(MAKEFILE_LIST)))) BUILD_PATH = $(MAKEFILE_DIR)/.build GO_VERSION := 1.4.2 -GOOS = $(subst Darwin,darwin,$(subst Linux,linux,$(subst FreeBSD,freebsd,$(OS)))) +GOOS ?= $(subst Darwin,darwin,$(subst Linux,linux,$(subst FreeBSD,freebsd,$(OS)))) ifeq ($(GOOS),darwin) RELEASE_SUFFIX ?= -osx$(MAC_OS_X_VERSION) @@ -42,7 +42,7 @@ endif # Never honor GOBIN, should it be set at all. unexport GOBIN -GOARCH = $(subst x86_64,amd64,$(patsubst i%86,386,$(ARCH))) +GOARCH ?= $(subst x86_64,amd64,$(patsubst i%86,386,$(ARCH))) GOPKG ?= go$(GO_VERSION).$(GOOS)-$(GOARCH)$(RELEASE_SUFFIX).tar.gz GOURL ?= https://golang.org/dl GOROOT = $(BUILD_PATH)/root/go