blob: d1ed33d170dc6542637c8d3c36f4eeea88cc1b31 [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 \
94 $(prefix)/../vnet/vnet/vxlan.api.json
Klement Sekera1a939e82016-10-19 12:31:25 +020095 cp -rf @srcdir@/jvpp-core/* -t jvpp-core/
96 mkdir -p jvpp-core/target
97 cd jvpp-core \
Marek Gradzki81c7dfc2016-09-29 13:22:35 +020098 && mkdir -p types dto future callfacade callback notification \
Marek Gradzki2fee4c82016-11-25 08:38:29 +010099 && @srcdir@/jvpp/gen/jvpp_gen.py --plugin_name core \
Ole Troanf14e3bf2016-12-01 21:49:03 +0100100 -i $(prefix)/../vpp/vpp-api/vpe.api.json \
Pavel Kotucekbbe33622016-12-20 13:19:48 +0100101 $(prefix)/../vnet/vnet/af_packet.api.json \
Pavel Kotucek8b2b7942016-12-20 14:05:46 +0100102 $(prefix)/../vnet/vnet/netmap.api.json \
Pavel Kotucekf07dc9e2016-12-20 12:17:37 +0100103 $(prefix)/../vnet/vnet/vhost_user.api.json \
Ole Troanf14e3bf2016-12-01 21:49:03 +0100104 $(prefix)/../vnet/vnet/interface.api.json \
Marek Gradzki6dcda022016-12-05 13:36:01 +0100105 $(prefix)/../vnet/vnet/l2.api.json \
Ole Troanf0c90e22016-12-06 12:50:08 +0100106 $(prefix)/../vnet/vnet/map.api.json \
Dave Barachb5e8a772016-12-06 12:04:42 -0500107 $(prefix)/../vnet/vnet/ip.api.json \
Jan Srnicek32575802016-12-07 07:36:37 +0100108 $(prefix)/../vnet/vnet/span.api.json \
Dave Barach496e1272016-12-07 09:15:58 -0500109 $(prefix)/../vnet/vnet/tap.api.json \
Pavel Kotucekadb13d62016-12-19 14:35:35 +0100110 $(prefix)/../vnet/vnet/vxlan.api.json \
Marek Gradzki81c7dfc2016-09-29 13:22:35 +0200111 && cp -rf types dto future callfacade callback notification *.java -t $(packagedir_jvpp_core) \
112 && rm -rf types dto future callfacade callback notification *.java
113
Marek Gradzki66ea26b2016-07-26 15:28:22 +0200114 $(JAVAC) -classpath jvpp-registry/target -d jvpp-core/target jvpp-core/$(packagedir_jvpp_core)/*.java \
Marek Gradzki81c7dfc2016-09-29 13:22:35 +0200115 jvpp-core/$(packagedir_jvpp_core)/types/*.java \
Marek Gradzki66ea26b2016-07-26 15:28:22 +0200116 jvpp-core/$(packagedir_jvpp_core)/dto/*.java \
117 jvpp-core/$(packagedir_jvpp_core)/callback/*.java \
118 jvpp-core/$(packagedir_jvpp_core)/notification/*.java \
119 jvpp-core/$(packagedir_jvpp_core)/future/*.java \
120 jvpp-core/$(packagedir_jvpp_core)/callfacade/*.java \
Marek Gradzki2fee4c82016-11-25 08:38:29 +0100121 jvpp-core/$(packagedir_jvpp_core)/test/*.java \
Klement Sekera1a939e82016-10-19 12:31:25 +0200122 || (echo "jvpp-core compilation failed: $$?"; exit 1)
123 $(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 -0400124
Marek Gradzki66ea26b2016-07-26 15:28:22 +0200125$(jarfile_jvpp_core): libjvpp_core.la
Klement Sekera1a939e82016-10-19 12:31:25 +0200126 cp .libs/libjvpp_core.so.0.0.0 jvpp-core/target
127 $(JAR) cf $(JARFLAGS) $@ -C jvpp-core/target .
Marek Gradzki66ea26b2016-07-26 15:28:22 +0200128
129all-local: $(jarfile_jvpp_registry) $(jarfile_jvpp_core)