Skip to content

Commit

Permalink
build/grpc: improve readability of subdir.am
Browse files Browse the repository at this point in the history
* replaced suffix rules by pattern rules
* `.pb.h`, `.pb.cc`, & `.grpc.pb.cc` are no more needed in SUFFIXES.

Link: https://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html
Link: https://www.gnu.org/s/make/manual/html_node/Pattern-Rules.html
Signed-off-by: Ariel Otilibili <[email protected]>
  • Loading branch information
ariel-anieli committed Dec 14, 2024
1 parent 4e0e226 commit 8ab56a1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions grpc/subdir.am
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,14 @@ am__v_PROTOC_ = $(am__v_PROTOC_$(AM_DEFAULT_VERBOSITY))
am__v_PROTOC_0 = @echo " PROTOC " $@;
am__v_PROTOC_1 =

SUFFIXES += .pb.h .pb.cc .grpc.pb.cc

grpc/frr-northbound.grpc.pb.h: grpc/frr-northbound.grpc.pb.cc
@test -f $@ || rm -f $< || true
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $<
grpc/frr-northbound.pb.h: grpc/frr-northbound.pb.cc
@test -f $@ || rm -f $< || true
@test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $<

.proto.pb.cc:
%.pb.cc: %.proto
$(AM_V_PROTOC)$(PROTOC) -I$(top_srcdir) --cpp_out=$(top_builddir) $^
.proto.grpc.pb.cc:
%.grpc.pb.cc: %.proto
$(AM_V_PROTOC)$(PROTOC) -I$(top_srcdir) --grpc_out=$(top_builddir) --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` $^

0 comments on commit 8ab56a1

Please sign in to comment.