-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
37 lines (29 loc) · 948 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
TEST := go test -count=1 -race -cover
PKGS := $$(go list ./... | grep -v vendor/)
.PHONY: all test build grpc
lint: format
golint $(PKGS)
format:
go vet $(PKGS)
go fmt $(PKGS)
protoc:
rm -fr /tmp/protoc-3.7.1-linux-x86_64.zip
curl -Lv https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/protoc-3.7.1-linux-x86_64.zip -o /tmp/protoc-3.7.1-linux-x86_64.zip
sudo unzip -o /tmp/protoc-3.7.1-linux-x86_64.zip -d /usr/local bin/protoc
sudo unzip -o /tmp/protoc-3.7.1-linux-x86_64.zip -d /usr/local 'include/*'
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
grpc:
protoc --go_out=. \
--go-grpc_out=. \
--go_opt=paths=source_relative \
--go-grpc_opt=require_unimplemented_servers=false,paths=source_relative \
grpc/gen/yavirtd.proto
deps:
go mod tidy
test:
ifdef RUN
$(TEST) -v -run='${RUN}' $(PKGS)
else
$(TEST) $(PKGS)
endif