summaryrefslogtreecommitdiffstats
path: root/plugins/acl-plugin/Makefile.am
diff options
context:
space:
mode:
authorJan Srnicek <jsrnicek@cisco.com>2016-12-07 09:42:52 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2016-12-07 21:24:45 +0000
commit4183d6d763326e79c67a4f7db61390d6654ea6c7 (patch)
tree750a9f76e94dfc72417799739fdc2a66bfae52f6 /plugins/acl-plugin/Makefile.am
parent0e3c0de1ed87f3cdf16e26e05e39ea6eebeafb18 (diff)
Acl JVpp api generation (HONEYCOMB-305)
Includes simple test cases for acl management. Change-Id: Ifff4f4baf9bfe84d73ebc46b591ecc46c85c94ad Signed-off-by: Jan Srnicek <jsrnicek@cisco.com> Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'plugins/acl-plugin/Makefile.am')
-rw-r--r--plugins/acl-plugin/Makefile.am54
1 files changed, 54 insertions, 0 deletions
diff --git a/plugins/acl-plugin/Makefile.am b/plugins/acl-plugin/Makefile.am
index 623c192c..bab1ccb5 100644
--- a/plugins/acl-plugin/Makefile.am
+++ b/plugins/acl-plugin/Makefile.am
@@ -57,3 +57,57 @@ acl_test_plugin_la_SOURCES = acl/acl_test.c acl/acl_plugin.api.h
install-data-hook:
@(cd $(vpppluginsdir) && $(RM) $(vppplugins_LTLIBRARIES))
@(cd $(vppapitestpluginsdir) && $(RM) $(vppapitestplugins_LTLIBRARIES))
+
+#
+# Java code generation
+#
+jvpp_registry_root = ../../vpp-api/java
+jvpp_registry_version = 17.01
+jacl_jarfile = jvpp-acl-$(PACKAGE_VERSION).jar
+jvpp_package_dir = io/fd/vpp/jvpp/acl
+jvpp_root = acl/jvpp
+jvpp_target_dir = target
+jvpp_target = $(jvpp_root)/$(jvpp_target_dir)
+api_file=$(srcdir)/acl/acl.api
+
+lib_LTLIBRARIES = libjvpp_acl.la
+libjvpp_acl_la_SOURCES = acl/acl.api.h acl/jvpp_acl.c acl/jvpp/io_fd_vpp_jvpp_acl_JVppAclImpl.h
+libjvpp_acl_la_LIBADD = -lvlibmemoryclient -lvlibapi -lvppinfra \
+ -lpthread -lm -lrt -L$(jvpp_registry_root)/.libs -ljvpp_common
+libjvpp_acl_la_LDFLAGS = -module
+libjvpp_acl_la_CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -I../ -I$(srcdir)/../
+
+BUILT_SOURCES += $(jvpp_root)/io_fd_vpp_jvpp_acl_JVppAclImpl.h
+
+$(jvpp_root)/io_fd_vpp_jvpp_acl_JVppAclImpl.h: acl.api.json
+ dir=`pwd`; \
+ mkdir -p $(jvpp_target); \
+ mkdir -p $(jvpp_root)/$(jvpp_package_dir); \
+ cd $(jvpp_root)/$(jvpp_package_dir); \
+ mkdir -p types dto future callfacade callback notification test; \
+ @srcdir@/$(jvpp_registry_root)/jvpp/gen/jvpp_gen.py -i $${dir}/acl.api.json --plugin_name acl; \
+ cd -; \
+ mv -f $(jvpp_root)/$(jvpp_package_dir)/jvpp_acl_gen.h $(jvpp_root)/jvpp_acl_gen.h; \
+ cp $(srcdir)/$(jvpp_root)/$(jvpp_package_dir)/test/*.java $(jvpp_root)/$(jvpp_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_package_dir)/*.java \
+ $(jvpp_package_dir)/types/*.java \
+ $(jvpp_package_dir)/dto/*.java \
+ $(jvpp_package_dir)/callback/*.java \
+ $(jvpp_package_dir)/notification/*.java \
+ $(jvpp_package_dir)/future/*.java \
+ $(jvpp_package_dir)/callfacade/*.java \
+ $(jvpp_package_dir)/test/*.java \
+ || (echo "acl jvpp compilation failed: $$?"; exit 1); \
+ $(JAVAH) -classpath .:$(jvpp_target_dir):../../$(jvpp_registry_root)/jvpp-registry-$(jvpp_registry_version).jar -d . io.fd.vpp.jvpp.acl.JVppAclImpl ;
+
+$(jacl_jarfile): libjvpp_acl.la
+ cp .libs/libjvpp_acl.so.0.0.0 $(jvpp_target); \
+ cd $(jvpp_target); \
+ $(JAR) cfv $(JARFLAGS) ../../../$@ libjvpp_acl.so.0.0.0 $(jvpp_package_dir)/* ; cd ..;
+
+acl.api.json:
+ @echo " jAcl_sfc API"; \
+ vppapigen --input $(api_file) --json acl.api.json;
+
+all-local: $(jacl_jarfile)