-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
43 lines (32 loc) · 841 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
GO_BIN_FILES=report.go
#for race CGO_ENABLED=1
#GO_ENV=CGO_ENABLED=1
GO_ENV=CGO_ENABLED=0
#GO_BUILD=go build -ldflags '-s -w' -race
GO_BUILD=go build -ldflags '-s -w'
GO_FMT=gofmt -s -w
GO_LINT=golint -set_exit_status
GO_VET=go vet
GO_IMPORTS=goimports -w
GO_USEDEXPORTS=usedexports
GO_ERRCHECK=errcheck -asserts -ignore '[FS]?[Pp]rint*'
BINARIES=report
all: check ${BINARIES}
report: report.go
${GO_ENV} ${GO_BUILD} -o report report.go
fmt: ${GO_BIN_FILES}
${GO_FMT} ${GO_BIN_FILES}
lint: ${GO_BIN_FILES}
${GO_LINT} ${GO_BIN_FILES}
vet: ${GO_BIN_FILES}
${GO_VET} ${GO_BIN_FILES}
imports: ${GO_BIN_FILES}
${GO_IMPORTS} ${GO_BIN_FILES}
usedexports: ${GO_BIN_FILES}
${GO_USEDEXPORTS} ./...
errcheck: ${GO_BIN_FILES}
${GO_ERRCHECK} ./...
check: fmt lint imports vet usedexports errcheck
clean:
rm -f ${BINARIES}
.PHONY: all