2023-05-25 04:05:34 +00:00
|
|
|
PROTOFILES = $(wildcard *.proto)
|
|
|
|
GO_TARGETS = $(patsubst %.proto,%.pb.go,$(PROTOFILES))
|
2023-05-25 06:57:56 +00:00
|
|
|
DEBIAN_DEPS = protobuf-compiler protoc-gen-go protobuf-compiler-grpc \
|
|
|
|
golang-goprotobuf-dev golang-google-genproto-dev \
|
|
|
|
golang-google-grpc-dev grpc-proto golang-protobuf-extensions-dev
|
2023-05-25 04:05:34 +00:00
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: $(GO_TARGETS)
|
|
|
|
|
|
|
|
%.pb.go: %.proto
|
2023-05-25 06:57:56 +00:00
|
|
|
protoc -I=$(PWD) --go_out=$(PWD) --go-grpc_out=. --go-grpc_opt=paths=source_relative $<
|
2023-05-25 04:05:34 +00:00
|
|
|
|
|
|
|
.PHONY: install-debian-deps
|
|
|
|
install-debian-deps:
|
|
|
|
sudo apt-get install $(DEBIAN_DEPS)
|
|
|
|
|
|
|
|
.PHONY: uninstall-debian-deps
|
|
|
|
uninstall-debian-deps:
|
|
|
|
sudo apt-get remove $(DEBIAN_DEPS)
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
|
|
|
rm -f *.pb.go
|