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:30:10 -05:00
parent 452c88964a
commit 8a47f8a44d
2 changed files with 5 additions and 3 deletions

View File

@ -66,10 +66,10 @@ config:
$(MAKE) -C config $(MAKE) -C config
$(SELFLINK): $(GOPATH) $(SELFLINK): $(GOPATH)
ln -s $(CURDIR) $@ ln -s $(MAKEFILE_DIR) $@
$(GOPATH): $(GOPATH):
cp -a $(CURDIR)/Godeps/_workspace $(GOPATH) cp -a $(MAKEFILE_DIR)/Godeps/_workspace $(GOPATH)
dependencies: $(GOCC) | $(SELFLINK) dependencies: $(GOCC) | $(SELFLINK)

View File

@ -24,7 +24,9 @@ ARCH=$(shell uname -m)
# Mac OS X release family. # Mac OS X release family.
MAC_OS_X_VERSION ?= 10.8 MAC_OS_X_VERSION ?= 10.8
BUILD_PATH = $(PWD)/.build MAKEFILE_DIR ?= $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
BUILD_PATH = $(MAKEFILE_DIR)/.build
GO_VERSION := 1.4 GO_VERSION := 1.4
GOOS = $(subst Darwin,darwin,$(subst Linux,linux,$(subst FreeBSD,freebsd,$(OS)))) GOOS = $(subst Darwin,darwin,$(subst Linux,linux,$(subst FreeBSD,freebsd,$(OS))))