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