From 6d8e79c1981c6e2100bdcb36417caedc056c50ed Mon Sep 17 00:00:00 2001 From: Alexander Staubo Date: Sun, 22 Feb 2015 22:27:12 -0500 Subject: [PATCH] Makefile: Calculate $(GOROOT), etc. relative to Makefile instead of using $(PWD), which is not always available (eg., in debuild). --- Makefile.INCLUDE | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile.INCLUDE b/Makefile.INCLUDE index 39fc4957..b5eb9dea 100644 --- a/Makefile.INCLUDE +++ b/Makefile.INCLUDE @@ -31,11 +31,13 @@ else RELEASE_SUFFIX ?= endif +MAKEFILE_DIR ?= $(realpath $(dir $(lastword $(MAKEFILE_LIST)))) + GO_VERSION ?= 1.4.1 GOURL ?= https://golang.org/dl GOPKG ?= go$(GO_VERSION).$(GOOS)-$(GOARCH)$(RELEASE_SUFFIX).tar.gz -GOROOT := $(PWD)/.deps/go -GOPATH := $(PWD)/.deps/gopath +GOROOT := $(MAKEFILE_DIR)/.deps/go +GOPATH := $(MAKEFILE_DIR)/.deps/gopath GOCC := $(GOROOT)/bin/go GO := GOROOT=$(GOROOT) GOPATH=$(GOPATH) $(GOCC) GOFMT := $(GOROOT)/bin/gofmt