summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2016-08-01 04:59:13 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2016-08-25 00:29:40 +0000
commit5f9dcff39d5e25c6bef30d569e405635633f3c69 (patch)
treeec14d5fdb45a9d82cf5703d63e0bcafcc40d4da0 /plugins
parent151fb725636f192da8a04d0f74dc3455b58dd61c (diff)
VPP Python language binding - plugin support
- Moved Python generator tool to tools directory - Added build-vpp-api Makefile target - Generator now only creates a Python representation of the .api the rest of the framework is in the vpp_papi script - Each plugin has its own namespace. - Plugin Python files are installed in vpp_papi_plugins for easy use inside the build tree. Change-Id: I272c83bb7e5d5e416bdbd8a790a3cc35c5a04e38 Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/ioam-plugin/Makefile.am11
-rw-r--r--plugins/snat-plugin/Makefile.am11
2 files changed, 20 insertions, 2 deletions
diff --git a/plugins/ioam-plugin/Makefile.am b/plugins/ioam-plugin/Makefile.am
index 2ea29e006d9..68e792482a9 100644
--- a/plugins/ioam-plugin/Makefile.am
+++ b/plugins/ioam-plugin/Makefile.am
@@ -28,7 +28,7 @@ ioam_pot_plugin_la_SOURCES = \
ioam/lib-pot/pot_api.c
BUILT_SOURCES = \
- ioam/lib-pot/pot.api.h
+ ioam/lib-pot/pot.api.h ioam/lib-pot/pot.py
SUFFIXES = .api.h .api
@@ -37,6 +37,15 @@ SUFFIXES = .api.h .api
$(CC) $(CPPFLAGS) -E -P -C -x c $^ \
| vppapigen --input - --output $@ --show-name $@
+%.py: %.api
+ $(info Creating Python binding for $@)
+ $(CC) $(CPPFLAGS) -E -P -C -x c $< \
+ | vppapigen --input - --python - \
+ | pyvppapigen.py --input - > $@
+
+pyapidir = ${prefix}/vpp_papi_plugins
+pyapi_DATA = ioam/lib-pot/pot.py
+
noinst_HEADERS = \
ioam/lib-pot/pot_all_api_h.h \
ioam/lib-pot/pot_msg_enum.h \
diff --git a/plugins/snat-plugin/Makefile.am b/plugins/snat-plugin/Makefile.am
index 0fe694cf7bd..91fec414363 100644
--- a/plugins/snat-plugin/Makefile.am
+++ b/plugins/snat-plugin/Makefile.am
@@ -28,7 +28,7 @@ snat_plugin_la_SOURCES = snat/snat.c \
snat/out2in.c \
snat/snat_plugin.api.h
-BUILT_SOURCES = snat/snat.api.h
+BUILT_SOURCES = snat/snat.api.h snat/snat.py
SUFFIXES = .api.h .api
@@ -37,6 +37,15 @@ SUFFIXES = .api.h .api
$(CC) $(CPPFLAGS) -E -P -C -x c $^ \
| vppapigen --input - --output $@ --show-name $@
+%.py: %.api
+ $(info Creating Python binding for $@)
+ $(CC) $(CPPFLAGS) -E -P -C -x c $< \
+ | vppapigen --input - --python - \
+ | pyvppapigen.py --input - > $@
+
+pyapidir = ${prefix}/vpp_papi_plugins
+pyapi_DATA = snat/snat.py
+
noinst_HEADERS = \
snat/snat_all_api_h.h \
snat/snat_msg_enum.h \