Makefile.am revision 237944f3
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
14AUTOMAKE_OPTIONS = foreign subdir-objects
15ACLOCAL_AMFLAGS = -I m4
16AM_CFLAGS = -Wall 
17
18
19noinst_PROGRAMS = 
20BUILT_SOURCES =
21bin_PROGRAMS = 
22CLEANFILES = 
23
24nobase_include_HEADERS = jvpp/org_openvpp_jvpp_nsh_JVppNshImpl.h
25
26jarfile_jnsh_sfc = jnsh_sfc-$(PACKAGE_VERSION).jar
27# fixme update dirs after package in jvpp is changed from org.openvpp.jvpp to io.fd.vpp
28java_packagedir = io/fd/nsh_sfc/jvpp
29java_gendir = jvpp/src/main/java
30resourcesdir = jvpp/src/main/resources
31api_file=$(srcdir)/../nsh/nsh.api
32jvpp_gen = jvpp_gen.py
33
34
35lib_LTLIBRARIES = libjvpp_nsh.la
36libjvpp_nsh_la_SOURCES = $(srcdir)/../java/nsh.api.h jvpp/jvpp_nsh.c jvpp/org_openvpp_jvpp_nsh_JVppNshImpl.h
37libjvpp_nsh_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra \
38	              -lpthread -lm -lrt -ljvpp_common
39libjvpp_nsh_la_LDFLAGS = -module
40libjvpp_nsh_la_CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -I../ -I$(srcdir)/../
41
42BUILT_SOURCES = jvpp/org_openvpp_jvpp_nsh_JVppNshImpl.h
43
44jvpp/org_openvpp_jvpp_nsh_JVppNshImpl.h: defs_nsh_sfc_papi.py
45	dir=`pwd`;						\
46	mkdir -p $(java_gendir)/$(java_packagedir); 		\
47	cd $(java_gendir)/$(java_packagedir);			\
48	mkdir -p dto future callfacade callback notification test; 	\
49	$(jvpp_gen) -i $${dir}/defs_nsh_sfc_papi.py --plugin_name nsh --control_ping_class NshControlPing;		\
50	cd -;							\
51	mv -f $(java_gendir)/$(java_packagedir)/jvpp_nsh_gen.h jvpp/jvpp_nsh_gen.h;							\
52	cp $(srcdir)/pom.xml jvpp/;				\
53	cp $(srcdir)/jvpp/test/*.java $(java_gendir)/$(java_packagedir)/test/;				\
54	cd jvpp;				\
55	mvn $${MAVEN_SETTINGS_OPTIONS} -v;	\
56	mvn $${MAVEN_SETTINGS_OPTIONS} clean process-classes;
57
58$(jarfile_jnsh_sfc): libjvpp_nsh.la
59	mkdir -p $(resourcesdir);				\
60	cp .libs/libjvpp_nsh.so.0.0.0 $(resourcesdir);				\
61	cd jvpp;				\
62	mvn $${MAVEN_SETTINGS_OPTIONS} -v;	\
63	mvn $${MAVEN_SETTINGS_OPTIONS} package;
64
65defs_nsh_sfc_papi.py:
66	@echo "  jNsh_sfc API"; \
67        vppapigen --input $(api_file) --python defs_nsh_sfc_papi.py;
68        
69all-local: $(jarfile_jnsh_sfc)
70