Fix pretty-printing in "api trace custom-dump" (VPP-683)
[vpp.git] / plugins / acl-plugin / Makefile.am
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 subdir-objects
15
16 AM_CFLAGS = -Wall
17 AM_LDFLAGS = -module -shared -avoid-version
18
19 vppapitestpluginsdir = ${libdir}/vpp_api_test_plugins
20 vpppluginsdir = ${libdir}/vpp_plugins
21
22 vppapitestplugins_LTLIBRARIES = acl_test_plugin.la
23 vppplugins_LTLIBRARIES = acl_plugin.la
24
25 acl_plugin_la_SOURCES =                         \
26         acl/acl.c                               \
27         acl/node_in.c                           \
28         acl/node_out.c                          \
29         acl/l2sess.c                            \
30         acl/l2sess_node.c                       \
31         acl/l2sess.h                            \
32         acl/manual_fns.h                        \
33         acl/acl_plugin.api.h
34
35 BUILT_SOURCES = acl/acl.api.h acl/acl.api.json
36
37 SUFFIXES = .api.h .api .api.json
38
39 #
40 # ACL API
41 #
42 %.api.h: %.api
43         mkdir -p `dirname $@` ; \
44         $(CC) $(CPPFLAGS) -E -P -C -x c $^ \
45         | vppapigen --input - --output $@ --show-name $@
46
47 %.api.json: %.api
48         @echo "  JSON APIGEN  " $@ ;                            \
49         mkdir -p `dirname $@` ;                                 \
50         $(CC) $(CPPFLAGS) -E -P -C -x c $^                      \
51         | vppapigen --input - --json $@
52
53 apidir = $(prefix)/acl
54 api_DATA = acl/acl.api.json
55
56 nobase_include_HEADERS =                                \
57   acl/acl_all_api_h.h                           \
58   acl/acl_msg_enum.h                            \
59   acl/manual_fns.h                              \
60   acl/acl.api.h
61
62 acl_test_plugin_la_SOURCES = acl/acl_test.c acl/acl_plugin.api.h acl/acl_all_api.h
63
64 # Remove *.la files
65 install-data-hook:
66         @(cd $(vpppluginsdir) && $(RM) $(vppplugins_LTLIBRARIES))
67         @(cd $(vppapitestpluginsdir) && $(RM) $(vppapitestplugins_LTLIBRARIES))
68
69 #
70 # Java code generation
71 #
72 jvpp_registry_root = ../../vpp-api/java
73 jvpp_registry_version = 17.01.1
74 jacl_jarfile = jvpp-acl-$(PACKAGE_VERSION).jar
75 jvpp_package_dir = io/fd/vpp/jvpp/acl
76 jvpp_root = acl/jvpp
77 jvpp_target_dir = target
78 jvpp_target = $(jvpp_root)/$(jvpp_target_dir)
79
80 lib_LTLIBRARIES = libjvpp_acl.la
81 libjvpp_acl_la_SOURCES = acl/acl.api.h acl/jvpp_acl.c acl/jvpp/io_fd_vpp_jvpp_acl_JVppAclImpl.h
82 libjvpp_acl_la_LIBADD = -lvlibmemoryclient -lvlibapi -lvppinfra \
83                       -lpthread -lm -lrt -L$(jvpp_registry_root)/.libs -ljvpp_common
84 libjvpp_acl_la_LDFLAGS = -module
85 libjvpp_acl_la_CPPFLAGS = -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux -I../ -I$(srcdir)/../
86
87 BUILT_SOURCES += $(jvpp_root)/io_fd_vpp_jvpp_acl_JVppAclImpl.h
88
89 $(jvpp_root)/io_fd_vpp_jvpp_acl_JVppAclImpl.h: acl/acl.api.json
90         dir=`pwd`;                                              \
91         mkdir -p $(jvpp_target); \
92         mkdir -p $(jvpp_root)/$(jvpp_package_dir);              \
93         cd $(jvpp_root)/$(jvpp_package_dir);                    \
94         mkdir -p types dto future callfacade callback notification test;        \
95         @srcdir@/$(jvpp_registry_root)/jvpp/gen/jvpp_gen.py -i $${dir}/acl/acl.api.json --plugin_name acl;              \
96         cd -;                                                   \
97         mv -f $(jvpp_root)/$(jvpp_package_dir)/jvpp_acl_gen.h $(jvpp_root)/jvpp_acl_gen.h;                                                      \
98         cp $(srcdir)/$(jvpp_root)/$(jvpp_package_dir)/test/*.java $(jvpp_root)/$(jvpp_package_dir)/test/;                               \
99         cd $(jvpp_root);                                \
100         $(JAVAC) -classpath .:$(jvpp_target_dir):../../$(jvpp_registry_root)/jvpp-registry-$(jvpp_registry_version).jar -d $(jvpp_target_dir) $(jvpp_package_dir)/*.java \
101                 $(jvpp_package_dir)/types/*.java \
102                 $(jvpp_package_dir)/dto/*.java \
103                 $(jvpp_package_dir)/callback/*.java \
104                 $(jvpp_package_dir)/notification/*.java \
105                 $(jvpp_package_dir)/future/*.java       \
106                 $(jvpp_package_dir)/callfacade/*.java   \
107                 $(jvpp_package_dir)/test/*.java \
108                 || (echo "acl jvpp compilation failed: $$?"; exit 1);   \
109         $(JAVAH) -classpath .:$(jvpp_target_dir):../../$(jvpp_registry_root)/jvpp-registry-$(jvpp_registry_version).jar -d . io.fd.vpp.jvpp.acl.JVppAclImpl ;
110
111 $(jacl_jarfile): libjvpp_acl.la
112         cp .libs/libjvpp_acl.so.0.0.0 $(jvpp_target);                           \
113         cd $(jvpp_target);                              \
114         $(JAR) cfv $(JARFLAGS) ../../../$@ libjvpp_acl.so.0.0.0 $(jvpp_package_dir)/* ; cd ..;
115
116 all-local: $(jacl_jarfile)