blob: e8c015576567364ab4e24a088b440be26b163214 [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
Dave Barach048a4e52018-06-01 18:52:25 -040014bin_PROGRAMS += bin/vpp
Damjan Marion7cd468a2016-12-19 23:05:39 +010015
16bin_vpp_SOURCES = \
17 vpp/vnet/main.c \
18 vpp/app/vpe_cli.c \
19 vpp/app/version.c \
20 vpp/oam/oam.c \
Neale Rannsb8d44812017-11-10 06:53:54 -080021 vpp/oam/oam_api.c \
Dave Barach048a4e52018-06-01 18:52:25 -040022 vpp/stats/stats.c \
23 vpp/stats/stat_segment.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010024
25bin_vpp_SOURCES += \
26 vpp/api/api.c \
27 vpp/api/custom_dump.c \
28 vpp/api/json_format.c
29
30if WITH_APICLI
31 bin_vpp_SOURCES += \
32 vpp/api/api_format.c \
Dave Barachfe6bdfd2017-01-20 19:50:09 -050033 vpp/api/api_main.c \
34 vpp/api/plugin.c \
35 vpp/api/plugin.h
Damjan Marion7cd468a2016-12-19 23:05:39 +010036endif
37
Dave Wallaced756b352017-07-03 13:11:38 -040038# uncomment to enable stats upload to gmond
39# bin_vpp_SOURCES += \
40# vpp/api/gmon.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010041
42bin_vpp_CFLAGS = @APICLI@
Damjan Marion7cd468a2016-12-19 23:05:39 +010043
44nobase_include_HEADERS += \
45 vpp/api/vpe_all_api_h.h \
46 vpp/api/vpe_msg_enum.h \
Keith Burns (alagalah)8a19f122017-08-06 08:26:29 -070047 vpp/stats/stats.api.h \
Neale Rannsb8d44812017-11-10 06:53:54 -080048 vpp/oam/oam.api.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +010049 vpp/api/vpe.api.h
50
Neale Rannsb8d44812017-11-10 06:53:54 -080051API_FILES += \
52 vpp/api/vpe.api \
53 vpp/stats/stats.api \
54 vpp/oam/oam.api
Damjan Marion7cd468a2016-12-19 23:05:39 +010055
Damjan Marion45a00c42017-01-08 15:34:50 +010056BUILT_SOURCES += .version
Damjan Marion7cd468a2016-12-19 23:05:39 +010057
58vpp/app/version.o: vpp/app/version.h
59
Damjan Marion45a00c42017-01-08 15:34:50 +010060.PHONY: .version
Damjan Marion7cd468a2016-12-19 23:05:39 +010061
Damjan Marion45a00c42017-01-08 15:34:50 +010062VPP_VERSION = $(shell $(srcdir)/scripts/version)
63
Marco Varlesedf82ec82017-05-03 17:37:46 +020064VPP_BUILD_DATE ?= $$(date)
65VPP_BUILD_USER ?= $$(whoami)
66VPP_BUILD_HOST ?= $$(hostname)
67
Damjan Marion45a00c42017-01-08 15:34:50 +010068# update version.h only when version changes, to avoid
69# unnecessary re-linking of vpp binary
70
71.version:
72 @if [ "$$(cat .version 2> /dev/null)" != "$(VPP_VERSION)" ] ; then \
73 f="vpp/app/version.h" ;\
74 echo " VERSION $$f ($(VPP_VERSION))" ;\
75 echo $(VPP_VERSION) > .version ;\
Marco Varlesedf82ec82017-05-03 17:37:46 +020076 echo "#define VPP_BUILD_DATE \"$(VPP_BUILD_DATE)\"" > $$f ;\
77 echo "#define VPP_BUILD_USER \"$(VPP_BUILD_USER)\"" >> $$f ;\
78 echo "#define VPP_BUILD_HOST \"$(VPP_BUILD_HOST)\"" >> $$f ;\
Damjan Marion45a00c42017-01-08 15:34:50 +010079 echo -n "#define VPP_BUILD_TOPDIR " >> $$f ;\
80 echo "\"$$(cd $(srcdir) && git rev-parse --show-toplevel)\"" >> $$f ;\
81 echo "#define VPP_BUILD_VER \"$(VPP_VERSION)\"" >> $$f ;\
82 fi
83
Damjan Marion7cd468a2016-12-19 23:05:39 +010084bin_vpp_LDADD = \
Damjan Marion7cd468a2016-12-19 23:05:39 +010085 libvlibmemory.la \
Damjan Marion7cd468a2016-12-19 23:05:39 +010086 libvlib.la \
87 libvnet.la \
88 libsvm.la \
89 libsvmdb.la \
Damjan Marionc74a86a2017-01-16 14:00:03 +010090 libvppinfra.la \
91 -lrt -lm -lpthread -ldl
Damjan Marion7cd468a2016-12-19 23:05:39 +010092
Dave Barachfe6bdfd2017-01-20 19:50:09 -050093bin_vpp_LDFLAGS = -Wl,--export-dynamic
94
Damjan Marionaad20982017-06-20 16:35:29 +020095bin_PROGRAMS += bin/vppctl
96bin_vppctl_SOURCES = vpp/app/vppctl.c
97bin_vppctl_LDADD = libvppinfra.la
98
Damjan Marion724f64c2017-01-11 11:11:00 +010099if ENABLE_TESTS
Damjan Marion7cd468a2016-12-19 23:05:39 +0100100noinst_PROGRAMS += bin/test_client
101
102bin_test_client_SOURCES = \
103 vpp/api/test_client.c
104
105bin_test_client_LDADD = \
106 libvlibmemoryclient.la \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100107 libsvm.la \
108 libvppinfra.la \
109 -lpthread -lm -lrt
110
111noinst_PROGRAMS += bin/test_client bin/test_ha
112
113bin_test_ha_SOURCES = \
114 vpp/api/test_ha.c
115
116bin_test_ha_LDADD = \
117 libvlibmemoryclient.la \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100118 libsvm.la \
119 libvppinfra.la \
120 -lpthread -lm -lrt
Damjan Marion724f64c2017-01-11 11:11:00 +0100121endif
Damjan Marion7cd468a2016-12-19 23:05:39 +0100122
123noinst_PROGRAMS += bin/summary_stats_client
124
125bin_summary_stats_client_SOURCES = \
Keith Burns (alagalah)8a19f122017-08-06 08:26:29 -0700126 vpp/api/summary_stats_client.c
Damjan Marion7cd468a2016-12-19 23:05:39 +0100127
128bin_summary_stats_client_LDADD = \
Keith Burns (alagalah)8a19f122017-08-06 08:26:29 -0700129 libvlibmemoryclient.la \
130 libsvm.la \
131 libvppinfra.la \
132 -lpthread -lm -lrt
Damjan Marion7cd468a2016-12-19 23:05:39 +0100133
Dave Barach048a4e52018-06-01 18:52:25 -0400134noinst_PROGRAMS += bin/stat_client
135
136bin_stat_client_SOURCES = \
137 vpp/app/stat_client.c \
138 vpp/app/stat_client.h
139
140bin_stat_client_LDADD = \
141 libvlibmemoryclient.la \
142 libsvm.la \
143 libvppinfra.la \
144 -lpthread -lm -lrt
145
146
147
Damjan Marion7cd468a2016-12-19 23:05:39 +0100148bin_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
Burt Silverman006eb472017-01-27 15:29:54 -0500159CLEANFILES += vpp/app/version.h
160
Damjan Marion7cd468a2016-12-19 23:05:39 +0100161# vi:syntax=automake