forked from relab/hotstuff
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (33 loc) · 1.13 KB
/
Makefile
File metadata and controls
45 lines (33 loc) · 1.13 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
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/handelpb/handel.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/handelpb/handel_gorums.pb.go
binaries := hotstuff plot
.PHONY: all debug clean protos 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)
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)
%.pb.go %_gorums.pb.go : %.proto
protoc -I=.:$(proto_include) \
--go_out=paths=source_relative:. \
--gorums_out=paths=source_relative:. \
$<