-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
89 lines (72 loc) · 2.01 KB
/
Makefile
File metadata and controls
89 lines (72 loc) · 2.01 KB
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
# set makefile echo back
ifdef VERBOSE
V :=
else
V := @
endif
.PHONY: build
## build : Build binary
build: ccr_syncer get_binlog ingest_binlog get_meta snapshot_op get_master_token spec_checker
.PHONY: bin
## bin : Create bin directory
bin:
@mkdir -p bin
.PHONY: lint
## lint : Lint codespace
lint:
$(V)cargo clippy --workspace --tests --all-features -- -D warnings
.PHONY: fmt
## fmt : Format all code
fmt:
$(V)go fmt ./...
.PHONY: test
## test : Run test
test:
$(V)cargo test --workspace
.PHONY: help
## help : Print help message
help: Makefile
@sed -n 's/^##//p' $< | awk 'BEGIN {FS = ":"} {printf "\033[36m%-23s\033[0m %s\n", $$1, $$2}'
# --------------- ------------------ ---------------
# --------------- User Defined Tasks ---------------
.PHONY: cmd/ccr_syncer
.PHONY: ccr_syncer
## ccr_syncer : Build ccr_syncer binary
ccr_syncer: bin
$(V)go build -o bin/ccr_syncer cmd/ccr_syncer.go
.PHONY: get_binlog
## get_binlog : Build get_binlog binary
get_binlog: bin
$(V)go build -o bin/get_binlog cmd/get_binlog.go
## run_get_binlog : Run get_binlog binary
run_get_binlog: get_binlog
$(V)bin/get_binlog
.PHONY: sync_thrift
## sync_thrift : Sync thrift
# TODO(Drogon): Add build thrift
sync_thrift:
$(V)rsync -avc $(THRIFT_DIR)/ rpc/thrift/
.PHONY: ingest_binlog
## ingest_binlog : Build ingest_binlog binary
ingest_binlog: bin
$(V)go build -o bin/ingest_binlog cmd/ingest_binlog.go
.PHONY: get_meta
## get_meta : Build get_meta binary
get_meta: bin
$(V)go build -o bin/get_meta cmd/get_meta.go
.PHONY: snapshot_op
## snapshot_op : Build snapshot_op binary
snapshot_op: bin
$(V)go build -o bin/snapshot_op cmd/snapshot_op.go
.PHONY: get_master_token
## get_master_token : Build get_master_token binary
get_master_token: bin
$(V)go build -o bin/get_master_token cmd/get_master_token.go
.PHONY: spec_checker
## spec_checker : Build spec_checker binary
spec_checker: bin
$(V)go build -o bin/spec_checker cmd/spec_checker.go
.PHONY: get_lag
## get_lag : Build get_lag binary
get_lag: bin
$(V)go build -o bin/get_lag cmd/get_lag.go