Makefile: Calculate $(GOROOT), etc. relative to Makefile instead of using $(PWD), which is not always available (eg., in debuild).

This commit is contained in:
Alexander Staubo 2015-02-22 22:27:12 -05:00
parent 942cd35dea
commit 6d8e79c198
1 changed files with 4 additions and 2 deletions

View File

@ -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