2016-11-03 21:13:18 +00:00
|
|
|
GO ?= go
|
2016-12-01 15:06:07 +00:00
|
|
|
GOENV := $(shell $(GO) env GOHOSTOS)_$(shell $(GO) env GOHOSTARCH)
|
2016-11-03 21:13:18 +00:00
|
|
|
GOROOTINFO := $(shell $(GO) version | cut -d' ' -f 3)_$(GOENV)
|
|
|
|
|
|
|
|
.PHONY: GOROOT
|
|
|
|
GOROOT: GOROOT/$(GOENV)/.ok_$(GOROOTINFO)
|
|
|
|
@rm -f GOROOT/$(GOENV)/pkg/*/crypto/tls.a
|
|
|
|
|
|
|
|
GOROOT/$(GOENV)/.ok_$(GOROOTINFO):
|
|
|
|
rm -rf GOROOT/$(GOENV)
|
|
|
|
mkdir -p GOROOT/$(GOENV)/pkg
|
|
|
|
cp -r "$(shell $(GO) env GOROOT)/src" GOROOT/$(GOENV)/src
|
|
|
|
cp -r "$(shell $(GO) env GOROOT)/pkg/include" GOROOT/$(GOENV)/pkg/include
|
|
|
|
cp -r "$(shell $(GO) env GOROOT)/pkg/tool" GOROOT/$(GOENV)/pkg/tool
|
|
|
|
rm -r GOROOT/$(GOENV)/src/crypto/tls
|
|
|
|
ln -s ../../../../.. GOROOT/$(GOENV)/src/crypto/tls
|
|
|
|
GOROOT="$(CURDIR)/GOROOT/$(GOENV)" $(GO) install -v std
|
|
|
|
ifeq ($(shell go env CGO_ENABLED),1)
|
|
|
|
GOROOT="$(CURDIR)/GOROOT/$(GOENV)" $(GO) install -race -v std
|
|
|
|
endif
|
|
|
|
@touch "$@"
|
|
|
|
|
2016-11-25 21:46:50 +00:00
|
|
|
# Note: when changing this, if it doesn't change the Go version
|
|
|
|
# (it should), you need to run make clean.
|
2016-12-01 15:05:19 +00:00
|
|
|
GO_COMMIT := 112098da9940c40952a8ffe3730edf56e75018ec
|
2016-11-03 21:13:18 +00:00
|
|
|
|
|
|
|
.PHONY: go
|
|
|
|
go: go/.ok_$(GO_COMMIT)_$(GOENV)
|
|
|
|
|
|
|
|
go/.ok_$(GO_COMMIT)_$(GOENV):
|
|
|
|
rm -rf go/.ok_*_$(GOENV) go/$(GOENV)
|
|
|
|
mkdir -p go
|
|
|
|
git clone --branch 1.7.3 --single-branch --depth 25 https://github.com/cloudflare/go go/$(GOENV)
|
|
|
|
cd go/$(GOENV) && git checkout $(GO_COMMIT)
|
|
|
|
cd go/$(GOENV)/src && GOROOT_BOOTSTRAP="$(shell $(GO) env GOROOT)" ./make.bash
|
|
|
|
@touch "$@"
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -rf GOROOT go
|