Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 1 | # 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 | |
| 14 | AUTOMAKE_OPTIONS = foreign subdir-objects |
| 15 | ACLOCAL_AMFLAGS = -I m4 |
| 16 | AM_CFLAGS = -Wall |
| 17 | |
| 18 | noinst_PROGRAMS = |
| 19 | BUILT_SOURCES = |
| 20 | bin_PROGRAMS = |
| 21 | CLEANFILES = |
| 22 | lib_LTLIBRARIES = |
| 23 | |
Marek Gradzki | d85036f | 2016-04-26 12:09:05 +0200 | [diff] [blame] | 24 | # |
Marek Gradzki | 66ea26b | 2016-07-26 15:28:22 +0200 | [diff] [blame] | 25 | # jvpp-common |
Marek Gradzki | d85036f | 2016-04-26 12:09:05 +0200 | [diff] [blame] | 26 | # |
| 27 | |
Marek Gradzki | 948b95a | 2016-07-20 14:53:48 +0200 | [diff] [blame] | 28 | nobase_include_HEADERS = \ |
Marek Gradzki | 66ea26b | 2016-07-26 15:28:22 +0200 | [diff] [blame] | 29 | jvpp-common/jvpp_common.h |
Marek Gradzki | d85036f | 2016-04-26 12:09:05 +0200 | [diff] [blame] | 30 | |
Marek Gradzki | 66ea26b | 2016-07-26 15:28:22 +0200 | [diff] [blame] | 31 | lib_LTLIBRARIES += libjvpp_common.la |
Marek Gradzki | d85036f | 2016-04-26 12:09:05 +0200 | [diff] [blame] | 32 | |
Marek Gradzki | 66ea26b | 2016-07-26 15:28:22 +0200 | [diff] [blame] | 33 | libjvpp_common_la_SOURCES = jvpp-common/jvpp_common.c |
| 34 | libjvpp_common_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra \ |
Marek Gradzki | d85036f | 2016-04-26 12:09:05 +0200 | [diff] [blame] | 35 | -lpthread -lm -lrt |
Marek Gradzki | 66ea26b | 2016-07-26 15:28:22 +0200 | [diff] [blame] | 36 | libjvpp_common_la_LDFLAGS = -module |
| 37 | libjvpp_common_la_CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux |
Marek Gradzki | d85036f | 2016-04-26 12:09:05 +0200 | [diff] [blame] | 38 | |
Marek Gradzki | d85036f | 2016-04-26 12:09:05 +0200 | [diff] [blame] | 39 | |
Marek Gradzki | 66ea26b | 2016-07-26 15:28:22 +0200 | [diff] [blame] | 40 | # |
| 41 | # jvpp-registry (connection management + plugin registry) |
| 42 | # |
| 43 | lib_LTLIBRARIES += libjvpp_registry.la |
Marek Gradzki | d85036f | 2016-04-26 12:09:05 +0200 | [diff] [blame] | 44 | |
Marek Gradzki | 66ea26b | 2016-07-26 15:28:22 +0200 | [diff] [blame] | 45 | libjvpp_registry_la_SOURCES = jvpp-registry/jvpp_registry.c |
| 46 | libjvpp_registry_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra \ |
| 47 | -lpthread -lm -lrt -ljvpp_common |
| 48 | libjvpp_registry_la_LDFLAGS = -module |
| 49 | libjvpp_registry_la_CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux |
Ed Warnicke | 0c25d1f | 2016-08-17 11:53:08 -0700 | [diff] [blame] | 50 | EXTRA_libjvpp_registry_la_DEPENDENCIES=libjvpp_common.la |
Marek Gradzki | d85036f | 2016-04-26 12:09:05 +0200 | [diff] [blame] | 51 | |
Marek Gradzki | 66ea26b | 2016-07-26 15:28:22 +0200 | [diff] [blame] | 52 | jarfile_jvpp_registry = jvpp-registry-$(PACKAGE_VERSION).jar |
| 53 | packagedir_jvpp_registry = org/openvpp/jvpp |
Marek Gradzki | d85036f | 2016-04-26 12:09:05 +0200 | [diff] [blame] | 54 | |
Marek Gradzki | 66ea26b | 2016-07-26 15:28:22 +0200 | [diff] [blame] | 55 | BUILT_SOURCES += jvpp-registry/org_openvpp_jvpp_VppJNIConnection.h |
| 56 | |
| 57 | |
| 58 | jvpp-registry/org_openvpp_jvpp_VppJNIConnection.h: |
| 59 | @echo " jvpp-registry.jar generation "; \ |
| 60 | mkdir -p jvpp-registry/target; \ |
| 61 | cp -rf @srcdir@/jvpp-registry/* -t jvpp-registry/; |
| 62 | $(JAVAC) -d jvpp-registry/target jvpp-registry/$(packagedir_jvpp_registry)/*.java \ |
| 63 | jvpp-registry/$(packagedir_jvpp_registry)/dto/*.java \ |
| 64 | jvpp-registry/$(packagedir_jvpp_registry)/callback/*.java \ |
| 65 | jvpp-registry/$(packagedir_jvpp_registry)/notification/*.java \ |
| 66 | jvpp-registry/$(packagedir_jvpp_registry)/future/*.java \ |
| 67 | jvpp-registry/$(packagedir_jvpp_registry)/test/*.java \ |
| 68 | || (echo "jvpp-registry compilation failed: $$?"; exit 1); \ |
| 69 | $(JAVAH) -classpath jvpp-registry/target -d jvpp-registry org.openvpp.jvpp.VppJNIConnection ; |
| 70 | $(JAVAH) -classpath jvpp-registry/target -d jvpp-registry org.openvpp.jvpp.JVppRegistryImpl ; |
| 71 | |
| 72 | $(jarfile_jvpp_registry): libjvpp_registry.la |
| 73 | cp .libs/libjvpp_registry.so.0.0.0 jvpp-registry/target; \ |
| 74 | $(JAR) cf $(JARFLAGS) $@ -C jvpp-registry/target .; |
| 75 | |
| 76 | # |
| 77 | # jvpp-core (Java wrapper for vpe.api) |
| 78 | # |
| 79 | lib_LTLIBRARIES += libjvpp_core.la |
| 80 | |
| 81 | libjvpp_core_la_SOURCES = jvpp-core/jvpp_core.c jvpp-core/jvpp_core_gen.h |
| 82 | libjvpp_core_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra \ |
| 83 | -lpthread -lm -lrt -ljvpp_common |
| 84 | libjvpp_core_la_LDFLAGS = -module |
| 85 | libjvpp_core_la_CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux |
Ed Warnicke | 0c25d1f | 2016-08-17 11:53:08 -0700 | [diff] [blame] | 86 | EXTRA_libjvpp_core_la_DEPENDENCIES=libjvpp_common.la |
Marek Gradzki | 66ea26b | 2016-07-26 15:28:22 +0200 | [diff] [blame] | 87 | |
| 88 | jarfile_jvpp_core = jvpp-core-$(PACKAGE_VERSION).jar |
| 89 | packagedir_jvpp_core = org/openvpp/jvpp/core |
| 90 | api_file = $(prefix)/../vpp/vpp-api/vpe.api |
| 91 | |
| 92 | BUILT_SOURCES += jvpp-core/org_openvpp_jvpp_core_JVppCoreImpl.h |
| 93 | |
| 94 | |
| 95 | defs_vpp_papi.py: |
| 96 | @echo "jVpp API"; \ |
| 97 | vppapigen --input $(api_file) --python jvpp-core/defs_vpp_papi.py; |
| 98 | |
| 99 | jvpp-core/org_openvpp_jvpp_core_JVppCoreImpl.h: defs_vpp_papi.py |
| 100 | cp -rf @srcdir@/jvpp-core/* -t jvpp-core/; \ |
| 101 | mkdir -p jvpp-core/target; \ |
| 102 | cd jvpp-core; \ |
| 103 | mkdir dto future callfacade callback notification; \ |
| 104 | @srcdir@/jvpp/gen/jvpp_gen.py -i defs_vpp_papi.py --plugin_name core; \ |
| 105 | cp -rf dto future callfacade callback notification *.java -t $(packagedir_jvpp_core); \ |
| 106 | rm -rf dto future callfacade callback notification *.java; \ |
| 107 | cd ..; \ |
| 108 | $(JAVAC) -classpath jvpp-registry/target -d jvpp-core/target jvpp-core/$(packagedir_jvpp_core)/*.java \ |
| 109 | jvpp-core/$(packagedir_jvpp_core)/dto/*.java \ |
| 110 | jvpp-core/$(packagedir_jvpp_core)/callback/*.java \ |
| 111 | jvpp-core/$(packagedir_jvpp_core)/notification/*.java \ |
| 112 | jvpp-core/$(packagedir_jvpp_core)/future/*.java \ |
| 113 | jvpp-core/$(packagedir_jvpp_core)/callfacade/*.java \ |
| 114 | jvpp-core/$(packagedir_jvpp_core)/test/*.java \ |
| 115 | || (echo "jvpp-core compilation failed: $$?"; exit 1); \ |
| 116 | $(JAVAH) -classpath jvpp-registry/target:jvpp-core/target -d jvpp-core org.openvpp.jvpp.core.JVppCoreImpl ; |
| 117 | |
| 118 | $(jarfile_jvpp_core): libjvpp_core.la |
| 119 | cp .libs/libjvpp_core.so.0.0.0 jvpp-core/target; \ |
| 120 | $(JAR) cf $(JARFLAGS) $@ -C jvpp-core/target .; |
| 121 | |
| 122 | all-local: $(jarfile_jvpp_registry) $(jarfile_jvpp_core) |