Makefile.am revision 69ca60e8
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
14AUTOMAKE_OPTIONS = foreign subdir-objects
15
16AM_CFLAGS = -Wall -fstack-protector -fPIC -Werror -g -DFORTIFY_SOURCE=2
17if DEBUG
18AM_CFLAGS += -O0 -DCLIB_DEBUG
19vpp_build = vpp_debug-native
20else
21AM_CFLAGS += -O2
22vpp_build = vpp-native
23endif
24
25if VPP_DIR_SET
26vpp_install = @VPP_DIR@/build-root/install-$(vpp_build)
27AM_CFLAGS += -I$(vpp_install)/vpp/include/
28else
29AM_CFLAGS += -Wall
30endif
31
32lib_LTLIBRARIES = librtnl.la
33
34librtnl_la_SOURCES =     \
35  librtnl/netns.c        \
36  librtnl/rtnl.c         \
37  librtnl/mapper.c
38
39nobase_include_HEADERS =	\
40  librtnl/netns.h           \
41  librtnl/rtnl.h            \
42  librtnl/mapper.h
43
44lib_LTLIBRARIES += testrtnl_plugin.la
45
46testrtnl_plugin_la_SOURCES = test/test.c
47testrtnl_plugin_la_LDFLAGS = -module
48testrtnl_plugin_la_LIBADD = librtnl.la
49
50if VPP_DIR_SET
51install: install-am
52	mkdir -p $(vpp_install)/vpp/lib64/vpp_plugins/
53	cp $(prefix)/lib/testrtnl_plugin.so.*.*.* $(vpp_install)/vpp/lib64/vpp_plugins/testrtnl_plugin.so
54	cp $(prefix)/lib/librtnl.so $(vpp_install)/vpp/lib64/librtnl.so
55endif
56