-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
50 lines (40 loc) · 1021 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
VERSION:=0.1
TAG:=v$(VERSION)
COVEROUT = cover.out
GOFMTCHECK = test -z `gofmt -l -s -w *.go | tee /dev/stderr`
COVER = cd plugin/metadata_edns0 && GO111MODULE=on go test -v -coverprofile=$(COVEROUT) -covermode=atomic -race
GOPATH?=$(HOME)/go
GITCOMMIT:=$(shell git describe --dirty --always)
BINARY:=coredns
SYSTEM:=
VERBOSE:=-v
all: get fmt test
coredns: build
.PHONY: fmt
fmt:
@echo "Checking format..."
@$(GOFMTCHECK)
.PHONY: get
get:
GO111MODULE=on go get -v
.PHONY: test
test:
@echo "Running tests..."
@$(COVER)
.PHONY: build
build:
GO111MODULE=on CGO_ENABLED=0 $(SYSTEM) go build $(VERBOSE) -ldflags="-s -w -X github.com/coredns/coredns/coremain.GitCommit=$(GITCOMMIT)" -o $(BINARY)
# Use the 'release' target to start a release
.PHONY: release
release: commit push
@echo Released $(VERSION)
.PHONY: commit
commit:
@echo Committing release $(VERSION)
git commit -am"Release $(VERSION)"
git tag $(TAG)
.PHONY: push
push:
@echo Pushing release $(VERSION) to master
git push --tags
git push