blob: 3bb2c1beaaefcabf96d3f1dc75f878ec0606a6b0 [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
Damjan Marion45a00c42017-01-08 15:34:50 +010047BUILT_SOURCES += .version
Damjan Marion7cd468a2016-12-19 23:05:39 +010048
49vpp/app/version.o: vpp/app/version.h
50
Damjan Marion45a00c42017-01-08 15:34:50 +010051.PHONY: .version
Damjan Marion7cd468a2016-12-19 23:05:39 +010052
Damjan Marion45a00c42017-01-08 15:34:50 +010053VPP_VERSION = $(shell $(srcdir)/scripts/version)
54
55# update version.h only when version changes, to avoid
56# unnecessary re-linking of vpp binary
57
58.version:
59 @if [ "$$(cat .version 2> /dev/null)" != "$(VPP_VERSION)" ] ; then \
60 f="vpp/app/version.h" ;\
61 echo " VERSION $$f ($(VPP_VERSION))" ;\
62 echo $(VPP_VERSION) > .version ;\
63 echo "#define VPP_BUILD_DATE \"$$(date)\"" > $$f ;\
64 echo "#define VPP_BUILD_USER \"$$(whoami)\"" >> $$f ;\
65 echo "#define VPP_BUILD_HOST \"$$(hostname)\"" >> $$f ;\
66 echo -n "#define VPP_BUILD_TOPDIR " >> $$f ;\
67 echo "\"$$(cd $(srcdir) && git rev-parse --show-toplevel)\"" >> $$f ;\
68 echo "#define VPP_BUILD_VER \"$(VPP_VERSION)\"" >> $$f ;\
69 fi
70
Damjan Marion7cd468a2016-12-19 23:05:39 +010071
72# Generate a plugin configuration script. Misconfiguring a
73# plugin can cause very subtle problems.
74
75bin_SCRIPTS = vpp_plugin_configure
76
77BUILT_SOURCES += vpp_plugin_configure
78
79.PHONY: vpp_plugin_configure
80
81if WITH_DPDK
82PLUGIN_DPDK_ARG="--with-dpdk"
83else
84PLUGIN_DPDK_ARG=""
85endif
86
87vpp_plugin_configure:
Damjan Marioncb034b92016-12-28 18:38:59 +010088 @echo "PLUGIN CFG" $@
Damjan Marion7cd468a2016-12-19 23:05:39 +010089 @echo "#!/bin/bash" > $@
90 @echo " " >> $@
91 @echo "set +eu" >> $@
92 @echo " " >> $@
93 @echo "if [ -f ./configure ] ; then" >> $@
94 @echo " CFLAGS='$(CFLAGS) $(AM_CFLAGS) -I/usr/include/vpp-dpdk' ./configure --with-plugin-toolkit $(PLUGIN_DPDK_ARG)" >> $@
95 @echo "else" >> $@
96 @echo " if [ -f ../configure ] ; then" >> $@
97 @echo " CFLAGS='$(CFLAGS) $(AM_CFLAGS) -I/usr/include/vpp-dpdk' ../configure --with-plugin-toolkit $(PLUGIN_DPDK_ARG)" >> $@
98 @echo " else" >> $@
99 @echo " echo Couldnt find ./configure or ../configure " >> $@
100 @echo " exit 1" >> $@
101 @echo " fi" >> $@
102 @echo "fi" >> $@
103
104bin_vpp_LDADD = \
105 libvlibapi.la \
106 libvlibmemory.la \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100107 libvlib.la \
108 libvnet.la \
109 libsvm.la \
110 libsvmdb.la \
111 libvnetplugin.la \
112 -lrt
113
114bin_vpp_LDFLAGS = $(DPDK_LD_FLAGS)
115bin_vpp_LDADD += libvppinfra.la -lm -lpthread -ldl $(DPDK_LD_ADD)
116
Damjan Marion7cd468a2016-12-19 23:05:39 +0100117noinst_PROGRAMS += bin/test_client
118
119bin_test_client_SOURCES = \
120 vpp/api/test_client.c
121
122bin_test_client_LDADD = \
123 libvlibmemoryclient.la \
124 libvlibapi.la \
125 libsvm.la \
126 libvppinfra.la \
127 -lpthread -lm -lrt
128
129noinst_PROGRAMS += bin/test_client bin/test_ha
130
131bin_test_ha_SOURCES = \
132 vpp/api/test_ha.c
133
134bin_test_ha_LDADD = \
135 libvlibmemoryclient.la \
136 libvlibapi.la \
137 libsvmdb.la \
138 libsvm.la \
139 libvppinfra.la \
140 -lpthread -lm -lrt
141
142noinst_PROGRAMS += bin/summary_stats_client
143
144bin_summary_stats_client_SOURCES = \
145 vpp/api/summary_stats_client.c
146
147bin_summary_stats_client_LDADD = \
148 libvlibmemoryclient.la \
149 libvlibapi.la \
150 libsvm.la \
151 libvppinfra.la \
152 -lpthread -lm -lrt
153
154bin_PROGRAMS += bin/vpp_get_metrics
155
156bin_vpp_get_metrics_SOURCES = \
157 vpp/api/vpp_get_metrics.c
158
159bin_vpp_get_metrics_LDADD = \
160 libsvmdb.la \
161 libsvm.la \
162 libvppinfra.la \
163 -lpthread -lm -lrt
164
165# vi:syntax=automake