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 google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest @go install github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway .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