forked from radondb/radon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
91 lines (84 loc) · 1.71 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
PREFIX :=/usr/local
export GOPATH := $(shell pwd)
export PATH := $(GOPATH)/bin:$(PATH)
build: LDFLAGS += $(shell GOPATH=${GOPATH} src/build/ldflags.sh)
build:
@echo "--> Building..."
@mkdir -p bin/
go build -v -o bin/radon --ldflags '$(LDFLAGS)' src/radon/radon.go
go build -v -o bin/radoncli --ldflags '$(LDFLAGS)' src/cli/cli.go
@chmod 755 bin/*
clean:
@echo "--> Cleaning..."
@go clean
@rm -f bin/*
fmt:
go fmt ./...
go vet ./...
test:
@echo "--> Testing..."
@$(MAKE) testxbase
@$(MAKE) testxcontext
@$(MAKE) testconfig
@$(MAKE) testrouter
@$(MAKE) testoptimizer
@$(MAKE) testplanner
@$(MAKE) testexecutor
@$(MAKE) testbackend
@$(MAKE) testproxy
@$(MAKE) testaudit
@$(MAKE) testsyncer
@$(MAKE) testbinlog
@$(MAKE) testctl
testxbase:
go test -v -race xbase
go test -v -race xbase/stats
go test -v -race xbase/sync2
testxcontext:
go test -v xcontext
testconfig:
go test -v config
testrouter:
go test -v router
testoptimizer:
go test -v optimizer
testplanner:
go test -v planner
testexecutor:
go test -v executor
testbackend:
go test -v -race backend
testproxy:
go test -v -race proxy
testaudit:
go test -v -race audit
testsyncer:
go test -v -race syncer
testbinlog:
go test -v -race binlog
testctl:
go test -v -race ctl/v1
testcli:
go test -v -race cli/cmd
testpoc:
go test -v poc
# code coverage
allpkgs = xbase/...\
ctl/v1/\
xcontext\
config\
router\
optimizer\
planner\
executor\
backend\
proxy\
audit\
syncer\
binlog
coverage:
go build -v -o bin/gotestcover \
src/vendor/github.com/pierrre/gotestcover/*.go;
bin/gotestcover -coverprofile=coverage.out -v $(allpkgs)
go tool cover -html=coverage.out
.PHONY: build clean install fmt test coverage check