Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 1 | # 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 Barach | 048a4e5 | 2018-06-01 18:52:25 -0400 | [diff] [blame] | 14 | bin_PROGRAMS += bin/vpp |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 15 | |
| 16 | bin_vpp_SOURCES = \ |
| 17 | vpp/vnet/main.c \ |
| 18 | vpp/app/vpe_cli.c \ |
| 19 | vpp/app/version.c \ |
| 20 | vpp/oam/oam.c \ |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 21 | vpp/oam/oam_api.c \ |
Dave Barach | 048a4e5 | 2018-06-01 18:52:25 -0400 | [diff] [blame] | 22 | vpp/stats/stats.c \ |
| 23 | vpp/stats/stat_segment.c |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 24 | |
| 25 | bin_vpp_SOURCES += \ |
| 26 | vpp/api/api.c \ |
| 27 | vpp/api/custom_dump.c \ |
| 28 | vpp/api/json_format.c |
| 29 | |
| 30 | if WITH_APICLI |
| 31 | bin_vpp_SOURCES += \ |
| 32 | vpp/api/api_format.c \ |
Dave Barach | fe6bdfd | 2017-01-20 19:50:09 -0500 | [diff] [blame] | 33 | vpp/api/api_main.c \ |
| 34 | vpp/api/plugin.c \ |
| 35 | vpp/api/plugin.h |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 36 | endif |
| 37 | |
Dave Wallace | d756b35 | 2017-07-03 13:11:38 -0400 | [diff] [blame] | 38 | # uncomment to enable stats upload to gmond |
| 39 | # bin_vpp_SOURCES += \ |
| 40 | # vpp/api/gmon.c |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 41 | |
Damjan Marion | 5f21e1b | 2018-08-01 14:38:36 +0200 | [diff] [blame] | 42 | bin_vpp_CFLAGS = @APICLI@ |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 43 | |
| 44 | nobase_include_HEADERS += \ |
| 45 | vpp/api/vpe_all_api_h.h \ |
| 46 | vpp/api/vpe_msg_enum.h \ |
Keith Burns (alagalah) | 8a19f12 | 2017-08-06 08:26:29 -0700 | [diff] [blame] | 47 | vpp/stats/stats.api.h \ |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 48 | vpp/oam/oam.api.h \ |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 49 | vpp/api/vpe.api.h |
| 50 | |
Neale Ranns | b8d4481 | 2017-11-10 06:53:54 -0800 | [diff] [blame] | 51 | API_FILES += \ |
| 52 | vpp/api/vpe.api \ |
| 53 | vpp/stats/stats.api \ |
| 54 | vpp/oam/oam.api |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 55 | |
Damjan Marion | 45a00c4 | 2017-01-08 15:34:50 +0100 | [diff] [blame] | 56 | BUILT_SOURCES += .version |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 57 | |
| 58 | vpp/app/version.o: vpp/app/version.h |
| 59 | |
Damjan Marion | 45a00c4 | 2017-01-08 15:34:50 +0100 | [diff] [blame] | 60 | .PHONY: .version |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 61 | |
Damjan Marion | 45a00c4 | 2017-01-08 15:34:50 +0100 | [diff] [blame] | 62 | VPP_VERSION = $(shell $(srcdir)/scripts/version) |
| 63 | |
Marco Varlese | df82ec8 | 2017-05-03 17:37:46 +0200 | [diff] [blame] | 64 | VPP_BUILD_DATE ?= $$(date) |
| 65 | VPP_BUILD_USER ?= $$(whoami) |
| 66 | VPP_BUILD_HOST ?= $$(hostname) |
| 67 | |
Damjan Marion | 45a00c4 | 2017-01-08 15:34:50 +0100 | [diff] [blame] | 68 | # 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 Varlese | df82ec8 | 2017-05-03 17:37:46 +0200 | [diff] [blame] | 76 | 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 Marion | 45a00c4 | 2017-01-08 15:34:50 +0100 | [diff] [blame] | 79 | 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 Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 84 | bin_vpp_LDADD = \ |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 85 | libvlibmemory.la \ |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 86 | libvlib.la \ |
| 87 | libvnet.la \ |
| 88 | libsvm.la \ |
| 89 | libsvmdb.la \ |
Damjan Marion | c74a86a | 2017-01-16 14:00:03 +0100 | [diff] [blame] | 90 | libvppinfra.la \ |
| 91 | -lrt -lm -lpthread -ldl |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 92 | |
Dave Barach | fe6bdfd | 2017-01-20 19:50:09 -0500 | [diff] [blame] | 93 | bin_vpp_LDFLAGS = -Wl,--export-dynamic |
| 94 | |
Damjan Marion | aad2098 | 2017-06-20 16:35:29 +0200 | [diff] [blame] | 95 | bin_PROGRAMS += bin/vppctl |
| 96 | bin_vppctl_SOURCES = vpp/app/vppctl.c |
| 97 | bin_vppctl_LDADD = libvppinfra.la |
| 98 | |
Damjan Marion | 724f64c | 2017-01-11 11:11:00 +0100 | [diff] [blame] | 99 | if ENABLE_TESTS |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 100 | noinst_PROGRAMS += bin/test_client |
| 101 | |
| 102 | bin_test_client_SOURCES = \ |
| 103 | vpp/api/test_client.c |
| 104 | |
| 105 | bin_test_client_LDADD = \ |
| 106 | libvlibmemoryclient.la \ |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 107 | libsvm.la \ |
| 108 | libvppinfra.la \ |
| 109 | -lpthread -lm -lrt |
| 110 | |
| 111 | noinst_PROGRAMS += bin/test_client bin/test_ha |
| 112 | |
| 113 | bin_test_ha_SOURCES = \ |
| 114 | vpp/api/test_ha.c |
| 115 | |
| 116 | bin_test_ha_LDADD = \ |
| 117 | libvlibmemoryclient.la \ |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 118 | libsvm.la \ |
| 119 | libvppinfra.la \ |
| 120 | -lpthread -lm -lrt |
Damjan Marion | 724f64c | 2017-01-11 11:11:00 +0100 | [diff] [blame] | 121 | endif |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 122 | |
| 123 | noinst_PROGRAMS += bin/summary_stats_client |
| 124 | |
| 125 | bin_summary_stats_client_SOURCES = \ |
Keith Burns (alagalah) | 8a19f12 | 2017-08-06 08:26:29 -0700 | [diff] [blame] | 126 | vpp/api/summary_stats_client.c |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 127 | |
| 128 | bin_summary_stats_client_LDADD = \ |
Keith Burns (alagalah) | 8a19f12 | 2017-08-06 08:26:29 -0700 | [diff] [blame] | 129 | libvlibmemoryclient.la \ |
| 130 | libsvm.la \ |
| 131 | libvppinfra.la \ |
| 132 | -lpthread -lm -lrt |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 133 | |
Dave Barach | 048a4e5 | 2018-06-01 18:52:25 -0400 | [diff] [blame] | 134 | noinst_PROGRAMS += bin/stat_client |
| 135 | |
| 136 | bin_stat_client_SOURCES = \ |
| 137 | vpp/app/stat_client.c \ |
| 138 | vpp/app/stat_client.h |
| 139 | |
| 140 | bin_stat_client_LDADD = \ |
| 141 | libvlibmemoryclient.la \ |
| 142 | libsvm.la \ |
| 143 | libvppinfra.la \ |
| 144 | -lpthread -lm -lrt |
| 145 | |
| 146 | |
| 147 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 148 | bin_PROGRAMS += bin/vpp_get_metrics |
| 149 | |
| 150 | bin_vpp_get_metrics_SOURCES = \ |
| 151 | vpp/api/vpp_get_metrics.c |
| 152 | |
| 153 | bin_vpp_get_metrics_LDADD = \ |
| 154 | libsvmdb.la \ |
| 155 | libsvm.la \ |
| 156 | libvppinfra.la \ |
| 157 | -lpthread -lm -lrt |
| 158 | |
Burt Silverman | 006eb47 | 2017-01-27 15:29:54 -0500 | [diff] [blame] | 159 | CLEANFILES += vpp/app/version.h |
| 160 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 161 | # vi:syntax=automake |