16 lines
426 B
Makefile
Raw Normal View History

2016-12-13 10:36:55 +01: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
build: $(TARGETS_GO) $(TARGETS_TMPL)
$(TARGETS_GO): %_go:
2016-12-13 10:59:34 +01:00
protoc --gogo_out=. "$*"
2016-12-13 10:36:55 +01:00
$(TARGETS_TMPL): %_tmpl:
@mkdir -p $(dir $*)gen
2016-12-13 10:59:34 +01:00
protoc -I. --gotemplate_out=template_dir=templates:services "$*"
gofmt -w $(dir $*)gen