diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 49 |
1 files changed, 13 insertions, 36 deletions
@@ -2,7 +2,7 @@ GITCOMMIT:=$(shell git describe --dirty --always) BINARY:=coredns SYSTEM:= -CHECKS:=check godeps +CHECKS:=check BUILDOPTS:=-v GOPATH?=$(HOME)/go PRESUBMIT:=core coremain plugin test request @@ -14,45 +14,29 @@ all: coredns .PHONY: coredns coredns: $(CHECKS) - CGO_ENABLED=$(CGO_ENABLED) $(SYSTEM) go build $(BUILDOPTS) -ldflags="-s -w -X github.com/coredns/coredns/coremain.GitCommit=$(GITCOMMIT)" -o $(BINARY) + GO111MODULE=on CGO_ENABLED=$(CGO_ENABLED) $(SYSTEM) go build $(BUILDOPTS) -ldflags="-s -w -X github.com/coredns/coredns/coremain.GitCommit=$(GITCOMMIT)" -o $(BINARY) .PHONY: check -check: presubmit core/plugin/zplugin.go core/dnsserver/zdirectives.go godeps - -.PHONY: godeps -godeps: - @ # Not vendoring these, so external plugins compile, avoiding: - @ # cannot use c (type *"github.com/mholt/caddy".Controller) as type - @ # *"github.com/coredns/coredns/vendor/github.com/mholt/caddy".Controller like errors. - (cd $(GOPATH)/src/github.com/mholt/caddy 2>/dev/null && git checkout -q master 2>/dev/null || true) - (cd $(GOPATH)/src/github.com/miekg/dns 2>/dev/null && git checkout -q master 2>/dev/null || true) - (cd $(GOPATH)/src/github.com/prometheus/client_golang 2>/dev/null && git checkout -q master 2>/dev/null || true) - go get -u github.com/mholt/caddy - go get -u github.com/miekg/dns - go get -u github.com/prometheus/client_golang/prometheus/promhttp - go get -u github.com/prometheus/client_golang/prometheus - (cd $(GOPATH)/src/github.com/mholt/caddy && git checkout -q v0.11.4) - (cd $(GOPATH)/src/github.com/miekg/dns && git checkout -q v1.1.4) - (cd $(GOPATH)/src/github.com/prometheus/client_golang && git checkout -q v0.9.1) +check: presubmit core/plugin/zplugin.go core/dnsserver/zdirectives.go .PHONY: travis travis: ifeq ($(TEST_TYPE),core) - ( cd request ; go test -v -tags 'etcd' -race ./... ) - ( cd core ; go test -v -tags 'etcd' -race ./... ) - ( cd coremain ; go test -v -tags 'etcd' -race ./... ) + ( cd request ; GO111MODULE=on go test -v -tags 'etcd' -race ./... ) + ( cd core ; GO111MODULE=on go test -v -tags 'etcd' -race ./... ) + ( cd coremain ; GO111MODULE=on go test -v -tags 'etcd' -race ./... ) endif ifeq ($(TEST_TYPE),integration) - ( cd test ; go test -v -tags 'etcd' -race ./... ) + ( cd test ; GO111MODULE=on go test -v -tags 'etcd' -race ./... ) endif ifeq ($(TEST_TYPE),plugin) - ( cd plugin ; go test -v -tags 'etcd' -race ./... ) + ( cd plugin ; GO111MODULE=on go test -v -tags 'etcd' -race ./... ) endif ifeq ($(TEST_TYPE),coverage) for d in `go list ./... | grep -v vendor`; do \ t=$$(date +%s); \ - go test -i -tags 'etcd' -coverprofile=cover.out -covermode=atomic $$d || exit 1; \ - go test -v -tags 'etcd' -coverprofile=cover.out -covermode=atomic $$d || exit 1; \ + GO111MODULE=on go test -i -tags 'etcd' -coverprofile=cover.out -covermode=atomic $$d || exit 1; \ + GO111MODULE=on go test -v -tags 'etcd' -coverprofile=cover.out -covermode=atomic $$d || exit 1; \ echo "Coverage test $$d took $$(($$(date +%s)-t)) seconds"; \ if [ -f cover.out ]; then \ cat cover.out >> coverage.txt; \ @@ -62,11 +46,11 @@ ifeq ($(TEST_TYPE),coverage) endif core/plugin/zplugin.go core/dnsserver/zdirectives.go: plugin.cfg - go generate coredns.go + GO111MODULE=on go generate coredns.go .PHONY: gen gen: - go generate coredns.go + GO111MODULE=on go generate coredns.go .PHONY: pb pb: @@ -79,12 +63,5 @@ presubmit: .PHONY: clean clean: - go clean + GO111MODULE=on go clean rm -f coredns - -.PHONY: dep-ensure -dep-ensure: - dep version || go get -u github.com/golang/dep/cmd/dep - dep ensure -v - dep prune -v - find vendor -name '*_test.go' -delete |