-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (29 loc) · 818 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
PROJECT_NAME := "SBWeb"
PKG := "bmstu.codes/developers34/SBWeb"
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/)
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go)
# TODO cover and coverhtml
.PHONY: all dep build clean test lint
all: build
lint:
@golint -set_exit_status ${PKG_LIST}
test:
@go test ${PKG_LIST}
coverage:
@go test -coverprofile=./coverage.cov ${PKG_LIST}
go tool cover -func=coverage.cov
coverage_html:
@mkdir coverage
@go test -coverprofile=./coverage/coverage.cov ${PKG_LIST}
@go tool cover -html=./coverage/coverage.cov -o ./coverage/coverage.html
@rm ./coverage/coverage.cov
race: dep
@go test -race ${PKG_LIST}
msan: dep
@go test -msan ${PKG_LIST}
dep:
@go get -v -d ./...
build: dep
@go build -i -v $(PKG)
clean:
@rm -f $(PROJECT_NAME)