Makefile.am revision e958b2b8
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/io_fd_vpp_jvpp_nsh_JVppNshImpl.h
25
26jarfile_jnsh_sfc = jnsh_sfc-$(PACKAGE_VERSION).jar
27java_packagedir = io/fd/nsh_sfc/jvpp
28java_gendir = jvpp/src/main/java
29resourcesdir = jvpp/src/main/resources
30api_file=$(srcdir)/../nsh/nsh.api
31jvpp_gen = jvpp_gen.py
32
33
34lib_LTLIBRARIES = libjvpp_nsh.la
35libjvpp_nsh_la_SOURCES = $(srcdir)/../java/nsh.api.h jvpp/jvpp_nsh.c jvpp/io_fd_vpp_jvpp_nsh_JVppNshImpl.h
36libjvpp_nsh_la_LIBADD = -lvlibmemoryclient -lvlibapi -lsvm -lvppinfra \
37	              -lpthread -lm -lrt -ljvpp_common
38libjvpp_nsh_la_LDFLAGS = -module
39libjvpp_nsh_la_CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -I../ -I$(srcdir)/../
40
41BUILT_SOURCES = jvpp/io_fd_vpp_jvpp_nsh_JVppNshImpl.h
42
43jvpp/io_fd_vpp_jvpp_nsh_JVppNshImpl.h: defs_nsh_sfc_papi.py
44	dir=`pwd`;						\
45	mkdir -p $(java_gendir)/$(java_packagedir); 		\
46	cd $(java_gendir)/$(java_packagedir);			\
47	mkdir -p dto future callfacade callback notification test; 	\
48	$(jvpp_gen) -i $${dir}/defs_nsh_sfc_papi.py --plugin_name nsh --control_ping_class NshControlPing;		\
49	cd -;							\
50	mv -f $(java_gendir)/$(java_packagedir)/jvpp_nsh_gen.h jvpp/jvpp_nsh_gen.h;							\
51	cp $(srcdir)/pom.xml jvpp/;				\
52	cp $(srcdir)/jvpp/test/*.java $(java_gendir)/$(java_packagedir)/test/;				\
53	cd jvpp;				\
54	mvn $${MAVEN_SETTINGS_OPTIONS} -v;	\
55	mvn $${MAVEN_SETTINGS_OPTIONS} clean process-classes;
56
57$(jarfile_jnsh_sfc): libjvpp_nsh.la
58	mkdir -p $(resourcesdir);				\
59	cp .libs/libjvpp_nsh.so.0.0.0 $(resourcesdir);				\
60	cd jvpp;				\
61	mvn $${MAVEN_SETTINGS_OPTIONS} -v;	\
62	mvn $${MAVEN_SETTINGS_OPTIONS} package;
63
64defs_nsh_sfc_papi.py:
65	@echo "  jNsh_sfc API"; \
66        vppapigen --input $(api_file) --python defs_nsh_sfc_papi.py;
67        
68all-local: $(jarfile_jnsh_sfc)
69