forked from prokosna/dementor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (41 loc) · 1023 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
51
# Meta info
NAME := dementor
VERSION := $(shell git describe --tags --abbrev=0)
REVISION := $(shell git rev-parse --short HEAD)
LDFLAGS := -X 'main.version=$(VERSION)' \
-X 'main.revision=$(REVISON)'
## Setup
setup:
go get github.com/Masterminds/glide
go get github.com/golang/lint/golint
go get golang.org/x/tools/cmd/goimports
go get github.com/Songmu/make2help/cmd/make2help
## Install dependencies
deps: setup
glide install
## Update dependencies
update: setup
glide update
## Format source codes
fmt: setup
goimports -w $$(glide nv -x)
## Test
test: deps fmt
go test -v $$(glide novendor) -tags=unit
go test -v $$(glide novendor) -tags=integration
## Lint
lint: setup fmt
go vet $$(glide novendor)
for pkg in $$(glide novendor -x); do \
golint -set_exit_status $$pkg || exit $$?; \
done
## Run
run: deps fmt
go run *.go
## Build binaries
bin/%: main.go deps
go build -ldflags "$(LDFLAGS)" -o $@ $<
## Show help
help:
@make2help $(MAKEFILE_LIST)
.PHONY: setup deps update test lint run help