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 \ |
| 21 | vpp/stats/stats.c |
| 22 | |
| 23 | bin_vpp_SOURCES += \ |
| 24 | vpp/api/api.c \ |
| 25 | vpp/api/custom_dump.c \ |
| 26 | vpp/api/json_format.c |
| 27 | |
| 28 | if WITH_APICLI |
| 29 | bin_vpp_SOURCES += \ |
| 30 | vpp/api/api_format.c \ |
Dave Barach | fe6bdfd | 2017-01-20 19:50:09 -0500 | [diff] [blame] | 31 | vpp/api/api_main.c \ |
| 32 | vpp/api/plugin.c \ |
| 33 | vpp/api/plugin.h |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 34 | endif |
| 35 | |
| 36 | # comment out to disable stats upload to gmond |
| 37 | |
| 38 | bin_vpp_CFLAGS = @APICLI@ |
| 39 | bin_vpp_SOURCES += \ |
| 40 | vpp/api/gmon.c |
| 41 | |
| 42 | nobase_include_HEADERS += \ |
| 43 | vpp/api/vpe_all_api_h.h \ |
| 44 | vpp/api/vpe_msg_enum.h \ |
| 45 | vpp/api/vpe.api.h |
| 46 | |
| 47 | API_FILES += vpp/api/vpe.api |
| 48 | |
Damjan Marion | 45a00c4 | 2017-01-08 15:34:50 +0100 | [diff] [blame] | 49 | BUILT_SOURCES += .version |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 50 | |
| 51 | vpp/app/version.o: vpp/app/version.h |
| 52 | |
Damjan Marion | 45a00c4 | 2017-01-08 15:34:50 +0100 | [diff] [blame] | 53 | .PHONY: .version |
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 | VPP_VERSION = $(shell $(srcdir)/scripts/version) |
| 56 | |
| 57 | # update version.h only when version changes, to avoid |
| 58 | # unnecessary re-linking of vpp binary |
| 59 | |
| 60 | .version: |
| 61 | @if [ "$$(cat .version 2> /dev/null)" != "$(VPP_VERSION)" ] ; then \ |
| 62 | f="vpp/app/version.h" ;\ |
| 63 | echo " VERSION $$f ($(VPP_VERSION))" ;\ |
| 64 | echo $(VPP_VERSION) > .version ;\ |
| 65 | echo "#define VPP_BUILD_DATE \"$$(date)\"" > $$f ;\ |
| 66 | echo "#define VPP_BUILD_USER \"$$(whoami)\"" >> $$f ;\ |
| 67 | echo "#define VPP_BUILD_HOST \"$$(hostname)\"" >> $$f ;\ |
| 68 | echo -n "#define VPP_BUILD_TOPDIR " >> $$f ;\ |
| 69 | echo "\"$$(cd $(srcdir) && git rev-parse --show-toplevel)\"" >> $$f ;\ |
| 70 | echo "#define VPP_BUILD_VER \"$(VPP_VERSION)\"" >> $$f ;\ |
| 71 | fi |
| 72 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 73 | bin_vpp_LDADD = \ |
| 74 | libvlibapi.la \ |
| 75 | libvlibmemory.la \ |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 76 | libvlib.la \ |
| 77 | libvnet.la \ |
| 78 | libsvm.la \ |
| 79 | libsvmdb.la \ |
Damjan Marion | c74a86a | 2017-01-16 14:00:03 +0100 | [diff] [blame] | 80 | libvppinfra.la \ |
| 81 | -lrt -lm -lpthread -ldl |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 82 | |
Dave Barach | fe6bdfd | 2017-01-20 19:50:09 -0500 | [diff] [blame] | 83 | bin_vpp_LDFLAGS = -Wl,--export-dynamic |
| 84 | |
Damjan Marion | 724f64c | 2017-01-11 11:11:00 +0100 | [diff] [blame] | 85 | if ENABLE_TESTS |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 86 | noinst_PROGRAMS += bin/test_client |
| 87 | |
| 88 | bin_test_client_SOURCES = \ |
| 89 | vpp/api/test_client.c |
| 90 | |
| 91 | bin_test_client_LDADD = \ |
| 92 | libvlibmemoryclient.la \ |
| 93 | libvlibapi.la \ |
| 94 | libsvm.la \ |
| 95 | libvppinfra.la \ |
| 96 | -lpthread -lm -lrt |
| 97 | |
| 98 | noinst_PROGRAMS += bin/test_client bin/test_ha |
| 99 | |
| 100 | bin_test_ha_SOURCES = \ |
| 101 | vpp/api/test_ha.c |
| 102 | |
| 103 | bin_test_ha_LDADD = \ |
| 104 | libvlibmemoryclient.la \ |
| 105 | libvlibapi.la \ |
| 106 | libsvmdb.la \ |
| 107 | libsvm.la \ |
| 108 | libvppinfra.la \ |
| 109 | -lpthread -lm -lrt |
Damjan Marion | 724f64c | 2017-01-11 11:11:00 +0100 | [diff] [blame] | 110 | endif |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 111 | |
| 112 | noinst_PROGRAMS += bin/summary_stats_client |
| 113 | |
| 114 | bin_summary_stats_client_SOURCES = \ |
| 115 | vpp/api/summary_stats_client.c |
| 116 | |
| 117 | bin_summary_stats_client_LDADD = \ |
| 118 | libvlibmemoryclient.la \ |
| 119 | libvlibapi.la \ |
| 120 | libsvm.la \ |
| 121 | libvppinfra.la \ |
| 122 | -lpthread -lm -lrt |
| 123 | |
| 124 | bin_PROGRAMS += bin/vpp_get_metrics |
| 125 | |
| 126 | bin_vpp_get_metrics_SOURCES = \ |
| 127 | vpp/api/vpp_get_metrics.c |
| 128 | |
| 129 | bin_vpp_get_metrics_LDADD = \ |
| 130 | libsvmdb.la \ |
| 131 | libsvm.la \ |
| 132 | libvppinfra.la \ |
| 133 | -lpthread -lm -lrt |
| 134 | |
| 135 | # vi:syntax=automake |