-
Notifications
You must be signed in to change notification settings - Fork 27
/
Makefile
71 lines (52 loc) · 1.16 KB
/
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
EXAMPLES = advertise alive bye monitor search
.PHONY: build
build:
go build -gcflags '-e'
.PHONY: test
test:
go test $(TEST_PACKAGE)
.PHONY: bench
bench:
go test -bench $(TEST_PACKAGE)
.PHONY: tags
tags:
gotags -f tags -R .
.PHONY: cover
cover:
mkdir -p tmp
go test -coverprofile tmp/_cover.out $(TEST_PACKAGE)
go tool cover -html tmp/_cover.out -o tmp/cover.html
.PHONY: checkall
checkall: vet staticcheck
.PHONY: vet
vet:
go vet $(TEST_PACKAGE)
.PHONY: staticcheck
staticcheck:
staticcheck $(TEST_PACKAGE)
.PHONY: clean
clean: examples-clean
go clean
rm -f tags
rm -f tmp/_cover.out tmp/cover.html
# based on: github.com/koron-go/_skeleton/Makefile
.PHONY: test-race
test-race:
go test -race .
.PHONY: examples
examples: examples-build
.PHONY: examples-build
examples-build: $(EXAMPLES)
.PHONY: examples-clean
examples-clean:
rm -f $(EXAMPLES)
advertise: examples/advertise/*.go *.go
go build ./examples/advertise
alive: examples/alive/*.go *.go
go build ./examples/alive
bye: examples/bye/*.go *.go
go build ./examples/bye
monitor: examples/monitor/*.go *.go
go build ./examples/monitor
search: examples/search/*.go *.go
go build ./examples/search