From ee64e6fcdac62d7806fd9d4c9ecfb662bdc34585 Mon Sep 17 00:00:00 2001 From: Chris Sommers Date: Sat, 25 Jun 2022 10:58:09 -0700 Subject: [PATCH] Add GEN_SAIRPC_OPTS to pass flags to gensairpc.pl from top-level Makefile or meta/Makefile Signed-off-by: Chris Sommers --- Makefile | 5 ++++- meta/Makefile | 5 ++++- meta/README.md | 6 +++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8509c2e37..9f16703b5 100644 --- a/Makefile +++ b/Makefile @@ -28,6 +28,9 @@ else SAITHRIFT_PATH=test/saithrift endif +# Passed to genrpc.pl via "make saithrift-build": +GEN_SAIRPC_OPTS?= + .PHONY: test doc clean doc: @@ -37,7 +40,7 @@ test: make -C test saithrift-build: - make -C $(SAITHRIFT_PATH) + GEN_SAIRPC_OPTS=$(GEN_SAIRPC_OPTS) make -C $(SAITHRIFT_PATH) saithrift-install: saithrift-build make -C $(SAITHRIFT_PATH) install diff --git a/meta/Makefile b/meta/Makefile index ce5423721..dc41edab9 100644 --- a/meta/Makefile +++ b/meta/Makefile @@ -22,6 +22,9 @@ # @brief This module defines SAI Metadata Makefile # +# Passed to genrpc.pl: +GEN_SAIRPC_OPTS?= + WARNINGS = \ -ansi \ -Wall \ @@ -114,7 +117,7 @@ saimetadatatest.c saimetadata.c saimetadata.h: xml $(XMLDEPS) parse.pl $(CONSTHE perl -I. parse.pl rpc sai.thrift sai_rpc_server.cpp sai_adapter.py: xml $(XMLDEPS) gensairpc.pl - perl -Irpc gensairpc.pl + perl -Irpc gensairpc.pl $(GEN_SAIRPC_OPTS) HEADERS = saimetadata.h $(CONSTHEADERS) diff --git a/meta/README.md b/meta/README.md index d0e2f89fa..c93bea510 100644 --- a/meta/README.md +++ b/meta/README.md @@ -13,5 +13,9 @@ Parser also forces headers to be well formated when adding new code. To test your changes just type: ```sh -make +[GEN_SAIRPC_OPTS=