Move all generated code in the gen sub-directory
This commit is contained in:
@@ -3,6 +3,8 @@ SOURCES := $(shell find . -name "*.proto" -not -path ./vendor/\*)
|
||||
TARGETS_GO := $(foreach source, $(SOURCES), $(source)_go)
|
||||
TARGETS_TMPL := $(foreach source, $(SOURCES), $(source)_tmpl)
|
||||
|
||||
service_name = $(word 2,$(subst /, ,$1))
|
||||
|
||||
.PHONY: build
|
||||
build: server
|
||||
|
||||
@@ -11,6 +13,8 @@ server: $(TARGETS_GO) $(TARGETS_TMPL)
|
||||
|
||||
$(TARGETS_GO): %_go:
|
||||
protoc --gogo_out=plugins=grpc:. "$*"
|
||||
@mkdir -p services/$(call service_name,$*)/gen/pb
|
||||
@mv ./services/$(call service_name,$*)/$(call service_name,$*).pb.go ./services/$(call service_name,$*)/gen/pb/pb.go
|
||||
|
||||
$(TARGETS_TMPL): %_tmpl:
|
||||
@mkdir -p $(dir $*)gen
|
||||
|
||||
Reference in New Issue
Block a user