Commit 69b9c4b3 authored by vicotor's avatar vicotor

update Makefile

parent 2ea0aa61
# Protobuf generated go files # Protobuf generated go files
PROTO_FILES = $(shell find . -path -prune -o -type f -name '*.proto' -print | grep -v vendor) PROTO_GO_FILES = $(shell find . -path -prune -o -type f -name '*.pb.go' -print | grep -v vendor)
PROTO_GO_FILES = $(patsubst %.proto, %.pb.go, $(PROTO_FILES)) #PROTO_GO_FILES = $(patsubst %.proto, %.pb.go, $(PROTO_FILES))
PROTO_GO_FILES_REAL = $(shell find . -path -prune -o -type f -name '*.pb.go' -print | grep -v vendor)
DEST=${PWD} DEST=${PWD}
BIN=protocol BIN=protocol
.PHONY: all build deps clean codecheck .PHONY: all build generate deps clean lint
all: build codecheck all: build generate lint
codecheck: $(PROTO_GO_FILES) main.go
@go build -o $(BIN)
build: $(PROTO_GO_FILES) build: $(PROTO_GO_FILES)
@buf build
# Implicit compile rule for GRPC/proto files (note since pb.go files no longer generated lint: generate main.go
# in same directory as proto file this just regenerates everything @go build -o $(BIN)
%.pb.go: %.proto
protoc -I . -I protobuf "$<" --gogo_out=plugins=grpc:${DEST}
deps: generate:
@go get -u github.com/gogo/protobuf/protoc-gen-gogo @buf generate
deps:
@go get -u github.com/gogo/protobuf/protoc-gen-gogo \
@go install github.com/bufbuild/buf/cmd/buf@v1.9.0
clean: clean:
@rm -f $(PROTO_GO_FILES_REAL) $(BIN) @rm -f $(PROTO_GO_FILES) $(BIN) \
@rm -rf gen
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment