-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathMakefile
62 lines (44 loc) · 1.45 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
proto_include := $(shell go list -m -f {{.Dir}} github.com/relab/gorums):internal/proto
proto_src := internal/proto/clientpb/client.proto \
internal/proto/hotstuffpb/hotstuff.proto \
internal/proto/orchestrationpb/orchestration.proto \
internal/proto/kauripb/kauri.proto \
metrics/types/types.proto
proto_go := $(proto_src:%.proto=%.pb.go)
gorums_go := internal/proto/clientpb/client_gorums.pb.go \
internal/proto/hotstuffpb/hotstuff_gorums.pb.go \
internal/proto/kauripb/kauri_gorums.pb.go
mock_input_go := ./modules/./...
binaries := hotstuff plot
CSV ?= wonderproxy.csv
.PHONY: all aws wonderproxy latencies debug clean protos mocks download tools $(binaries)
all: $(binaries)
debug: GCFLAGS += -gcflags='all=-N -l'
debug: $(binaries)
$(binaries): protos
@go build -o ./$@ $(GCFLAGS) ./cmd/$@
protos: $(proto_go) $(gorums_go)
mocks:
@go generate $(mock_input_go)
download:
@go mod download
tools: download
@cat tools.go | grep _ | awk -F'"' '{print $$2}' | xargs -I % go install %
test:
@go test -v ./...
lint:
@golangci-lint run ./...
clean:
@rm -fv $(binaries)
latencies:
@echo "Generating Latency Matrix using $(CSV)"
@go run cmd/latencygen/main.go -file "$(CSV)"
wonderproxy:
@$(MAKE) latencies CSV=wonderproxy.csv
aws:
@$(MAKE) latencies CSV=aws.csv
%.pb.go %_gorums.pb.go : %.proto
protoc -I=.:$(proto_include) \
--go_out=paths=source_relative:. \
--gorums_out=paths=source_relative:. \
$<