-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (29 loc) · 813 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
GO := go
ID := greeter
REPO := github.com/LiangXianSen/$(ID)
VERSION := v0.0.1
SRC := $(shell find . -type f -name '*.go' -not -path "./vendor/*")
PKG := $(shell go list ./...|grep -v /vendor/)
TARGET := client server
# === This section provides application running utility === #
.PHONY: all build clean check lint test benchmark
all: build
build: $(TARGET)
$(TARGET): $(SRC)
@$(GO) build $(REPO)/cmd/$@
test: check
@$(GO) test -race $(PKG) -v -p 1 -coverprofile=.coverage.out
@$(GO) tool cover -func=.coverage.out
@rm -f .coverage.out
benchmark: check
@$(GO) test -benchmem -bench=. -count=3 $(PKG)
check:
@$(GO) vet -composites=false $(PKG)
lint:
@golint -set_exit_status $(PKG)
lint-runner:
@golangci-lint run ./...
doc:
@godoc -http=localhost:6060 -play
clean:
@rm $(TARGET)