summaryrefslogtreecommitdiffstats
path: root/plugins/ioam-plugin/Makefile.am
diff options
context:
space:
mode:
authorSagar Srivastav <sagsriva@cisco.com>2016-12-12 22:08:20 -0800
committerDamjan Marion <dmarion.lists@gmail.com>2016-12-19 18:52:16 +0000
commit72d0916b82901496bed2f0cebf0cfc9968d239d4 (patch)
treec7ebc63a4f04dbc31326ae1aa40bd18fe250d0d4 /plugins/ioam-plugin/Makefile.am
parentb75b8df6bd3fb0ae4015752c13fb87be84475111 (diff)
ioam: export plugin - genarate java bindings
Change-Id: Ia0b81418a2171464ca4b4753afa6898c0c9ee626 Signed-off-by: Sagar Srivastav <sagsriva@cisco.com>
Diffstat (limited to 'plugins/ioam-plugin/Makefile.am')
-rw-r--r--plugins/ioam-plugin/Makefile.am49
1 files changed, 46 insertions, 3 deletions
diff --git a/plugins/ioam-plugin/Makefile.am b/plugins/ioam-plugin/Makefile.am
index ea3fe56f11d..130f87e2f18 100644
--- a/plugins/ioam-plugin/Makefile.am
+++ b/plugins/ioam-plugin/Makefile.am
@@ -246,9 +246,6 @@ all-local: $(jioam_trace_jarfile)
jioam_pot_jarfile = jvpp-ioam-pot-$(PACKAGE_VERSION).jar
jvpp_pot_package_dir = io/fd/vpp/jvpp/ioampot
-jvpp_root = ioam/jvpp
-jvpp_target_dir = target
-jvpp_target = $(jvpp_root)/$(jvpp_target_dir)
pot_api_file=$(srcdir)/ioam/lib-pot/pot.api
@@ -292,3 +289,49 @@ ioam_pot.api.json:
vppapigen --input $(pot_api_file) --json ioam_pot.api.json;
all-local: $(jioam_pot_jarfile)
+
+jioam_export_jarfile = jvpp-ioam-export-$(PACKAGE_VERSION).jar
+jvpp_export_package_dir = io/fd/vpp/jvpp/ioamexport
+export_api_file=$(srcdir)/ioam/export/ioam_export.api
+
+
+lib_LTLIBRARIES += libjvpp_ioamexport.la
+libjvpp_ioamexport_la_SOURCES = ioam/export/export.api.h ioam/export/jvpp_ioam_export.c ioam/jvpp/io_fd_vpp_jvpp_ioam_export_JVppIoamexportImpl.h
+libjvpp_ioamexport_la_LIBADD = -lvlibmemoryclient -lvlibapi -lvppinfra \
+ -lpthread -lm -lrt -L$(jvpp_registry_root)/.libs -ljvpp_common
+libjvpp_ioamexport_la_LDFLAGS = -module
+libjvpp_ioamexport_la_CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -I../ -I$(srcdir)/../
+
+BUILT_SOURCES += $(jvpp_root)/io_fd_vpp_jvpp_ioamexport_JVppIoamexportImpl.h
+
+$(jvpp_root)/io_fd_vpp_jvpp_ioamexport_JVppIoamexportImpl.h: ioam_export.api.json
+ dir=`pwd`; \
+ mkdir -p $(jvpp_target); \
+ mkdir -p $(jvpp_root)/$(jvpp_export_package_dir); \
+ cd $(jvpp_root)/$(jvpp_export_package_dir); \
+ mkdir -p dto future callfacade callback notification test; \
+ @srcdir@/$(jvpp_registry_root)/jvpp/gen/jvpp_gen.py -i $${dir}/ioam_export.api.json --plugin_name ioamexport; \
+ cd -; \
+ mv -f $(jvpp_root)/$(jvpp_export_package_dir)/jvpp_ioamexport_gen.h $(jvpp_root)/jvpp_ioam_export_gen.h; \
+ cp $(srcdir)/$(jvpp_root)/$(jvpp_export_package_dir)/test/*.java $(jvpp_root)/$(jvpp_export_package_dir)/test/; \
+ cd $(jvpp_root); \
+ $(JAVAC) -classpath .:$(jvpp_target_dir):../../$(jvpp_registry_root)/jvpp-registry-$(jvpp_registry_version).jar -d $(jvpp_target_dir) $(jvpp_export_package_dir)/*.java \
+ $(jvpp_export_package_dir)/dto/*.java \
+ $(jvpp_export_package_dir)/callback/*.java \
+ $(jvpp_export_package_dir)/notification/*.java \
+ $(jvpp_export_package_dir)/future/*.java \
+ $(jvpp_export_package_dir)/callfacade/*.java \
+ $(jvpp_export_package_dir)/test/*.java \
+ || (echo "ioam export jvpp compilation failed: $$?"; exit 1); \
+ $(JAVAH) -classpath .:$(jvpp_target_dir):../../$(jvpp_registry_root)/jvpp-registry-$(jvpp_registry_version).jar -d . io.fd.vpp.jvpp.ioamexport.JVppIoamexportImpl ;
+
+$(jioam_export_jarfile): libjvpp_ioamexport.la
+ cp .libs/libjvpp_ioamexport.so.0.0.0 $(jvpp_target); \
+ cd $(jvpp_target); \
+ $(JAR) cfv $(JARFLAGS) ../../../$@ libjvpp_ioamexport.so.0.0.0 $(jvpp_export_package_dir)/* ; cd ..;
+
+ioam_export.api.json:
+ @echo " jIoam_export API"; \
+ vppapigen --input $(export_api_file) --json ioam_export.api.json;
+
+all-local: $(jioam_export_jarfile)