-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (30 loc) · 700 Bytes
/
Makefile
File metadata and controls
37 lines (30 loc) · 700 Bytes
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
NAME := $(shell basename `pwd`)
REVISION := $(shell git rev-parse --short HEAD)
GODEP := $(shell command -v dep 2> /dev/null)
GOLINT := $(shell command -v golint 2> /dev/null)
LDFLAGS := -X 'main.Version=$(VERSION)' -X 'main.Revision=$(REVISION)'
VENDORDIR :=./vendor
.PHONY: test
test: lint
go test -race -v ./...
.PHONY: godep
godep:
ifndef GODEP
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
endif
.PHONY: golint
golint:
ifndef GOLINT
go get -u github.com/golang/lint/golint
endif
.PHONY: deps
deps: godep
dep ensure
.PHONY: clean
clean:
go clean
rm -rf $(VENDORDIR)/*
.PHONY: lint
lint: golint deps
go vet ./...
golint -set_exit_status ./