blob: b4cf57775ec73081295a5d6ae8a09f57bf26ea01 (
plain)
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
|
REVISION := $(shell git rev-parse --short HEAD || echo unknown)
LAST_TAG := $(shell git describe --tags --abbrev=0)
COMMITS := $(shell echo `git log --oneline $(LAST_TAG)..HEAD | wc -l`)
VERSION := $(shell cat VERSION)
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
ifneq (v$(VERSION),$(LAST_TAG))
VERSION := $(shell echo $(VERSION)~beta.$(COMMITS).g$(REVISION))
endif
VERSION_FLAGS :=-X "main.VERSION=$(VERSION)" -X "main.REVISION=$(REVISION)"
export GOPATH := $(CURDIR)/.GOPATH
export GOBIN := $(CURDIR)/bin
Q := $(if $V,,@)
.GOPATH/.ok:
mkdir -p .GOPATH
.PHONY: bin/golangci-lint
bin/golangci-lint: .GOPATH/.ok
@test -x $@ || \
{ echo "Vendored golangci-lint not found, try running 'make setup'..."; exit 1; }
bin/gotestsum: .GOPATH/.ok
@test -x $@ || \
{ echo "Vendored gotestsum not found, try running 'make setup'..."; exit 1; }
bin/mockgen: .GOPATH/.ok
@test -x $@ || \
{ echo "Vendored mockgen not found, try running 'make setup'..."; exit 1; }
|