summaryrefslogtreecommitdiffstats
path: root/vpp-api/java/Makefile.am
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-04-26 12:09:05 +0200
committerEd Warnicke <hagbard@gmail.com>2016-05-02 20:58:54 +0000
commitd85036fd6bf25bb11a6f3fdfccf4425428834f28 (patch)
tree457505ac351630c88f60d33bddbf1d5789e34f46 /vpp-api/java/Makefile.am
parentc5e8681b320884f780508458ebff873761d5e04a (diff)
HONEYCOMB-10: jVpp - the new java API. C code and jar file generation
Added comments generation for C and Java files. Change-Id: Ifb670a5592eb871bfe68804f0a8d8f9b5b14f00a Signed-off-by: Marek Gradzki <mgradzki@cisco.com> Signed-off-by: Ed Warnicke <eaw@cisco.com>
Diffstat (limited to 'vpp-api/java/Makefile.am')
-rw-r--r--vpp-api/java/Makefile.am49
1 files changed, 48 insertions, 1 deletions
diff --git a/vpp-api/java/Makefile.am b/vpp-api/java/Makefile.am
index 0e16b72b38f..8ad24e13239 100644
--- a/vpp-api/java/Makefile.am
+++ b/vpp-api/java/Makefile.am
@@ -90,4 +90,51 @@ demo = japi/test/demo.class
$(demo): $(jarfile)
$(JAVAC) -cp $(jarfile) -d $(JAVAROOT) @srcdir@/japi/test/demo.java
-all-local: $(jarfile) $(demo)
+#
+# jVpp binding
+#
+
+nobase_include_HEADERS += \
+ jvpp/org_openvpp_jvpp_VppJNIConnection.h
+
+lib_LTLIBRARIES += libjvpp.la
+
+libjvpp_la_SOURCES = jvpp/jvpp.c
+libjvpp_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra \
+ -lpthread -lm -lrt
+libjvpp_la_LDFLAGS = -module
+libjvpp_la_CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
+
+# todo make two jars api jar and impl jar
+jarfile_jvpp = jvpp-$(PACKAGE_VERSION).jar
+packagedir_jvpp = org/openvpp/jvpp
+JAVAROOT = .
+
+BUILT_SOURCES += jvpp/org_openvpp_jvpp_VppJNIConnection.h jvpp/jvpp.c
+
+jvpp/org_openvpp_jvpp_VppJNIConnection.h: $(prefix)/../vpp/api/vpe.api
+ @echo " jVpp API"; \
+ mkdir -p dto future callfacade callback @srcdir@/jvpp/gen/target/org/openvpp/jvpp; \
+ $(CC) $(CPPFLAGS) -E -P -C -x c $< \
+ | vppapigen --input - --python defs_vpp_papi.py; \
+ @srcdir@/jvpp/gen/jvpp_gen.py -i defs_vpp_papi.py; \
+ cp -rf dto future callfacade callback *.java -t @srcdir@/jvpp/gen/target/org/openvpp/jvpp/; \
+ cp -rf jvpp_gen.h -t @srcdir@/jvpp/gen/target; \
+ rm -rf dto future callfacade callback *.java jvpp_gen.h; \
+ $(JAVAC) -classpath . -d . @srcdir@/jvpp/org/openvpp/jvpp/*.java \
+ @srcdir@/jvpp/org/openvpp/jvpp/dto/*.java \
+ @srcdir@/jvpp/org/openvpp/jvpp/callback/*.java \
+ @srcdir@/jvpp/org/openvpp/jvpp/future/*.java \
+ @srcdir@/jvpp/org/openvpp/jvpp/test/*.java \
+ @srcdir@/jvpp/gen/target/org/openvpp/jvpp/*.java \
+ @srcdir@/jvpp/gen/target/org/openvpp/jvpp/dto/*.java \
+ @srcdir@/jvpp/gen/target/org/openvpp/jvpp/callback/*.java \
+ @srcdir@/jvpp/gen/target/org/openvpp/jvpp/callfacade/*.java \
+ @srcdir@/jvpp/gen/target/org/openvpp/jvpp/future/*.java ; \
+ $(JAVAH) -classpath . -d jvpp org.openvpp.jvpp.VppJNIConnection ; \
+ $(JAVAH) -classpath . -d jvpp org.openvpp.jvpp.JVppImpl ;
+
+$(jarfile_jvpp): libjvpp.la
+ cd .libs ; $(JAR) cf $(JARFLAGS) ../$@ libjvpp.so.0.0.0 ../$(packagedir_jvpp)/* ; cd ..
+
+all-local: $(jarfile) $(jarfile_jvpp) $(demo)