Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ env ?= env GOOS=$(os) GOARCH=$(arch)
build_flags ?= -buildvcs=false -o
go_build ?= $(env) $(go_cmd) build $(build_flags)
go_test ?= $(go_cmd) test -json -v -timeout 30m
proto_path ?=

ifneq ($(wildcard "/usr/include"),)
proto_path += "/usr/include"
endif

arch_output_dir_rel = $(arch_output_dir:${project_dir}/%=%)

Expand Down Expand Up @@ -180,17 +185,17 @@ bench-sidecar: FORCE
PROTO_TARGETS ?= $(shell find ./api \
-name '*.proto' -print0 | \
xargs -0 -n 1 dirname | xargs -n 1 basename | \
sort -u | sed -e "s/^proto/proto-/" \
sort -u | sed -E 's/(.*)pb$$/proto-\1/' \
)

proto: $(PROTO_TARGETS)

proto-%: FORCE
@echo "Compiling: $*"
@protoc --proto_path="${PWD}" \
--proto_path="/usr/include" \
--proto_path="${proto_path}" \
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
--go_out=paths=source_relative:. ${PWD}/api/proto$*/*.proto
--go_out=paths=source_relative:. ${PWD}/api/$*pb/*.proto

#########################
# Binaries
Expand Down
Loading
Loading