blob: c501ace948e394d5dd0f1109fcd396949fd6c180 [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001# 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:
5#
6# http://www.apache.org/licenses/LICENSE-2.0
7#
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.
13
14AUTOMAKE_OPTIONS = foreign subdir-objects
15ACLOCAL_AMFLAGS = -I m4
16AM_CFLAGS = -Wall
17
18noinst_PROGRAMS =
19BUILT_SOURCES =
20bin_PROGRAMS =
21CLEANFILES =
22lib_LTLIBRARIES =
23
24nobase_include_HEADERS = \
25 japi/org_openvpp_vppjapi_vppApi.h \
26 japi/org_openvpp_vppjapi_vppConn.h
27
28lib_LTLIBRARIES += libvppjni.la
29
30libvppjni_la_SOURCES = japi/vppjni.c japi/vppapi.c
31libvppjni_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra \
32 -lpthread -lm -lrt
33libvppjni_la_LDFLAGS = -module
34
35jarfile = vppjapi-$(PACKAGE_VERSION).jar
36packagedir = org/openvpp/vppjapi
37JAVAROOT = .
38
39$(jarfile): libvppjni.la
40 cd .libs ; $(JAR) cf $(JARFLAGS) ../$@ libvppjni.so.0.0.0 ../$(packagedir)/*.class ; cd ..
41
42BUILT_SOURCES += japi/org_openvpp_vppjapi_vppConn.h japi/vppapi.c
43
44japi/org_openvpp_vppjapi_vppConn.h: \
45 japi/org/openvpp/vppjapi/vppVersion.java \
46 japi/org/openvpp/vppjapi/vppInterfaceCounters.java \
47 japi/org/openvpp/vppjapi/vppBridgeDomainDetails.java \
48 japi/org/openvpp/vppjapi/vppBridgeDomainInterfaceDetails.java \
49 japi/org/openvpp/vppjapi/vppL2Fib.java \
50 japi/org/openvpp/vppjapi/vppConn.java \
51 ../vpp/api/vpe.api.h
52 $(JAVAC) -classpath . -d . @srcdir@/japi/org/openvpp/vppjapi/vppVersion.java ;\
53 $(JAVAH) -classpath . -d japi org.openvpp.vppjapi.vppVersion ; \
54 $(JAVAC) -classpath . -d . @srcdir@/japi/org/openvpp/vppjapi/vppInterfaceCounters.java ;\
55 $(JAVAH) -classpath . -d japi org.openvpp.vppjapi.vppInterfaceCounters ; \
56 $(JAVAC) -classpath . -d . @srcdir@/japi/org/openvpp/vppjapi/vppBridgeDomainInterfaceDetails.java ;\
57 $(JAVAH) -classpath . -d japi org.openvpp.vppjapi.vppBridgeDomainInterfaceDetails ; \
58 $(JAVAC) -classpath . -d . @srcdir@/japi/org/openvpp/vppjapi/vppBridgeDomainDetails.java ;\
59 $(JAVAH) -classpath . -d japi org.openvpp.vppjapi.vppBridgeDomainDetails ; \
60 $(JAVAC) -classpath . -d . @srcdir@/japi/org/openvpp/vppjapi/vppL2Fib.java ;\
61 $(JAVAH) -classpath . -d japi org.openvpp.vppjapi.vppL2Fib ; \
62 $(JAVAC) -classpath . -d . @srcdir@/japi/org/openvpp/vppjapi/vppConn.java ; \
63 $(JAVAH) -classpath . -d japi org.openvpp.vppjapi.vppConn ;
64
65japi/vppapi.c: japi/org_openvpp_vppjapi_vppConn.h japi/org/openvpp/vppjapi/vppApiCallbacks.java
66 pushd .. ; dir=`pwd` ; popd ; \
67 instdir=`echo $${dir} | sed -e 's:build-root/build:build-root/install:'` ; \
68 vppapigen --input $${instdir}/vpp/api/vpe.api --jni japi/vppapi.c --app vpe ; \
69 vppapigen --input $${instdir}/vpp/api/vpe.api --java japi/vppApi.java --app vpe ; \
70 $(JAVAC) -classpath . -d . japi/vppApi.java ; \
71 $(JAVAH) -classpath . -d japi org.openvpp.vppjapi.vppApi ; \
72 $(JAVAC) -classpath . -d . @srcdir@/japi/org/openvpp/vppjapi/vppApiCallbacks.java ; \
73 $(JAVAH) -classpath . -d japi org.openvpp.vppjapi.vppApiCallbacks ;
74
75demo = japi/test/demo.class
76$(demo): $(jarfile)
77 $(JAVAC) -cp $(jarfile) -d $(JAVAROOT) @srcdir@/japi/test/demo.java
78
79all-local: $(jarfile) $(demo)