blob: 7b674fc68c94d7ca579b593a35c216f0d72b5f51 [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
Marek Gradzkid85036f2016-04-26 12:09:05 +020024#
Marek Gradzki66ea26b2016-07-26 15:28:22 +020025# jvpp-common
Marek Gradzkid85036f2016-04-26 12:09:05 +020026#
27
Marek Gradzki948b95a2016-07-20 14:53:48 +020028nobase_include_HEADERS = \
Marek Gradzki66ea26b2016-07-26 15:28:22 +020029 jvpp-common/jvpp_common.h
Marek Gradzkid85036f2016-04-26 12:09:05 +020030
Marek Gradzki66ea26b2016-07-26 15:28:22 +020031lib_LTLIBRARIES += libjvpp_common.la
Marek Gradzkid85036f2016-04-26 12:09:05 +020032
Marek Gradzki66ea26b2016-07-26 15:28:22 +020033libjvpp_common_la_SOURCES = jvpp-common/jvpp_common.c
34libjvpp_common_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra \
Marek Gradzkid85036f2016-04-26 12:09:05 +020035 -lpthread -lm -lrt
Marek Gradzki66ea26b2016-07-26 15:28:22 +020036libjvpp_common_la_LDFLAGS = -module
37libjvpp_common_la_CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
Marek Gradzkid85036f2016-04-26 12:09:05 +020038
Marek Gradzkid85036f2016-04-26 12:09:05 +020039
Marek Gradzki66ea26b2016-07-26 15:28:22 +020040#
41# jvpp-registry (connection management + plugin registry)
42#
43lib_LTLIBRARIES += libjvpp_registry.la
Marek Gradzkid85036f2016-04-26 12:09:05 +020044
Marek Gradzki66ea26b2016-07-26 15:28:22 +020045libjvpp_registry_la_SOURCES = jvpp-registry/jvpp_registry.c
46libjvpp_registry_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra \
47 -lpthread -lm -lrt -ljvpp_common
48libjvpp_registry_la_LDFLAGS = -module
49libjvpp_registry_la_CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
Ed Warnicke0c25d1f2016-08-17 11:53:08 -070050EXTRA_libjvpp_registry_la_DEPENDENCIES=libjvpp_common.la
Marek Gradzkid85036f2016-04-26 12:09:05 +020051
Marek Gradzki66ea26b2016-07-26 15:28:22 +020052jarfile_jvpp_registry = jvpp-registry-$(PACKAGE_VERSION).jar
53packagedir_jvpp_registry = org/openvpp/jvpp
Marek Gradzkid85036f2016-04-26 12:09:05 +020054
Marek Gradzki66ea26b2016-07-26 15:28:22 +020055BUILT_SOURCES += jvpp-registry/org_openvpp_jvpp_VppJNIConnection.h
56
57
58jvpp-registry/org_openvpp_jvpp_VppJNIConnection.h:
59 @echo " jvpp-registry.jar generation "; \
60 mkdir -p jvpp-registry/target; \
61 cp -rf @srcdir@/jvpp-registry/* -t jvpp-registry/;
62 $(JAVAC) -d jvpp-registry/target jvpp-registry/$(packagedir_jvpp_registry)/*.java \
63 jvpp-registry/$(packagedir_jvpp_registry)/dto/*.java \
64 jvpp-registry/$(packagedir_jvpp_registry)/callback/*.java \
65 jvpp-registry/$(packagedir_jvpp_registry)/notification/*.java \
66 jvpp-registry/$(packagedir_jvpp_registry)/future/*.java \
67 jvpp-registry/$(packagedir_jvpp_registry)/test/*.java \
68 || (echo "jvpp-registry compilation failed: $$?"; exit 1); \
69 $(JAVAH) -classpath jvpp-registry/target -d jvpp-registry org.openvpp.jvpp.VppJNIConnection ;
70 $(JAVAH) -classpath jvpp-registry/target -d jvpp-registry org.openvpp.jvpp.JVppRegistryImpl ;
71
72$(jarfile_jvpp_registry): libjvpp_registry.la
73 cp .libs/libjvpp_registry.so.0.0.0 jvpp-registry/target; \
74 $(JAR) cf $(JARFLAGS) $@ -C jvpp-registry/target .;
75
76#
77# jvpp-core (Java wrapper for vpe.api)
78#
79lib_LTLIBRARIES += libjvpp_core.la
80
81libjvpp_core_la_SOURCES = jvpp-core/jvpp_core.c jvpp-core/jvpp_core_gen.h
82libjvpp_core_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra \
83 -lpthread -lm -lrt -ljvpp_common
84libjvpp_core_la_LDFLAGS = -module
85libjvpp_core_la_CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
Ed Warnicke0c25d1f2016-08-17 11:53:08 -070086EXTRA_libjvpp_core_la_DEPENDENCIES=libjvpp_common.la
Marek Gradzki66ea26b2016-07-26 15:28:22 +020087
88jarfile_jvpp_core = jvpp-core-$(PACKAGE_VERSION).jar
89packagedir_jvpp_core = org/openvpp/jvpp/core
90api_file = $(prefix)/../vpp/vpp-api/vpe.api
91
92BUILT_SOURCES += jvpp-core/org_openvpp_jvpp_core_JVppCoreImpl.h
93
94
95defs_vpp_papi.py:
96 @echo "jVpp API"; \
97 vppapigen --input $(api_file) --python jvpp-core/defs_vpp_papi.py;
98
99jvpp-core/org_openvpp_jvpp_core_JVppCoreImpl.h: defs_vpp_papi.py
100 cp -rf @srcdir@/jvpp-core/* -t jvpp-core/; \
101 mkdir -p jvpp-core/target; \
102 cd jvpp-core; \
103 mkdir dto future callfacade callback notification; \
104 @srcdir@/jvpp/gen/jvpp_gen.py -i defs_vpp_papi.py --plugin_name core; \
105 cp -rf dto future callfacade callback notification *.java -t $(packagedir_jvpp_core); \
106 rm -rf dto future callfacade callback notification *.java; \
107 cd ..; \
108 $(JAVAC) -classpath jvpp-registry/target -d jvpp-core/target jvpp-core/$(packagedir_jvpp_core)/*.java \
109 jvpp-core/$(packagedir_jvpp_core)/dto/*.java \
110 jvpp-core/$(packagedir_jvpp_core)/callback/*.java \
111 jvpp-core/$(packagedir_jvpp_core)/notification/*.java \
112 jvpp-core/$(packagedir_jvpp_core)/future/*.java \
113 jvpp-core/$(packagedir_jvpp_core)/callfacade/*.java \
114 jvpp-core/$(packagedir_jvpp_core)/test/*.java \
115 || (echo "jvpp-core compilation failed: $$?"; exit 1); \
116 $(JAVAH) -classpath jvpp-registry/target:jvpp-core/target -d jvpp-core org.openvpp.jvpp.core.JVppCoreImpl ;
117
118$(jarfile_jvpp_core): libjvpp_core.la
119 cp .libs/libjvpp_core.so.0.0.0 jvpp-core/target; \
120 $(JAR) cf $(JARFLAGS) $@ -C jvpp-core/target .;
121
122all-local: $(jarfile_jvpp_registry) $(jarfile_jvpp_core)