-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
50 lines (40 loc) · 961 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
COMMIT = $$(git describe --tags --always)
# date format of goreleaser
DATE = $$(date --utc '+%Y-%m-%d_%H:%M:%S')
PKG = github.com/yuuki/binrep
PKGS = $$(go list ./... | grep -v vendor)
CREDITS = vendor/CREDITS
all: build
.PHONY: build
build: deps
go build -ldflags "-X main.commit=\"$(COMMIT)\" -X main.date=\"$(DATE)\"" $(PKG)
.PHONY: test
test: vet
go test -v ./...
.PHONY: vet
vet:
go vet ./...
.PHONY: lint
lint: devel-deps
golint -set_exit_status $(PKGS)
cover: devel-deps
goveralls -service=travis-ci
.PHONY: deps
deps:
go get github.com/jteeuwen/go-bindata/...
.PHONY: devel-deps
devel-deps: deps
go get github.com/golang/lint/golint
go get golang.org/x/tools/cmd/cover
go get github.com/mattn/goveralls
go get github.com/motemen/gobump
go get github.com/Songmu/ghch
.PHONY: credits
credits:
scripts/credits > $(CREDITS)
ifneq (,$(git status -s $(CREDITS)))
go generate -x .
endif
.PHONY: release
release: credits
scripts/release