Skip to content

Commit

Permalink
Add GEN_SAIRPC_OPTS to pass flags to gensairpc.pl from top-level Make…
Browse files Browse the repository at this point in the history
…file or meta/Makefile

Signed-off-by: Chris Sommers <chrispsommers@gmail.com>
  • Loading branch information
chrispsommers committed Jun 25, 2022
1 parent bd6ba70 commit ee64e6f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
5 changes: 4 additions & 1 deletion meta/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
# @brief This module defines SAI Metadata Makefile
#

# Passed to genrpc.pl:
GEN_SAIRPC_OPTS?=

WARNINGS = \
-ansi \
-Wall \
Expand Down Expand Up @@ -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)

Expand Down
6 changes: 5 additions & 1 deletion meta/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<option flags>] make
```
e.g.
```
GEN_SAIRPC_OPTS="-ve" make
```

0 comments on commit ee64e6f

Please sign in to comment.