Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 1 | # Copyright (c) 2016 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 | |
Damjan Marion | cc4a5e8 | 2018-07-30 16:10:14 +0200 | [diff] [blame] | 14 | AUTOMAKE_OPTIONS = foreign subdir-objects |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 15 | ACLOCAL_AMFLAGS = -I m4 |
Damjan Marion | 724f64c | 2017-01-11 11:11:00 +0100 | [diff] [blame] | 16 | AM_LIBTOOLFLAGS = --quiet |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 17 | |
Damjan Marion | 5f21e1b | 2018-08-01 14:38:36 +0200 | [diff] [blame] | 18 | AM_CFLAGS = @CPU_FLAGS@ -Wall -I${top_srcdir} -I${top_builddir} \ |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 19 | -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux \ |
| 20 | -I@top_srcdir@/plugins -I@top_builddir@/plugins |
| 21 | |
Marek Gradzki | cb365d8 | 2017-01-16 14:00:56 +0100 | [diff] [blame] | 22 | AM_LDFLAGS = -shared -avoid-version -rpath /none -no-undefined |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 23 | |
| 24 | BUILT_SOURCES = |
| 25 | bin_PROGRAMS = |
| 26 | noinst_LTLIBRARIES = |
| 27 | JAR_FILES = |
| 28 | CLEANDIRS = |
| 29 | |
| 30 | # |
| 31 | # jvpp-common |
| 32 | # |
| 33 | |
Damjan Marion | 71f8742 | 2017-01-03 11:17:19 +0100 | [diff] [blame] | 34 | nobase_include_HEADERS = \ |
| 35 | jvpp-common/jvpp_common.h |
| 36 | |
Marek Gradzki | 3f14e23 | 2017-01-12 09:16:23 +0100 | [diff] [blame] | 37 | lib_LTLIBRARIES = libjvpp_common.la |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 38 | libjvpp_common_la_SOURCES = jvpp-common/jvpp_common.c |
Damjan Marion | cc4a5e8 | 2018-07-30 16:10:14 +0200 | [diff] [blame] | 39 | libjvpp_common_la_LDFLAGS = shared -rpath /none -no-undefined -lvppinfra |
Marek Gradzki | ea4fa75 | 2017-01-10 19:58:43 +0100 | [diff] [blame] | 40 | |
| 41 | JVPP_LIBS = \ |
| 42 | libjvpp_common.la \ |
Damjan Marion | cc4a5e8 | 2018-07-30 16:10:14 +0200 | [diff] [blame] | 43 | -lvppinfra -lvlibmemoryclient -lsvm -lpthread -lm -lrt |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 44 | |
| 45 | # |
| 46 | # jvpp-registry (connection management + plugin registry) |
| 47 | # |
| 48 | |
| 49 | noinst_LTLIBRARIES += libjvpp_registry.la |
| 50 | |
| 51 | libjvpp_registry_la_SOURCES = jvpp-registry/jvpp_registry.c |
| 52 | libjvpp_registry_la_CPPFLAGS = -Ijvpp-registry |
Marek Gradzki | ea4fa75 | 2017-01-10 19:58:43 +0100 | [diff] [blame] | 53 | libjvpp_registry_la_LIBADD = $(JVPP_LIBS) |
| 54 | libjvpp_registry_la_DEPENDENCIES = libjvpp_common.la |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 55 | |
| 56 | packagedir_jvpp_registry = io/fd/vpp/jvpp |
| 57 | jvpp_registry_src_files := \ |
| 58 | $(wildcard @srcdir@/jvpp-registry/$(packagedir_jvpp_registry)/*.java) \ |
| 59 | $(wildcard @srcdir@/jvpp-registry/$(packagedir_jvpp_registry)/**/*.java) |
| 60 | |
| 61 | BUILT_SOURCES += jvpp-registry/io_fd_vpp_jvpp_VppJNIConnection.h |
| 62 | CLEANDIRS += jvpp-registry/target |
| 63 | JAR_FILES += jvpp-registry-$(PACKAGE_VERSION).jar |
| 64 | |
| 65 | jvpp_registry_ok = jvpp-registry/io_fd_vpp_jvpp_VppJNIConnection.h |
| 66 | |
| 67 | jvpp-registry/io_fd_vpp_jvpp_VppJNIConnection.h: $(jvpp_registry_src_files) |
Marek Gradzki | 568cc60 | 2018-01-26 11:39:27 +0100 | [diff] [blame] | 68 | @echo " JVPP GEN $@" |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 69 | @rm -rf jvpp-registry/target |
| 70 | @mkdir -p jvpp-registry/target |
Marco Varlese | 6b8fcff | 2018-05-02 13:33:47 +0200 | [diff] [blame] | 71 | @$(JAVAC) -source 8 -target 8 -d jvpp-registry/target -h jvpp-registry $^ |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 72 | @touch jvpp-registry.ok |
| 73 | |
| 74 | define japigen |
Marek Gradzki | 568cc60 | 2018-01-26 11:39:27 +0100 | [diff] [blame] | 75 | @echo " JVPP GEN $@" |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 76 | @rm -rf jvpp-$(1)/target |
| 77 | @ @srcdir@/jvpp/gen/jvpp_gen.py --plugin_name $(1) --root_dir jvpp-$(1) \ |
Ole Troan | 9d42087 | 2017-10-12 13:06:35 +0200 | [diff] [blame] | 78 | -i $(jvpp_$(1)_json_files) |
Marek Gradzki | 94f8bc1 | 2017-01-10 16:43:53 +0100 | [diff] [blame] | 79 | @find jvpp-$(1)/target -name \*.java > jvpp-$(1).generated.files |
| 80 | @find @srcdir@/jvpp-$(1) -name \*.java > jvpp-$(1).static.files |
Marco Varlese | 6b8fcff | 2018-05-02 13:33:47 +0200 | [diff] [blame] | 81 | @$(JAVAC) -source 8 -target 8 -classpath jvpp-registry/target \ |
| 82 | -d jvpp-$(1)/target -h jvpp-$(1) @jvpp-$(1).generated.files @jvpp-$(1).static.files |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 83 | endef |
| 84 | |
| 85 | # |
| 86 | # jvpp-core (Java wrapper for vpe.api) |
| 87 | # |
| 88 | noinst_LTLIBRARIES += libjvpp_core.la |
| 89 | libjvpp_core_la_SOURCES = jvpp-core/jvpp_core.c jvpp-core/jvpp_core_gen.h |
| 90 | libjvpp_core_la_CPPFLAGS = -Ijvpp-registry -Ijvpp-core |
Marek Gradzki | ea4fa75 | 2017-01-10 19:58:43 +0100 | [diff] [blame] | 91 | libjvpp_core_la_LIBADD = $(JVPP_LIBS) |
| 92 | libjvpp_core_la_DEPENDENCIES = libjvpp_common.la |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 93 | |
Marek Gradzki | ea4fa75 | 2017-01-10 19:58:43 +0100 | [diff] [blame] | 94 | BUILT_SOURCES += jvpp-core/io_fd_vpp_jvpp_core_JVppCoreImpl.h |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 95 | JAR_FILES += jvpp-core-$(PACKAGE_VERSION).jar |
| 96 | CLEANDIRS += jvpp-core/target |
Marek Gradzki | 87a137c | 2017-12-08 15:26:55 +0100 | [diff] [blame] | 97 | |
| 98 | # Include all VPP API files |
Damjan Marion | cc4a5e8 | 2018-07-30 16:10:14 +0200 | [diff] [blame] | 99 | jvpp_core_json_files = $(shell find @top_builddir@/../vpp/vnet -type f -name '*.api.json') |
| 100 | jvpp_core_json_files += $(shell find @top_builddir@/../vpp/vpp -type f -name '*.api.json') |
Marek Gradzki | 87a137c | 2017-12-08 15:26:55 +0100 | [diff] [blame] | 101 | # except for plugins and unsupported ones: |
| 102 | # jvpp_core_json_files += @top_builddir@/vlibmemory/memclnt.api.json |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 103 | |
| 104 | jvpp-core/io_fd_vpp_jvpp_core_JVppCoreImpl.h: $(jvpp_registry_ok) $(jvpp_core_json_files) |
| 105 | $(call japigen,core,JVppCoreImpl) |
| 106 | |
| 107 | # |
| 108 | # ACL Plugin |
| 109 | # |
| 110 | if ENABLE_ACL_PLUGIN |
| 111 | noinst_LTLIBRARIES += libjvpp_acl.la |
| 112 | libjvpp_acl_la_SOURCES = jvpp-acl/jvpp_acl.c |
| 113 | libjvpp_acl_la_CPPFLAGS = -Ijvpp-acl |
Marek Gradzki | ea4fa75 | 2017-01-10 19:58:43 +0100 | [diff] [blame] | 114 | libjvpp_acl_la_LIBADD = $(JVPP_LIBS) |
| 115 | libjvpp_acl_la_DEPENDENCIES = libjvpp_common.la |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 116 | |
| 117 | BUILT_SOURCES += jvpp-acl/io_fd_vpp_jvpp_acl_JVppAclImpl.h |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 118 | JAR_FILES += jvpp-acl-$(PACKAGE_VERSION).jar |
| 119 | CLEANDIRS += jvpp-acl/target |
| 120 | |
Damjan Marion | cc4a5e8 | 2018-07-30 16:10:14 +0200 | [diff] [blame] | 121 | jvpp_acl_json_files = @top_builddir@/../vpp/plugins/acl/acl.api.json |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 122 | |
| 123 | jvpp-acl/io_fd_vpp_jvpp_acl_JVppAclImpl.h: $(jvpp_registry_ok) $(jvpp_acl_json_files) |
| 124 | $(call japigen,acl,JVppAclImpl) |
| 125 | endif |
| 126 | |
| 127 | # |
Hongjun Ni | ef486b1 | 2017-04-12 19:21:16 +0800 | [diff] [blame] | 128 | # GTPU Plugin |
| 129 | # |
| 130 | if ENABLE_GTPU_PLUGIN |
| 131 | noinst_LTLIBRARIES += libjvpp_gtpu.la |
| 132 | libjvpp_gtpu_la_SOURCES = jvpp-gtpu/jvpp_gtpu.c |
| 133 | libjvpp_gtpu_la_CPPFLAGS = -Ijvpp-gtpu |
| 134 | libjvpp_gtpu_la_LIBADD = $(JVPP_LIBS) |
| 135 | libjvpp_gtpu_la_DEPENDENCIES = libjvpp_common.la |
| 136 | |
| 137 | BUILT_SOURCES += jvpp-gtpu/io_fd_vpp_jvpp_gtpu_JVppGtpuImpl.h |
| 138 | JAR_FILES += jvpp-gtpu-$(PACKAGE_VERSION).jar |
| 139 | CLEANDIRS += jvpp-gtpu/target |
| 140 | |
Damjan Marion | cc4a5e8 | 2018-07-30 16:10:14 +0200 | [diff] [blame] | 141 | jvpp_gtpu_json_files = @top_builddir@/../vpp/plugins/gtpu/gtpu.api.json |
Hongjun Ni | ef486b1 | 2017-04-12 19:21:16 +0800 | [diff] [blame] | 142 | |
| 143 | jvpp-gtpu/io_fd_vpp_jvpp_gtpu_JVppGtpuImpl.h: $(jvpp_registry_ok) $(jvpp_gtpu_json_files) |
| 144 | $(call japigen,gtpu,JVppGtpuImpl) |
| 145 | endif |
| 146 | |
| 147 | # |
Hongjun Ni | 62f9cdd | 2017-07-04 20:11:57 +0800 | [diff] [blame] | 148 | # PPPOE Plugin |
| 149 | # |
| 150 | if ENABLE_PPPOE_PLUGIN |
| 151 | noinst_LTLIBRARIES += libjvpp_pppoe.la |
| 152 | libjvpp_pppoe_la_SOURCES = jvpp-pppoe/jvpp_pppoe.c |
| 153 | libjvpp_pppoe_la_CPPFLAGS = -Ijvpp-pppoe |
| 154 | libjvpp_pppoe_la_LIBADD = $(JVPP_LIBS) |
| 155 | libjvpp_pppoe_la_DEPENDENCIES = libjvpp_common.la |
| 156 | |
| 157 | BUILT_SOURCES += jvpp-pppoe/io_fd_vpp_jvpp_pppoe_JVppPppoeImpl.h |
| 158 | JAR_FILES += jvpp-pppoe-$(PACKAGE_VERSION).jar |
| 159 | CLEANDIRS += jvpp-pppoe/target |
| 160 | |
Damjan Marion | cc4a5e8 | 2018-07-30 16:10:14 +0200 | [diff] [blame] | 161 | jvpp_pppoe_json_files = @top_builddir@/../vpp/plugins/pppoe/pppoe.api.json |
Hongjun Ni | 62f9cdd | 2017-07-04 20:11:57 +0800 | [diff] [blame] | 162 | |
| 163 | jvpp-pppoe/io_fd_vpp_jvpp_pppoe_JVppPppoeImpl.h: $(jvpp_registry_ok) $(jvpp_pppoe_json_files) |
| 164 | $(call japigen,pppoe,JVppPppoeImpl) |
| 165 | endif |
| 166 | |
| 167 | # |
Matus Fabian | 2ba92e3 | 2017-08-21 07:05:03 -0700 | [diff] [blame] | 168 | # NAT Plugin |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 169 | # |
Matus Fabian | 2ba92e3 | 2017-08-21 07:05:03 -0700 | [diff] [blame] | 170 | if ENABLE_NAT_PLUGIN |
| 171 | noinst_LTLIBRARIES += libjvpp_nat.la |
| 172 | libjvpp_nat_la_SOURCES = jvpp-nat/jvpp_nat.c |
| 173 | libjvpp_nat_la_CPPFLAGS = -Ijvpp-nat |
| 174 | libjvpp_nat_la_LIBADD = $(JVPP_LIBS) |
| 175 | libjvpp_nat_la_DEPENDENCIES = libjvpp_common.la |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 176 | |
Matus Fabian | 2ba92e3 | 2017-08-21 07:05:03 -0700 | [diff] [blame] | 177 | BUILT_SOURCES += jvpp-nat/io_fd_vpp_jvpp_nat_JVppNatImpl.h |
| 178 | JAR_FILES += jvpp-nat-$(PACKAGE_VERSION).jar |
| 179 | CLEANDIRS += jvpp-nat/target |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 180 | |
Damjan Marion | cc4a5e8 | 2018-07-30 16:10:14 +0200 | [diff] [blame] | 181 | jvpp_nat_json_files = @top_builddir@/../vpp/plugins/nat/nat.api.json |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 182 | |
Matus Fabian | 2ba92e3 | 2017-08-21 07:05:03 -0700 | [diff] [blame] | 183 | jvpp-nat/io_fd_vpp_jvpp_nat_JVppNatImpl.h: $(jvpp_registry_ok) $(jvpp_nat_json_files) |
| 184 | $(call japigen,nat,JVppNatImpl) |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 185 | endif |
| 186 | |
| 187 | # |
| 188 | # iOAM Trace Plugin |
| 189 | # |
| 190 | if ENABLE_IOAM_PLUGIN |
| 191 | noinst_LTLIBRARIES += libjvpp_ioamtrace.la |
| 192 | libjvpp_ioamtrace_la_SOURCES = jvpp-ioamtrace/jvpp_ioam_trace.c |
Marek Gradzki | ea4fa75 | 2017-01-10 19:58:43 +0100 | [diff] [blame] | 193 | libjvpp_ioamtrace_la_LIBADD = $(JVPP_LIBS) |
| 194 | libjvpp_ioamtrace_la_DEPENDENCIES = libjvpp_common.la |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 195 | |
| 196 | BUILT_SOURCES += jvpp-ioamtrace/io_fd_vpp_jvpp_ioamtrace_JVppIoamtraceImpl.h |
| 197 | JAR_FILES += jvpp-ioamtrace-$(PACKAGE_VERSION).jar |
| 198 | CLEANDIRS += jvpp-ioamtrace/target |
| 199 | |
Damjan Marion | cc4a5e8 | 2018-07-30 16:10:14 +0200 | [diff] [blame] | 200 | jvpp_ioamtrace_json_files = @top_builddir@/../vpp/plugins/ioam/lib-trace/trace.api.json |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 201 | |
| 202 | jvpp-ioamtrace/io_fd_vpp_jvpp_ioamtrace_JVppIoamtraceImpl.h: $(jvpp_registry_ok) $(jvpp_ioamtrace_json_files) |
| 203 | $(call japigen,ioamtrace,JVppIoamtraceImpl) |
| 204 | |
| 205 | # |
| 206 | # iOAM POT Plugin |
| 207 | # |
| 208 | noinst_LTLIBRARIES += libjvpp_ioampot.la |
| 209 | libjvpp_ioampot_la_SOURCES = jvpp-ioampot/jvpp_ioam_pot.c |
Marek Gradzki | ea4fa75 | 2017-01-10 19:58:43 +0100 | [diff] [blame] | 210 | libjvpp_ioampot_la_LIBADD = $(JVPP_LIBS) |
| 211 | libjvpp_ioampot_la_DEPENDENCIES = libjvpp_common.la |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 212 | |
| 213 | BUILT_SOURCES += jvpp-ioampot/io_fd_vpp_jvpp_ioampot_JVppIoampotImpl.h |
| 214 | JAR_FILES += jvpp-ioampot-$(PACKAGE_VERSION).jar |
| 215 | CLEANDIRS += jvpp-ioampot/target |
| 216 | |
Damjan Marion | cc4a5e8 | 2018-07-30 16:10:14 +0200 | [diff] [blame] | 217 | jvpp_ioampot_json_files = @top_builddir@/../vpp/plugins/ioam/lib-pot/pot.api.json |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 218 | |
| 219 | jvpp-ioampot/io_fd_vpp_jvpp_ioampot_JVppIoampotImpl.h: $(jvpp_registry_ok) $(jvpp_ioampot_json_files) |
| 220 | $(call japigen,ioampot,JVppIoampotImpl) |
| 221 | |
| 222 | # |
| 223 | # iOAM Export Plugin |
| 224 | # |
| 225 | noinst_LTLIBRARIES += libjvpp_ioamexport.la |
| 226 | libjvpp_ioamexport_la_SOURCES = jvpp-ioamexport/jvpp_ioam_export.c |
Marek Gradzki | ea4fa75 | 2017-01-10 19:58:43 +0100 | [diff] [blame] | 227 | libjvpp_ioamexport_la_LIBADD = $(JVPP_LIBS) |
| 228 | libjvpp_ioamexport_la_DEPENDENCIES = libjvpp_common.la |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 229 | |
| 230 | BUILT_SOURCES += jvpp-ioamexport/io_fd_vpp_jvpp_ioamexport_JVppIoamexportImpl.h |
| 231 | JAR_FILES += jvpp-ioamexport-$(PACKAGE_VERSION).jar |
| 232 | CLEANDIRS += jvpp-ioamexport/target |
| 233 | |
Damjan Marion | cc4a5e8 | 2018-07-30 16:10:14 +0200 | [diff] [blame] | 234 | jvpp_ioamexport_json_files = @top_builddir@/../vpp/plugins/ioam/export/ioam_export.api.json |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 235 | |
| 236 | jvpp-ioamexport/io_fd_vpp_jvpp_ioamexport_JVppIoamexportImpl.h: $(jvpp_registry_ok) $(jvpp_ioamexport_json_files) |
| 237 | $(call japigen,ioamexport,JVppIoamexportImpl) |
| 238 | endif |
| 239 | |
| 240 | # |
| 241 | # JAR creation |
| 242 | # |
| 243 | jvpp-%-$(PACKAGE_VERSION).jar: libjvpp_%.la |
| 244 | @echo " JAR $@" |
| 245 | @cp .libs/libjvpp_$*.so jvpp-$*/target |
| 246 | @$(JAR) cf $(JARFLAGS) $@ -C jvpp-$*/target . |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 247 | |
| 248 | jardir = $(prefix)/share/java |
| 249 | jar_DATA = $(JAR_FILES) |
| 250 | |
| 251 | all-local: $(JAR_FILES) |
| 252 | |
| 253 | # |
| 254 | # Cleanup |
| 255 | # |
Burt Silverman | 006eb47 | 2017-01-27 15:29:54 -0500 | [diff] [blame] | 256 | CLEANFILES = jvpp-registry.ok $(JAR_FILES) $(BUILT_SOURCES) *.files */*.h |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 257 | |
| 258 | clean-local: |
| 259 | rm -rf $(CLEANDIRS) |