blob: 0e9ddb045c60bde32c31446da63c8650e1de4ef6 [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 \
Neale Rannsb8d44812017-11-10 06:53:54 -080021 vpp/oam/oam_api.c \
Damjan Marion7cd468a2016-12-19 23:05:39 +010022 vpp/stats/stats.c
23
24bin_vpp_SOURCES += \
25 vpp/api/api.c \
26 vpp/api/custom_dump.c \
27 vpp/api/json_format.c
28
29if WITH_APICLI
30 bin_vpp_SOURCES += \
31 vpp/api/api_format.c \
Dave Barachfe6bdfd2017-01-20 19:50:09 -050032 vpp/api/api_main.c \
33 vpp/api/plugin.c \
34 vpp/api/plugin.h
Damjan Marion7cd468a2016-12-19 23:05:39 +010035endif
36
Dave Wallaced756b352017-07-03 13:11:38 -040037# uncomment to enable stats upload to gmond
38# bin_vpp_SOURCES += \
39# vpp/api/gmon.c
Damjan Marion7cd468a2016-12-19 23:05:39 +010040
41bin_vpp_CFLAGS = @APICLI@
Damjan Marion7cd468a2016-12-19 23:05:39 +010042
43nobase_include_HEADERS += \
44 vpp/api/vpe_all_api_h.h \
45 vpp/api/vpe_msg_enum.h \
Keith Burns (alagalah)8a19f122017-08-06 08:26:29 -070046 vpp/stats/stats.api.h \
Neale Rannsb8d44812017-11-10 06:53:54 -080047 vpp/oam/oam.api.h \
Damjan Marion7cd468a2016-12-19 23:05:39 +010048 vpp/api/vpe.api.h
49
Neale Rannsb8d44812017-11-10 06:53:54 -080050API_FILES += \
51 vpp/api/vpe.api \
52 vpp/stats/stats.api \
53 vpp/oam/oam.api
Damjan Marion7cd468a2016-12-19 23:05:39 +010054
Damjan Marion45a00c42017-01-08 15:34:50 +010055BUILT_SOURCES += .version
Damjan Marion7cd468a2016-12-19 23:05:39 +010056
57vpp/app/version.o: vpp/app/version.h
58
Damjan Marion45a00c42017-01-08 15:34:50 +010059.PHONY: .version
Damjan Marion7cd468a2016-12-19 23:05:39 +010060
Damjan Marion45a00c42017-01-08 15:34:50 +010061VPP_VERSION = $(shell $(srcdir)/scripts/version)
62
Marco Varlesedf82ec82017-05-03 17:37:46 +020063VPP_BUILD_DATE ?= $$(date)
64VPP_BUILD_USER ?= $$(whoami)
65VPP_BUILD_HOST ?= $$(hostname)
66
Damjan Marion45a00c42017-01-08 15:34:50 +010067# update version.h only when version changes, to avoid
68# unnecessary re-linking of vpp binary
69
70.version:
71 @if [ "$$(cat .version 2> /dev/null)" != "$(VPP_VERSION)" ] ; then \
72 f="vpp/app/version.h" ;\
73 echo " VERSION $$f ($(VPP_VERSION))" ;\
74 echo $(VPP_VERSION) > .version ;\
Marco Varlesedf82ec82017-05-03 17:37:46 +020075 echo "#define VPP_BUILD_DATE \"$(VPP_BUILD_DATE)\"" > $$f ;\
76 echo "#define VPP_BUILD_USER \"$(VPP_BUILD_USER)\"" >> $$f ;\
77 echo "#define VPP_BUILD_HOST \"$(VPP_BUILD_HOST)\"" >> $$f ;\
Damjan Marion45a00c42017-01-08 15:34:50 +010078 echo -n "#define VPP_BUILD_TOPDIR " >> $$f ;\
79 echo "\"$$(cd $(srcdir) && git rev-parse --show-toplevel)\"" >> $$f ;\
80 echo "#define VPP_BUILD_VER \"$(VPP_VERSION)\"" >> $$f ;\
81 fi
82
Damjan Marion7cd468a2016-12-19 23:05:39 +010083bin_vpp_LDADD = \
Damjan Marion7cd468a2016-12-19 23:05:39 +010084 libvlibmemory.la \
Damjan Marion7cd468a2016-12-19 23:05:39 +010085 libvlib.la \
86 libvnet.la \
87 libsvm.la \
88 libsvmdb.la \
Damjan Marionc74a86a2017-01-16 14:00:03 +010089 libvppinfra.la \
90 -lrt -lm -lpthread -ldl
Damjan Marion7cd468a2016-12-19 23:05:39 +010091
Dave Barachfe6bdfd2017-01-20 19:50:09 -050092bin_vpp_LDFLAGS = -Wl,--export-dynamic
93
Damjan Marionaad20982017-06-20 16:35:29 +020094bin_PROGRAMS += bin/vppctl
95bin_vppctl_SOURCES = vpp/app/vppctl.c
96bin_vppctl_LDADD = libvppinfra.la
97
Damjan Marion724f64c2017-01-11 11:11:00 +010098if ENABLE_TESTS
Damjan Marion7cd468a2016-12-19 23:05:39 +010099noinst_PROGRAMS += bin/test_client
100
101bin_test_client_SOURCES = \
102 vpp/api/test_client.c
103
104bin_test_client_LDADD = \
105 libvlibmemoryclient.la \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100106 libsvm.la \
107 libvppinfra.la \
108 -lpthread -lm -lrt
109
110noinst_PROGRAMS += bin/test_client bin/test_ha
111
112bin_test_ha_SOURCES = \
113 vpp/api/test_ha.c
114
115bin_test_ha_LDADD = \
116 libvlibmemoryclient.la \
Damjan Marion7cd468a2016-12-19 23:05:39 +0100117 libsvm.la \
118 libvppinfra.la \
119 -lpthread -lm -lrt
Damjan Marion724f64c2017-01-11 11:11:00 +0100120endif
Damjan Marion7cd468a2016-12-19 23:05:39 +0100121
122noinst_PROGRAMS += bin/summary_stats_client
123
124bin_summary_stats_client_SOURCES = \
Keith Burns (alagalah)8a19f122017-08-06 08:26:29 -0700125 vpp/api/summary_stats_client.c
Damjan Marion7cd468a2016-12-19 23:05:39 +0100126
127bin_summary_stats_client_LDADD = \
Keith Burns (alagalah)8a19f122017-08-06 08:26:29 -0700128 libvlibmemoryclient.la \
129 libsvm.la \
130 libvppinfra.la \
131 -lpthread -lm -lrt
Damjan Marion7cd468a2016-12-19 23:05:39 +0100132
133bin_PROGRAMS += bin/vpp_get_metrics
134
135bin_vpp_get_metrics_SOURCES = \
136 vpp/api/vpp_get_metrics.c
137
138bin_vpp_get_metrics_LDADD = \
139 libsvmdb.la \
140 libsvm.la \
141 libvppinfra.la \
142 -lpthread -lm -lrt
143
Burt Silverman006eb472017-01-27 15:29:54 -0500144CLEANFILES += vpp/app/version.h
145
Damjan Marion7cd468a2016-12-19 23:05:39 +0100146# vi:syntax=automake