committed by
GitHub
parent
24c3492541
commit
9d47494585
15
Makefile
15
Makefile
@@ -11,7 +11,6 @@ ARCHS ?= amd64
|
||||
GOFILES := $(shell find . -name "*.go" -type f)
|
||||
TAGS ?= sqlite
|
||||
LDFLAGS ?= -X 'main.Version=$(VERSION)'
|
||||
NODE_PROTOC_PLUGIN := $(shell which grpc_tools_node_protoc_plugin)
|
||||
|
||||
ifneq ($(shell uname), Darwin)
|
||||
EXTLDFLAGS = -extldflags "-static" $(null)
|
||||
@@ -149,16 +148,14 @@ clean:
|
||||
find . -name *.db -delete
|
||||
-rm -rf release dist .cover
|
||||
|
||||
rpc/example/node/gorush_*_pb.js: rpc/proto/gorush.proto
|
||||
@hash grpc_tools_node_protoc_plugin > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
||||
npm install -g grpc-tools; \
|
||||
fi
|
||||
protoc -I rpc/proto rpc/proto/gorush.proto --js_out=import_style=commonjs,binary:rpc/example/node/ --grpc_out=rpc/example/node/ --plugin=protoc-gen-grpc=$(NODE_PROTOC_PLUGIN)
|
||||
generate_proto_js:
|
||||
npm install grpc-tools
|
||||
protoc -I rpc/proto rpc/proto/gorush.proto --js_out=import_style=commonjs,binary:rpc/example/node/ --grpc_out=rpc/example/node/ --plugin=protoc-gen-grpc="node_modules/.bin/grpc_tools_node_protoc_plugin"
|
||||
|
||||
rpc/proto/gorush.pb.go: rpc/proto/gorush.proto
|
||||
protoc -I rpc/proto rpc/proto/gorush.proto --go_out=plugins=grpc:rpc/proto
|
||||
generate_proto_go:
|
||||
protoc -I rpc/proto rpc/proto/gorush.proto --go_out=rpc/proto --go-grpc_out=require_unimplemented_servers=false:rpc/proto
|
||||
|
||||
generate_proto: rpc/proto/gorush.pb.go rpc/example/node/gorush_*_pb.js
|
||||
generate_proto: generate_proto_go generate_proto_js
|
||||
|
||||
version:
|
||||
@echo $(VERSION)
|
||||
|
||||
Reference in New Issue
Block a user