forked from knqyf263/pet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (43 loc) · 833 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
52
53
54
55
56
.PHONY: \
all \
dep \
depup \
update \
build \
install \
lint \
vet \
fmt \
fmtcheck \
clean \
pretest \
test
VERSION := $(shell git describe --tags --abbrev=0)
SRCS = $(shell git ls-files '*.go')
PKGS = $(shell go list ./... | grep -v /vendor/)
all: dep build test
dep:
go get -u github.com/golang/dep/...
dep ensure -vendor-only
depup:
go get -u github.com/golang/dep/...
dep ensure -u
build: main.go dep
go build -o pet $<
install: main.go dep
go install
lint:
@ go get -v github.com/golang/lint/golint
$(foreach file,$(SRCS),golint $(file) || exit;)
vet:
go vet $(PKGS) || exit;
fmt:
gofmt -w $(SRCS)
fmtcheck:
@ $(foreach file,$(SRCS),gofmt -s -l $(file);)
clean:
go clean $(shell glide nv)
pretest: vet fmtcheck
test: pretest
go install
@ $(foreach pkg,$(PKGS), go test $(pkg) || exit;)