Simple ip4 NAT plugin
[vpp.git] / plugins / snat-plugin / Makefile.am
1
2 # Copyright (c) <current-year> <your-organization>
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at:
6
7 #     http://www.apache.org/licenses/LICENSE-2.0
8
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 AUTOMAKE_OPTIONS = foreign subdir-objects
16
17 AM_CFLAGS = -Wall -I@TOOLKIT_INCLUDE@ @DPDK@
18
19 lib_LTLIBRARIES = snat_plugin.la snat_test_plugin.la
20
21 snat_plugin_la_SOURCES = snat/snat.c            \
22         snat/in2out.c                           \
23         snat/out2in.c                           \
24         snat/snat_plugin.api.h 
25
26 snat_plugin_la_LDFLAGS = -module
27
28 BUILT_SOURCES = snat/snat.api.h
29
30 SUFFIXES = .api.h .api
31
32 %.api.h: %.api
33         mkdir -p `dirname $@` ; \
34         $(CC) $(CPPFLAGS) -E -P -C -x c $^ \
35         | vppapigen --input - --output $@ --show-name $@
36
37 nobase_include_HEADERS =                        \
38   snat/snat_all_api_h.h                 \
39   snat/snat_msg_enum.h                  \
40   snat/snat.api.h
41
42 snat_test_plugin_la_SOURCES = \
43   snat/snat_test.c snat/snat_plugin.api.h
44 snat_test_plugin_la_LDFLAGS = -module
45
46 if WITH_PLUGIN_TOOLKIT
47 install-data-hook:
48         mkdir /usr/lib/vpp_plugins || true
49         mkdir /usr/lib/vpp_api_test_plugins || true
50         cp -L $(prefix)/lib/snat_plugin.so /usr/lib/vpp_plugins
51         cp -L $(prefix)/lib/snat_test_plugin.so \
52                 /usr/lib/vpp_api_test_plugins
53         rm -f $(prefix)/lib/snat_plugin.*
54         rm -f $(prefix)/lib/snat_test_plugin.*
55 endif