blob: 1d8cf4b3f5f91cb0e34c8f58bca53e9e00ee556c [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
Klement Sekera1a939e82016-10-19 12:31:25 +020049libjvpp_registry_la_CPPFLAGS = -Ijvpp-registry -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
Marek Gradzkie85581c2016-09-28 10:12:04 +020052packagedir_jvpp_registry = io/fd/vpp/jvpp
Marek Gradzkid85036f2016-04-26 12:09:05 +020053
Marek Gradzkie85581c2016-09-28 10:12:04 +020054BUILT_SOURCES += jvpp-registry/io_fd_vpp_jvpp_VppJNIConnection.h
Marek Gradzki66ea26b2016-07-26 15:28:22 +020055
Klement Sekera1a939e82016-10-19 12:31:25 +020056jvpp_registry_src_files := $(wildcard @srcdir@/jvpp-registry/$(packagedir_jvpp_registry)/*.java) $(wildcard @srcdir@/jvpp-registry/$(packagedir_jvpp_registry)/**/*.java)
Marek Gradzki66ea26b2016-07-26 15:28:22 +020057
Klement Sekera1a939e82016-10-19 12:31:25 +020058jvpp-registry/io_fd_vpp_jvpp_VppJNIConnection.h: $(jvpp_registry_src_files)
59 @echo " jvpp-registry.jar generation"
60 mkdir -p jvpp-registry/target
61 $(JAVAC) -d jvpp-registry/target $(jvpp_registry_src_files)
62 $(JAVAH) -force -classpath jvpp-registry/target -d jvpp-registry io.fd.vpp.jvpp.VppJNIConnection
63 $(JAVAH) -force -classpath jvpp-registry/target -d jvpp-registry io.fd.vpp.jvpp.JVppRegistryImpl
Marek Gradzki66ea26b2016-07-26 15:28:22 +020064
65$(jarfile_jvpp_registry): libjvpp_registry.la
66 cp .libs/libjvpp_registry.so.0.0.0 jvpp-registry/target; \
67 $(JAR) cf $(JARFLAGS) $@ -C jvpp-registry/target .;
68
69#
70# jvpp-core (Java wrapper for vpe.api)
71#
72lib_LTLIBRARIES += libjvpp_core.la
73
74libjvpp_core_la_SOURCES = jvpp-core/jvpp_core.c jvpp-core/jvpp_core_gen.h
75libjvpp_core_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra \
76 -lpthread -lm -lrt -ljvpp_common
77libjvpp_core_la_LDFLAGS = -module
78libjvpp_core_la_CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
79
80jarfile_jvpp_core = jvpp-core-$(PACKAGE_VERSION).jar
Marek Gradzkie85581c2016-09-28 10:12:04 +020081packagedir_jvpp_core = io/fd/vpp/jvpp/core
Marek Gradzki66ea26b2016-07-26 15:28:22 +020082api_file = $(prefix)/../vpp/vpp-api/vpe.api
83
Marek Gradzkie85581c2016-09-28 10:12:04 +020084BUILT_SOURCES += jvpp-core/io_fd_vpp_jvpp_core_JVppCoreImpl.h
Marek Gradzki66ea26b2016-07-26 15:28:22 +020085
Klement Sekera1a939e82016-10-19 12:31:25 +020086jvpp-core/defs_vpp_papi.py: $(api_file)
87 @echo "jVpp API"
88 vppapigen --input $(api_file) --python jvpp-core/defs_vpp_papi.py
Marek Gradzki66ea26b2016-07-26 15:28:22 +020089
Klement Sekera1a939e82016-10-19 12:31:25 +020090jvpp-core/io_fd_vpp_jvpp_core_JVppCoreImpl.h: jvpp-registry/io_fd_vpp_jvpp_VppJNIConnection.h jvpp-core/defs_vpp_papi.py
91 cp -rf @srcdir@/jvpp-core/* -t jvpp-core/
92 mkdir -p jvpp-core/target
93 cd jvpp-core \
94 && mkdir -p dto future callfacade callback notification \
95 && @srcdir@/jvpp/gen/jvpp_gen.py -i defs_vpp_papi.py --plugin_name core \
96 && cp -rf dto future callfacade callback notification *.java -t $(packagedir_jvpp_core) \
97 && rm -rf dto future callfacade callback notification *.java
Marek Gradzki66ea26b2016-07-26 15:28:22 +020098 $(JAVAC) -classpath jvpp-registry/target -d jvpp-core/target jvpp-core/$(packagedir_jvpp_core)/*.java \
99 jvpp-core/$(packagedir_jvpp_core)/dto/*.java \
100 jvpp-core/$(packagedir_jvpp_core)/callback/*.java \
101 jvpp-core/$(packagedir_jvpp_core)/notification/*.java \
102 jvpp-core/$(packagedir_jvpp_core)/future/*.java \
103 jvpp-core/$(packagedir_jvpp_core)/callfacade/*.java \
104 jvpp-core/$(packagedir_jvpp_core)/test/*.java \
Klement Sekera1a939e82016-10-19 12:31:25 +0200105 || (echo "jvpp-core compilation failed: $$?"; exit 1)
106 $(JAVAH) -force -classpath jvpp-registry/target:jvpp-core/target -d jvpp-core io.fd.vpp.jvpp.core.JVppCoreImpl
Marek Gradzki66ea26b2016-07-26 15:28:22 +0200107
108$(jarfile_jvpp_core): libjvpp_core.la
Klement Sekera1a939e82016-10-19 12:31:25 +0200109 cp .libs/libjvpp_core.so.0.0.0 jvpp-core/target
110 $(JAR) cf $(JARFLAGS) $@ -C jvpp-core/target .
Marek Gradzki66ea26b2016-07-26 15:28:22 +0200111
112all-local: $(jarfile_jvpp_registry) $(jarfile_jvpp_core)