Multiple changes in the plugin build infra
[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 @DPDK@
18 AM_LDFLAGS = -module -shared -avoid-version
19
20 vppapitestpluginsdir = ${libdir}/vpp_api_test_plugins
21 vpppluginsdir = ${libdir}/vpp_plugins
22
23 vppapitestplugins_LTLIBRARIES = snat_test_plugin.la
24 vppplugins_LTLIBRARIES = snat_plugin.la
25
26 snat_plugin_la_SOURCES = snat/snat.c            \
27         snat/in2out.c                           \
28         snat/out2in.c                           \
29         snat/snat_plugin.api.h
30
31 BUILT_SOURCES = snat/snat.api.h
32
33 SUFFIXES = .api.h .api
34
35 %.api.h: %.api
36         mkdir -p `dirname $@` ; \
37         $(CC) $(CPPFLAGS) -E -P -C -x c $^ \
38         | vppapigen --input - --output $@ --show-name $@
39
40 noinst_HEADERS =                        \
41   snat/snat_all_api_h.h                 \
42   snat/snat_msg_enum.h                  \
43   snat/snat.api.h
44
45 snat_test_plugin_la_SOURCES = \
46   snat/snat_test.c snat/snat_plugin.api.h
47
48 # Remove *.la files
49 install-data-hook:
50         @(cd $(vpppluginsdir) && $(RM) $(vppplugins_LTLIBRARIES))
51         @(cd $(vppapitestpluginsdir) && $(RM) $(vppapitestplugins_LTLIBRARIES))