1 # Copyright (c) 2015 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
6 # http://www.apache.org/licenses/LICENSE-2.0
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
14 AUTOMAKE_OPTIONS = foreign subdir-objects
15 ACLOCAL_AMFLAGS = -I m4
28 nobase_include_HEADERS = \
29 jvpp/org_openvpp_jvpp_VppJNIConnection.h
31 lib_LTLIBRARIES += libjvpp.la
33 libjvpp_la_SOURCES = jvpp/jvpp.c
34 libjvpp_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra \
36 libjvpp_la_LDFLAGS = -module
37 libjvpp_la_CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
39 # todo make two jars api jar and impl jar
40 jarfile_jvpp = jvpp-$(PACKAGE_VERSION).jar
41 packagedir_jvpp = org/openvpp/jvpp
44 BUILT_SOURCES += jvpp/org_openvpp_jvpp_VppJNIConnection.h jvpp/jvpp.c
46 jvpp/org_openvpp_jvpp_VppJNIConnection.h: $(prefix)/../vpp/vpp-api/vpe.api
48 cp -rf @srcdir@/jvpp/* -t jvpp/; \
49 mkdir -p jvpp/gen/target/org/openvpp/jvpp; \
50 cp -rf jvpp/org/openvpp/jvpp/* -t jvpp/gen/target/org/openvpp/jvpp/; \
51 $(CC) $(CPPFLAGS) -E -P -C -x c $< \
52 | vppapigen --input - --python defs_vpp_papi.py; \
53 mkdir -p dto future callfacade callback notification; \
54 ./jvpp/gen/jvpp_gen.py -i defs_vpp_papi.py; \
55 cp -rf dto future callfacade callback notification *.java -t jvpp/gen/target/org/openvpp/jvpp/; \
56 cp -rf jvpp_gen.h -t jvpp/gen/target; \
57 rm -rf dto future callfacade callback notification *.java jvpp_gen.h; \
58 $(JAVAC) -classpath . -d . jvpp/gen/target/org/openvpp/jvpp/*.java \
59 jvpp/gen/target/org/openvpp/jvpp/dto/*.java \
60 jvpp/gen/target/org/openvpp/jvpp/callback/*.java \
61 jvpp/gen/target/org/openvpp/jvpp/notification/*.java \
62 jvpp/gen/target/org/openvpp/jvpp/callfacade/*.java \
63 jvpp/gen/target/org/openvpp/jvpp/future/*.java \
64 jvpp/gen/target/org/openvpp/jvpp/test/*.java \
65 || (echo "JVpp compilation failed: $$?"; exit 1); \
66 $(JAVAH) -classpath . -d jvpp org.openvpp.jvpp.VppJNIConnection ; \
67 $(JAVAH) -classpath . -d jvpp org.openvpp.jvpp.JVppImpl ;
69 $(jarfile_jvpp): libjvpp.la
70 cd .libs ; $(JAR) cf $(JARFLAGS) ../$@ libjvpp.so.0.0.0 ../$(packagedir_jvpp)/* ; cd ..;
72 all-local: $(jarfile_jvpp)