fonchain-artistinfo/makefile
2023-03-06 10:58:27 +08:00

38 lines
1.2 KiB
Makefile

.PHONY: all build run gotool help
BINARY="artisrService"
all: gotool build
build:
go env -w GOOS=linux
go build -ldflags "-s -w" -o ./build/${BINARY} ./cmd/app.go
pushTest:
DockerBuildTest.bat
pushProd:
DockerBuildProd.bat
run:
@go run ./cmd/app.go
gotool:
go fmt ./
go vet ./
#protoc:
#protoc --go_out=./pb/artist --go-triple_out=./pb/artist --validate_out="lang=go:./pb/artist" ./pb/artist/artist.proto
#protoc --go_out=./pb/artist --go-grpc_out=./pb/artist --go-triple_out=./pb/artist --validate_out="lang=go:./pb/artist" ./pb/artist/artist.proto
protoc:
protoc --proto_path=. --go_out=./pb --go-triple_out=./pb --govalidators_out="lang=go:./pb" ./pb/artist.proto
protoc --proto_path=. --go_out=./pb --go-triple_out=./pb --govalidators_out="lang=go:./pb" ./pb/artist_third_party.proto
all_protoc:
protoc --go_out=./pb/artist --go-grpc_out=./pb/artist --go-triple_out=./pb/artist --govalidators_out=./pb/artist ./pb/artist/artist.proto
help:
@echo "make - 格式化 Go 代码, 并编译生成二进制文件"
@echo "make build - 编译 Go 代码, 生成二进制文件"
@echo "make run - 直接运行 Go 代码"
@echo "make gotool - 运行 Go 工具 'fmt' and 'vet'"
@echo "make protoc - 解析proto文件"