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