# Protobuf generated go files
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))
DEST=${PWD}
BIN=protocol

.PHONY: all build generate deps clean lint

all: build generate lint

build: $(PROTO_GO_FILES)
	@buf build

lint: generate main.go
	@go build -o $(BIN)

generate:
	@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:
	@rm -f $(PROTO_GO_FILES) $(BIN) \
	@rm -rf gen
