blob: 1d07b90a89eed380e716bcdbdb49af390c894fe7 [file] [log] [blame]
Damjan Marion7cd468a2016-12-19 23:05:39 +01001# 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
14bin_PROGRAMS += bin/vpp
15
16bin_vpp_SOURCES = \
17 vpp/vnet/main.c \
18 vpp/app/vpe_cli.c \
19 vpp/app/version.c \
20 vpp/oam/oam.c \
21 vpp/stats/stats.c
22
23bin_vpp_SOURCES += \
24 vpp/api/api.c \
25 vpp/api/custom_dump.c \
26 vpp/api/json_format.c
27
28if WITH_APICLI
29 bin_vpp_SOURCES += \
30 vpp/api/api_format.c \
31 vpp/api/api_main.c
32endif
33
34# comment out to disable stats upload to gmond
35
36bin_vpp_CFLAGS = @APICLI@
37bin_vpp_SOURCES += \
38 vpp/api/gmon.c
39
40nobase_include_HEADERS += \
41 vpp/api/vpe_all_api_h.h \
42 vpp/api/vpe_msg_enum.h \
43 vpp/api/vpe.api.h
44
45API_FILES += vpp/api/vpe.api
46
47BUILT_SOURCES += vpp/app/version.h
48
49vpp/app/version.o: vpp/app/version.h
50
51.PHONY: vpp/app/version.h
52
53vpp/app/version.h:
54 @echo " VERSION " $@
55 @echo "#define VPP_BUILD_DATE \"$$(date)\"" > $@
56 @echo "#define VPP_BUILD_USER \"$$(whoami)\"" >> $@
57 @echo "#define VPP_BUILD_HOST \"$$(hostname)\"" >> $@
58 @echo "#define VPP_BUILD_TOPDIR \"$$(git rev-parse --show-toplevel)\"" >> $@
59 @echo "#define VPP_BUILD_VER \"$$(../../scripts/version)\"" >> $@
60
61# Generate a plugin configuration script. Misconfiguring a
62# plugin can cause very subtle problems.
63
64bin_SCRIPTS = vpp_plugin_configure
65
66BUILT_SOURCES += vpp_plugin_configure
67
68.PHONY: vpp_plugin_configure
69
70if WITH_DPDK
71PLUGIN_DPDK_ARG="--with-dpdk"
72else
73PLUGIN_DPDK_ARG=""
74endif
75
76vpp_plugin_configure:
Damjan Marioncb034b92016-12-28 18:38:59 +010077 @echo "PLUGIN CFG" $@
Damjan Marion7cd468a2016-12-19 23:05:39 +010078 @echo "#!/bin/bash" > $@
79 @echo " " >> $@
80 @echo "set +eu" >> $@
81 @echo " " >> $@
82 @echo "if [ -f ./configure ] ; then" >> $@
83 @echo " CFLAGS='$(CFLAGS) $(AM_CFLAGS) -I/usr/include/vpp-dpdk' ./configure --with-plugin-toolkit $(PLUGIN_DPDK_ARG)" >> $@
84 @echo "else" >> $@
85 @echo " if [ -f ../configure ] ; then" >> $@
86 @echo " CFLAGS='$(CFLAGS) $(AM_CFLAGS) -I/usr/include/vpp-dpdk' ../configure --with-plugin-toolkit $(PLUGIN_DPDK_ARG)" >> $@
87 @echo " else" >> $@
88 @echo " echo Couldnt find ./configure or ../configure " >> $@
89 @echo " exit 1" >> $@
90 @echo " fi" >> $@
91 @echo "fi" >> $@
92
93bin_vpp_LDADD = \
94 libvlibapi.la \
95 libvlibmemory.la \
96 libvlib_unix.la \
97 libvlib.la \
98 libvnet.la \
99 libsvm.la \
100 libsvmdb.la \
101 libvnetplugin.la \
102 -lrt
103
104bin_vpp_LDFLAGS = $(DPDK_LD_FLAGS)
105bin_vpp_LDADD += libvppinfra.la -lm -lpthread -ldl $(DPDK_LD_ADD)
106
107if WITH_IPV6SR
108 bin_vpp_LDADD += -lcrypto
109endif
110
111noinst_PROGRAMS += bin/test_client
112
113bin_test_client_SOURCES = \
114 vpp/api/test_client.c
115
116bin_test_client_LDADD = \
117 libvlibmemoryclient.la \
118 libvlibapi.la \
119 libsvm.la \
120 libvppinfra.la \
121 -lpthread -lm -lrt
122
123noinst_PROGRAMS += bin/test_client bin/test_ha
124
125bin_test_ha_SOURCES = \
126 vpp/api/test_ha.c
127
128bin_test_ha_LDADD = \
129 libvlibmemoryclient.la \
130 libvlibapi.la \
131 libsvmdb.la \
132 libsvm.la \
133 libvppinfra.la \
134 -lpthread -lm -lrt
135
136noinst_PROGRAMS += bin/summary_stats_client
137
138bin_summary_stats_client_SOURCES = \
139 vpp/api/summary_stats_client.c
140
141bin_summary_stats_client_LDADD = \
142 libvlibmemoryclient.la \
143 libvlibapi.la \
144 libsvm.la \
145 libvppinfra.la \
146 -lpthread -lm -lrt
147
148bin_PROGRAMS += bin/vpp_get_metrics
149
150bin_vpp_get_metrics_SOURCES = \
151 vpp/api/vpp_get_metrics.c
152
153bin_vpp_get_metrics_LDADD = \
154 libsvmdb.la \
155 libsvm.la \
156 libvppinfra.la \
157 -lpthread -lm -lrt
158
159# vi:syntax=automake