-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathMakefile
39 lines (31 loc) · 1.33 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
DIR:=$(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
LOCAL_BIN:=$(DIR)/bin
GEN_CLAY_BIN:=$(DIR)/bin/protoc-gen-goclay
export GEN_CLAY_BIN
GEN_GO_BIN:=$(DIR)/bin/protoc-gen-go
export GEN_GO_BIN
GEN_GO_GRPC_BIN:=$(DIR)/bin/protoc-gen-go-grpc
export GEN_GO_GRPC_BIN
export THIRD_PARTY_PROTO_PATH:=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))../../integration/third_party/proto
$(info ${THIRD_PARTY_PROTO_PATH})
GREEN:=\033[0;32m
RED:=\033[0;31m
NC=:\033[0m
.protoc-build:
$(info #Installing binary dependencies...)
GOBIN=$(LOCAL_BIN) go install -mod=mod github.com/utrack/clay/v3/cmd/protoc-gen-goclay
GOBIN=$(LOCAL_BIN) go install -mod=mod google.golang.org/protobuf/cmd/protoc-gen-go
GOBIN=$(LOCAL_BIN) go install -mod=mod google.golang.org/grpc/cmd/protoc-gen-go-grpc
build: .protoc-build
protoc \
--plugin=protoc-gen-goclay=$(GEN_CLAY_BIN) --goclay_out=. --goclay_opt=impl=true,force=false,tests=false,impl_path=../implementation,paths=source_relative \
--plugin=protoc-gen-go=$(GEN_GO_BIN) --go_out=. --go_opt=paths=source_relative \
--plugin=protoc-gen-go-grpc=$(GEN_GO_GRPC_BIN) --go-grpc_out=. --go-grpc_opt=paths=source_relative \
-I/usr/local/include:${THIRD_PARTY_PROTO_PATH}:. \
pb/sum.proto
run-server:
go run ./main.go
run-client-http:
go run ./client-http/main.go
run-client-grpc:
go run ./client-grpc/main.go