protoc-gen-go-micro/examples/go-kit/Makefile

20 lines
557 B
Makefile
Raw Normal View History

2016-12-13 12:36:55 +03:00
SOURCES := $(shell find . -name "*.proto" -not -path ./vendor/\*)
TARGETS_GO := $(foreach source, $(SOURCES), $(source)_go)
TARGETS_TMPL := $(foreach source, $(SOURCES), $(source)_tmpl)
.PHONY: build
2016-12-13 18:03:16 +03:00
build: server
server: $(TARGETS_GO) $(TARGETS_TMPL)
go build -o server .
2016-12-13 12:36:55 +03:00
$(TARGETS_GO): %_go:
2016-12-13 18:03:16 +03:00
protoc --gogo_out=plugins=grpc:. "$*"
2016-12-13 12:36:55 +03:00
$(TARGETS_TMPL): %_tmpl:
@mkdir -p $(dir $*)gen
2016-12-13 12:59:34 +03:00
protoc -I. --gotemplate_out=template_dir=templates:services "$*"
2016-12-13 13:05:06 +03:00
@rm -rf services/services # need to investigate why this directory is created
2016-12-13 12:59:34 +03:00
gofmt -w $(dir $*)gen