-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (31 loc) · 900 Bytes
/
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
GO = go
PROTOC = protoc
BINDIR = bin
.PHONY: all ci clean dep htmlcov kv pb pbclean test testcov vet
all: dep pb testcov kv
ci: dep pb testcov
clean: pbclean
$(GO) clean
rm -f $(BINDIR)/kv
dep:
$(GO) mod download -x
htmlcov: testcov
$(GO) tool cover -html=coverage.out
kv:
$(GO) build -o $(BINDIR)/kv -v ./cmd/kv
pb:
$(PROTOC) --proto_path=pb/ --go_out=pb/ --go_opt=paths=source_relative \
--go-grpc_out=pb/ --go-grpc_opt=paths=source_relative \
$(shell find pb -iname "*.proto")
$(PROTOC) --proto_path=pb/ --proto_path=cmd/kv/pb/ \
--go_out=cmd/kv/pb/ --go_opt=paths=source_relative \
--go-grpc_out=cmd/kv/pb/ --go-grpc_opt=paths=source_relative \
$(shell find cmd/kv/pb -iname "*.proto")
pbclean:
find . -iname "*.pb.go" -type f -delete
test:
$(GO) test -v ./...
testcov:
$(GO) test -v -race -covermode=atomic -coverprofile=coverage.out ./...
vet:
$(GO) vet ./...