Makefile 669 Bytes
Newer Older
kzkzzzz's avatar
kzkzzzz committed
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
SHELL = /bin/sh

.PHONY: init
init:
	@go get -u google.golang.org/protobuf/proto
	@go install github.com/golang/protobuf/protoc-gen-go@latest
	@go install github.com/asim/go-micro/cmd/protoc-gen-micro/v4@latest

.PHONY: proto
proto:
	@protoc -I ./api \
	  --go_out=:./api --go_opt=paths=source_relative \
	  --go-grpc_out=:./api --go-grpc_opt=paths=source_relative \
	  ./api/*.proto

# --go-grpc_out=./proto --go-grpc_opt=paths=source_relative \
# --grpc-gateway_out=./proto --grpc-gateway_opt=paths=source_relative # grpc-gateway网关参数

.PHONY: update
update:
	@go get -u

.PHONY: tidy
tidy:
	@go mod tidy

.PHONY: build
build:
	@go build -x -v -o tmp/ main.go