blob: 1d0a675853606337d01abb5a08b1f37809046b12 [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
Marek Gradzki2fee4c82016-11-25 08:38:29 +010016AM_CFLAGS = -Wall
Ed Warnickecb9cada2015-12-08 15:45:58 -070017
Marek Gradzki2fee4c82016-11-25 08:38:29 +010018noinst_PROGRAMS =
Ed Warnickecb9cada2015-12-08 15:45:58 -070019BUILT_SOURCES =
Marek Gradzki2fee4c82016-11-25 08:38:29 +010020bin_PROGRAMS =
21CLEANFILES =
22lib_LTLIBRARIES =
Ed Warnickecb9cada2015-12-08 15:45:58 -070023
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
Ed Warnicke14fbdfc2016-10-20 16:47:54 +000050EXTRA_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
Marek Gradzkie85581c2016-09-28 10:12:04 +020053packagedir_jvpp_registry = io/fd/vpp/jvpp
Marek Gradzkid85036f2016-04-26 12:09:05 +020054
Marek Gradzkie85581c2016-09-28 10:12:04 +020055BUILT_SOURCES += jvpp-registry/io_fd_vpp_jvpp_VppJNIConnection.h
Marek Gradzki66ea26b2016-07-26 15:28:22 +020056
Klement Sekera1a939e82016-10-19 12:31:25 +020057jvpp_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 +020058
Klement Sekera1a939e82016-10-19 12:31:25 +020059jvpp-registry/io_fd_vpp_jvpp_VppJNIConnection.h: $(jvpp_registry_src_files)
60 @echo " jvpp-registry.jar generation"
61 mkdir -p jvpp-registry/target
62 $(JAVAC) -d jvpp-registry/target $(jvpp_registry_src_files)
63 $(JAVAH) -force -classpath jvpp-registry/target -d jvpp-registry io.fd.vpp.jvpp.VppJNIConnection
64 $(JAVAH) -force -classpath jvpp-registry/target -d jvpp-registry io.fd.vpp.jvpp.JVppRegistryImpl
Marek Gradzki66ea26b2016-07-26 15:28:22 +020065
66$(jarfile_jvpp_registry): libjvpp_registry.la
67 cp .libs/libjvpp_registry.so.0.0.0 jvpp-registry/target; \
68 $(JAR) cf $(JARFLAGS) $@ -C jvpp-registry/target .;
69
70#
71# jvpp-core (Java wrapper for vpe.api)
72#
73lib_LTLIBRARIES += libjvpp_core.la
74
75libjvpp_core_la_SOURCES = jvpp-core/jvpp_core.c jvpp-core/jvpp_core_gen.h
76libjvpp_core_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra \
77 -lpthread -lm -lrt -ljvpp_common
78libjvpp_core_la_LDFLAGS = -module
79libjvpp_core_la_CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
80
81jarfile_jvpp_core = jvpp-core-$(PACKAGE_VERSION).jar
Marek Gradzkie85581c2016-09-28 10:12:04 +020082packagedir_jvpp_core = io/fd/vpp/jvpp/core
Marek Gradzki66ea26b2016-07-26 15:28:22 +020083
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
Dave Barach496e1272016-12-07 09:15:58 -050086jvpp-core/io_fd_vpp_jvpp_core_JVppCoreImpl.h: \
87 jvpp-registry/io_fd_vpp_jvpp_VppJNIConnection.h \
Pavel Kotucekbbe33622016-12-20 13:19:48 +010088 $(prefix)/../vnet/vnet/af_packet.api.json \
Pavel Kotucek8b2b7942016-12-20 14:05:46 +010089 $(prefix)/../vnet/vnet/netmap.api.json \
Pavel Kotucekf07dc9e2016-12-20 12:17:37 +010090 $(prefix)/../vnet/vnet/vhost_user.api.json \
Dave Barach496e1272016-12-07 09:15:58 -050091 $(prefix)/../vpp/vpp-api/vpe.api.json \
92 $(prefix)/../vnet/vnet/ip.api.json \
Pavel Kotucekadb13d62016-12-19 14:35:35 +010093 $(prefix)/../vnet/vnet/tap.api.json \
Pavel Kotucek296b2012016-12-19 14:47:09 +010094 $(prefix)/../vnet/vnet/vxlan.api.json \
95 $(prefix)/../vnet/vnet/vxlan_gpe.api.json
Klement Sekera1a939e82016-10-19 12:31:25 +020096 cp -rf @srcdir@/jvpp-core/* -t jvpp-core/
97 mkdir -p jvpp-core/target
98 cd jvpp-core \
Marek Gradzki81c7dfc2016-09-29 13:22:35 +020099 && mkdir -p types dto future callfacade callback notification \
Marek Gradzki2fee4c82016-11-25 08:38:29 +0100100 && @srcdir@/jvpp/gen/jvpp_gen.py --plugin_name core \
Ole Troanf14e3bf2016-12-01 21:49:03 +0100101 -i $(prefix)/../vpp/vpp-api/vpe.api.json \
Pavel Kotucekbbe33622016-12-20 13:19:48 +0100102 $(prefix)/../vnet/vnet/af_packet.api.json \
Pavel Kotucek8b2b7942016-12-20 14:05:46 +0100103 $(prefix)/../vnet/vnet/netmap.api.json \
Pavel Kotucekf07dc9e2016-12-20 12:17:37 +0100104 $(prefix)/../vnet/vnet/vhost_user.api.json \
Ole Troanf14e3bf2016-12-01 21:49:03 +0100105 $(prefix)/../vnet/vnet/interface.api.json \
Marek Gradzki6dcda022016-12-05 13:36:01 +0100106 $(prefix)/../vnet/vnet/l2.api.json \
Ole Troanf0c90e22016-12-06 12:50:08 +0100107 $(prefix)/../vnet/vnet/map.api.json \
Dave Barachb5e8a772016-12-06 12:04:42 -0500108 $(prefix)/../vnet/vnet/ip.api.json \
Jan Srnicek32575802016-12-07 07:36:37 +0100109 $(prefix)/../vnet/vnet/span.api.json \
Dave Barach496e1272016-12-07 09:15:58 -0500110 $(prefix)/../vnet/vnet/tap.api.json \
Pavel Kotucekadb13d62016-12-19 14:35:35 +0100111 $(prefix)/../vnet/vnet/vxlan.api.json \
Pavel Kotucek296b2012016-12-19 14:47:09 +0100112 $(prefix)/../vnet/vnet/vxlan_gpe.api.json \
Marek Gradzki81c7dfc2016-09-29 13:22:35 +0200113 && cp -rf types dto future callfacade callback notification *.java -t $(packagedir_jvpp_core) \
114 && rm -rf types dto future callfacade callback notification *.java
115
Marek Gradzki66ea26b2016-07-26 15:28:22 +0200116 $(JAVAC) -classpath jvpp-registry/target -d jvpp-core/target jvpp-core/$(packagedir_jvpp_core)/*.java \
Marek Gradzki81c7dfc2016-09-29 13:22:35 +0200117 jvpp-core/$(packagedir_jvpp_core)/types/*.java \
Marek Gradzki66ea26b2016-07-26 15:28:22 +0200118 jvpp-core/$(packagedir_jvpp_core)/dto/*.java \
119 jvpp-core/$(packagedir_jvpp_core)/callback/*.java \
120 jvpp-core/$(packagedir_jvpp_core)/notification/*.java \
121 jvpp-core/$(packagedir_jvpp_core)/future/*.java \
122 jvpp-core/$(packagedir_jvpp_core)/callfacade/*.java \
Marek Gradzki2fee4c82016-11-25 08:38:29 +0100123 jvpp-core/$(packagedir_jvpp_core)/test/*.java \
Klement Sekera1a939e82016-10-19 12:31:25 +0200124 || (echo "jvpp-core compilation failed: $$?"; exit 1)
125 $(JAVAH) -force -classpath jvpp-registry/target:jvpp-core/target -d jvpp-core io.fd.vpp.jvpp.core.JVppCoreImpl
Dave Barachaff70772016-10-31 11:59:07 -0400126
Marek Gradzki66ea26b2016-07-26 15:28:22 +0200127$(jarfile_jvpp_core): libjvpp_core.la
Klement Sekera1a939e82016-10-19 12:31:25 +0200128 cp .libs/libjvpp_core.so.0.0.0 jvpp-core/target
129 $(JAR) cf $(JARFLAGS) $@ -C jvpp-core/target .
Marek Gradzki66ea26b2016-07-26 15:28:22 +0200130
131all-local: $(jarfile_jvpp_registry) $(jarfile_jvpp_core)