blob: aea5c0abfa9b8048f33968f3c60284646e43502e [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
Marek Gradzkid85036f2016-04-26 12:09:05 +020050
Marek Gradzki66ea26b2016-07-26 15:28:22 +020051jarfile_jvpp_registry = jvpp-registry-$(PACKAGE_VERSION).jar
52packagedir_jvpp_registry = org/openvpp/jvpp
Marek Gradzkid85036f2016-04-26 12:09:05 +020053
Marek Gradzki66ea26b2016-07-26 15:28:22 +020054BUILT_SOURCES += jvpp-registry/org_openvpp_jvpp_VppJNIConnection.h
55
56
57jvpp-registry/org_openvpp_jvpp_VppJNIConnection.h:
58 @echo " jvpp-registry.jar generation "; \
59 mkdir -p jvpp-registry/target; \
60 cp -rf @srcdir@/jvpp-registry/* -t jvpp-registry/;
61 $(JAVAC) -d jvpp-registry/target jvpp-registry/$(packagedir_jvpp_registry)/*.java \
62 jvpp-registry/$(packagedir_jvpp_registry)/dto/*.java \
63 jvpp-registry/$(packagedir_jvpp_registry)/callback/*.java \
64 jvpp-registry/$(packagedir_jvpp_registry)/notification/*.java \
65 jvpp-registry/$(packagedir_jvpp_registry)/future/*.java \
66 jvpp-registry/$(packagedir_jvpp_registry)/test/*.java \
67 || (echo "jvpp-registry compilation failed: $$?"; exit 1); \
68 $(JAVAH) -classpath jvpp-registry/target -d jvpp-registry org.openvpp.jvpp.VppJNIConnection ;
69 $(JAVAH) -classpath jvpp-registry/target -d jvpp-registry org.openvpp.jvpp.JVppRegistryImpl ;
70
71$(jarfile_jvpp_registry): libjvpp_registry.la
72 cp .libs/libjvpp_registry.so.0.0.0 jvpp-registry/target; \
73 $(JAR) cf $(JARFLAGS) $@ -C jvpp-registry/target .;
74
75#
76# jvpp-core (Java wrapper for vpe.api)
77#
78lib_LTLIBRARIES += libjvpp_core.la
79
80libjvpp_core_la_SOURCES = jvpp-core/jvpp_core.c jvpp-core/jvpp_core_gen.h
81libjvpp_core_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra \
82 -lpthread -lm -lrt -ljvpp_common
83libjvpp_core_la_LDFLAGS = -module
84libjvpp_core_la_CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
85
86jarfile_jvpp_core = jvpp-core-$(PACKAGE_VERSION).jar
87packagedir_jvpp_core = org/openvpp/jvpp/core
88api_file = $(prefix)/../vpp/vpp-api/vpe.api
89
90BUILT_SOURCES += jvpp-core/org_openvpp_jvpp_core_JVppCoreImpl.h
91
92
93defs_vpp_papi.py:
94 @echo "jVpp API"; \
95 vppapigen --input $(api_file) --python jvpp-core/defs_vpp_papi.py;
96
97jvpp-core/org_openvpp_jvpp_core_JVppCoreImpl.h: defs_vpp_papi.py
98 cp -rf @srcdir@/jvpp-core/* -t jvpp-core/; \
99 mkdir -p jvpp-core/target; \
100 cd jvpp-core; \
101 mkdir dto future callfacade callback notification; \
102 @srcdir@/jvpp/gen/jvpp_gen.py -i defs_vpp_papi.py --plugin_name core; \
103 cp -rf dto future callfacade callback notification *.java -t $(packagedir_jvpp_core); \
104 rm -rf dto future callfacade callback notification *.java; \
105 cd ..; \
106 $(JAVAC) -classpath jvpp-registry/target -d jvpp-core/target jvpp-core/$(packagedir_jvpp_core)/*.java \
107 jvpp-core/$(packagedir_jvpp_core)/dto/*.java \
108 jvpp-core/$(packagedir_jvpp_core)/callback/*.java \
109 jvpp-core/$(packagedir_jvpp_core)/notification/*.java \
110 jvpp-core/$(packagedir_jvpp_core)/future/*.java \
111 jvpp-core/$(packagedir_jvpp_core)/callfacade/*.java \
112 jvpp-core/$(packagedir_jvpp_core)/test/*.java \
113 || (echo "jvpp-core compilation failed: $$?"; exit 1); \
114 $(JAVAH) -classpath jvpp-registry/target:jvpp-core/target -d jvpp-core org.openvpp.jvpp.core.JVppCoreImpl ;
115
116$(jarfile_jvpp_core): libjvpp_core.la
117 cp .libs/libjvpp_core.so.0.0.0 jvpp-core/target; \
118 $(JAR) cf $(JARFLAGS) $@ -C jvpp-core/target .;
119
120all-local: $(jarfile_jvpp_registry) $(jarfile_jvpp_core)