blob: 9a07cefe2c06afaff1be6f7d9a64e948559991a3 [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 \
Dave Barachfe6bdfd2017-01-20 19:50:09 -050031 vpp/api/api_main.c \
32 vpp/api/plugin.c \
33 vpp/api/plugin.h
Damjan Marion7cd468a2016-12-19 23:05:39 +010034endif
35
Dave Wallaced756b352017-07-03 13:11:38 -040036# uncomment to enable stats upload to gmond
37# bin_vpp_SOURCES += \
38# vpp/api/gmon.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010039
40bin_vpp_CFLAGS = @APICLI@
Damjan Marion7cd468a2016-12-19 23:05:39 +010041
42nobase_include_HEADERS += \
43 vpp/api/vpe_all_api_h.h \
44 vpp/api/vpe_msg_enum.h \
Keith Burns (alagalah)8a19f122017-08-06 08:26:29 -070045 vpp/stats/stats.api.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +010046 vpp/api/vpe.api.h
47
48API_FILES += vpp/api/vpe.api
Keith Burns (alagalah)8a19f122017-08-06 08:26:29 -070049API_FILES += vpp/stats/stats.api
Damjan Marion7cd468a2016-12-19 23:05:39 +010050
Damjan Marion45a00c42017-01-08 15:34:50 +010051BUILT_SOURCES += .version
Damjan Marion7cd468a2016-12-19 23:05:39 +010052
53vpp/app/version.o: vpp/app/version.h
54
Damjan Marion45a00c42017-01-08 15:34:50 +010055.PHONY: .version
Damjan Marion7cd468a2016-12-19 23:05:39 +010056
Damjan Marion45a00c42017-01-08 15:34:50 +010057VPP_VERSION = $(shell $(srcdir)/scripts/version)
58
Marco Varlesedf82ec82017-05-03 17:37:46 +020059VPP_BUILD_DATE ?= $$(date)
60VPP_BUILD_USER ?= $$(whoami)
61VPP_BUILD_HOST ?= $$(hostname)
62
Damjan Marion45a00c42017-01-08 15:34:50 +010063# update version.h only when version changes, to avoid
64# unnecessary re-linking of vpp binary
65
66.version:
67 @if [ "$$(cat .version 2> /dev/null)" != "$(VPP_VERSION)" ] ; then \
68 f="vpp/app/version.h" ;\
69 echo " VERSION $$f ($(VPP_VERSION))" ;\
70 echo $(VPP_VERSION) > .version ;\
Marco Varlesedf82ec82017-05-03 17:37:46 +020071 echo "#define VPP_BUILD_DATE \"$(VPP_BUILD_DATE)\"" > $$f ;\
72 echo "#define VPP_BUILD_USER \"$(VPP_BUILD_USER)\"" >> $$f ;\
73 echo "#define VPP_BUILD_HOST \"$(VPP_BUILD_HOST)\"" >> $$f ;\
Damjan Marion45a00c42017-01-08 15:34:50 +010074 echo -n "#define VPP_BUILD_TOPDIR " >> $$f ;\
75 echo "\"$$(cd $(srcdir) && git rev-parse --show-toplevel)\"" >> $$f ;\
76 echo "#define VPP_BUILD_VER \"$(VPP_VERSION)\"" >> $$f ;\
77 fi
78
Damjan Marion7cd468a2016-12-19 23:05:39 +010079bin_vpp_LDADD = \
Damjan Marion7cd468a2016-12-19 23:05:39 +010080 libvlibmemory.la \
Damjan Marion7cd468a2016-12-19 23:05:39 +010081 libvlib.la \
82 libvnet.la \
83 libsvm.la \
84 libsvmdb.la \
Damjan Marionc74a86a2017-01-16 14:00:03 +010085 libvppinfra.la \
86 -lrt -lm -lpthread -ldl
Damjan Marion7cd468a2016-12-19 23:05:39 +010087
Dave Barachfe6bdfd2017-01-20 19:50:09 -050088bin_vpp_LDFLAGS = -Wl,--export-dynamic
89
Damjan Marionaad20982017-06-20 16:35:29 +020090bin_PROGRAMS += bin/vppctl
91bin_vppctl_SOURCES = vpp/app/vppctl.c
92bin_vppctl_LDADD = libvppinfra.la
93
Damjan Marion724f64c2017-01-11 11:11:00 +010094if ENABLE_TESTS
Damjan Marion7cd468a2016-12-19 23:05:39 +010095noinst_PROGRAMS += bin/test_client
96
97bin_test_client_SOURCES = \
98 vpp/api/test_client.c
99
100bin_test_client_LDADD = \
101 libvlibmemoryclient.la \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100102 libsvm.la \
103 libvppinfra.la \
104 -lpthread -lm -lrt
105
106noinst_PROGRAMS += bin/test_client bin/test_ha
107
108bin_test_ha_SOURCES = \
109 vpp/api/test_ha.c
110
111bin_test_ha_LDADD = \
112 libvlibmemoryclient.la \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100113 libsvm.la \
114 libvppinfra.la \
115 -lpthread -lm -lrt
Damjan Marion724f64c2017-01-11 11:11:00 +0100116endif
Damjan Marion7cd468a2016-12-19 23:05:39 +0100117
118noinst_PROGRAMS += bin/summary_stats_client
119
120bin_summary_stats_client_SOURCES = \
Keith Burns (alagalah)8a19f122017-08-06 08:26:29 -0700121 vpp/api/summary_stats_client.c
Damjan Marion7cd468a2016-12-19 23:05:39 +0100122
123bin_summary_stats_client_LDADD = \
Keith Burns (alagalah)8a19f122017-08-06 08:26:29 -0700124 libvlibmemoryclient.la \
125 libsvm.la \
126 libvppinfra.la \
127 -lpthread -lm -lrt
Damjan Marion7cd468a2016-12-19 23:05:39 +0100128
129bin_PROGRAMS += bin/vpp_get_metrics
130
131bin_vpp_get_metrics_SOURCES = \
132 vpp/api/vpp_get_metrics.c
133
134bin_vpp_get_metrics_LDADD = \
135 libsvmdb.la \
136 libsvm.la \
137 libvppinfra.la \
138 -lpthread -lm -lrt
139
Burt Silverman006eb472017-01-27 15:29:54 -0500140CLEANFILES += vpp/app/version.h
141
Damjan Marion7cd468a2016-12-19 23:05:39 +0100142# vi:syntax=automake