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 \ |
| 31 | vpp/api/api_main.c |
| 32 | endif |
| 33 | |
| 34 | # comment out to disable stats upload to gmond |
| 35 | |
| 36 | bin_vpp_CFLAGS = @APICLI@ |
| 37 | bin_vpp_SOURCES += \ |
| 38 | vpp/api/gmon.c |
| 39 | |
| 40 | nobase_include_HEADERS += \ |
| 41 | vpp/api/vpe_all_api_h.h \ |
| 42 | vpp/api/vpe_msg_enum.h \ |
| 43 | vpp/api/vpe.api.h |
| 44 | |
| 45 | API_FILES += vpp/api/vpe.api |
| 46 | |
Damjan Marion | 45a00c4 | 2017-01-08 15:34:50 +0100 | [diff] [blame] | 47 | BUILT_SOURCES += .version |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 48 | |
| 49 | vpp/app/version.o: vpp/app/version.h |
| 50 | |
Damjan Marion | 45a00c4 | 2017-01-08 15:34:50 +0100 | [diff] [blame] | 51 | .PHONY: .version |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 52 | |
Damjan Marion | 45a00c4 | 2017-01-08 15:34:50 +0100 | [diff] [blame] | 53 | VPP_VERSION = $(shell $(srcdir)/scripts/version) |
| 54 | |
| 55 | # update version.h only when version changes, to avoid |
| 56 | # unnecessary re-linking of vpp binary |
| 57 | |
| 58 | .version: |
| 59 | @if [ "$$(cat .version 2> /dev/null)" != "$(VPP_VERSION)" ] ; then \ |
| 60 | f="vpp/app/version.h" ;\ |
| 61 | echo " VERSION $$f ($(VPP_VERSION))" ;\ |
| 62 | echo $(VPP_VERSION) > .version ;\ |
| 63 | echo "#define VPP_BUILD_DATE \"$$(date)\"" > $$f ;\ |
| 64 | echo "#define VPP_BUILD_USER \"$$(whoami)\"" >> $$f ;\ |
| 65 | echo "#define VPP_BUILD_HOST \"$$(hostname)\"" >> $$f ;\ |
| 66 | echo -n "#define VPP_BUILD_TOPDIR " >> $$f ;\ |
| 67 | echo "\"$$(cd $(srcdir) && git rev-parse --show-toplevel)\"" >> $$f ;\ |
| 68 | echo "#define VPP_BUILD_VER \"$(VPP_VERSION)\"" >> $$f ;\ |
| 69 | fi |
| 70 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 71 | |
| 72 | # Generate a plugin configuration script. Misconfiguring a |
| 73 | # plugin can cause very subtle problems. |
| 74 | |
| 75 | bin_SCRIPTS = vpp_plugin_configure |
| 76 | |
| 77 | BUILT_SOURCES += vpp_plugin_configure |
| 78 | |
| 79 | .PHONY: vpp_plugin_configure |
| 80 | |
| 81 | if WITH_DPDK |
| 82 | PLUGIN_DPDK_ARG="--with-dpdk" |
| 83 | else |
| 84 | PLUGIN_DPDK_ARG="" |
| 85 | endif |
| 86 | |
| 87 | vpp_plugin_configure: |
Damjan Marion | cb034b9 | 2016-12-28 18:38:59 +0100 | [diff] [blame] | 88 | @echo "PLUGIN CFG" $@ |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 89 | @echo "#!/bin/bash" > $@ |
| 90 | @echo " " >> $@ |
| 91 | @echo "set +eu" >> $@ |
| 92 | @echo " " >> $@ |
| 93 | @echo "if [ -f ./configure ] ; then" >> $@ |
| 94 | @echo " CFLAGS='$(CFLAGS) $(AM_CFLAGS) -I/usr/include/vpp-dpdk' ./configure --with-plugin-toolkit $(PLUGIN_DPDK_ARG)" >> $@ |
| 95 | @echo "else" >> $@ |
| 96 | @echo " if [ -f ../configure ] ; then" >> $@ |
| 97 | @echo " CFLAGS='$(CFLAGS) $(AM_CFLAGS) -I/usr/include/vpp-dpdk' ../configure --with-plugin-toolkit $(PLUGIN_DPDK_ARG)" >> $@ |
| 98 | @echo " else" >> $@ |
| 99 | @echo " echo Couldnt find ./configure or ../configure " >> $@ |
| 100 | @echo " exit 1" >> $@ |
| 101 | @echo " fi" >> $@ |
| 102 | @echo "fi" >> $@ |
| 103 | |
| 104 | bin_vpp_LDADD = \ |
| 105 | libvlibapi.la \ |
| 106 | libvlibmemory.la \ |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 107 | libvlib.la \ |
| 108 | libvnet.la \ |
| 109 | libsvm.la \ |
| 110 | libsvmdb.la \ |
| 111 | libvnetplugin.la \ |
| 112 | -lrt |
| 113 | |
| 114 | bin_vpp_LDFLAGS = $(DPDK_LD_FLAGS) |
| 115 | bin_vpp_LDADD += libvppinfra.la -lm -lpthread -ldl $(DPDK_LD_ADD) |
| 116 | |
Damjan Marion | 7cd468a | 2016-12-19 23:05:39 +0100 | [diff] [blame] | 117 | noinst_PROGRAMS += bin/test_client |
| 118 | |
| 119 | bin_test_client_SOURCES = \ |
| 120 | vpp/api/test_client.c |
| 121 | |
| 122 | bin_test_client_LDADD = \ |
| 123 | libvlibmemoryclient.la \ |
| 124 | libvlibapi.la \ |
| 125 | libsvm.la \ |
| 126 | libvppinfra.la \ |
| 127 | -lpthread -lm -lrt |
| 128 | |
| 129 | noinst_PROGRAMS += bin/test_client bin/test_ha |
| 130 | |
| 131 | bin_test_ha_SOURCES = \ |
| 132 | vpp/api/test_ha.c |
| 133 | |
| 134 | bin_test_ha_LDADD = \ |
| 135 | libvlibmemoryclient.la \ |
| 136 | libvlibapi.la \ |
| 137 | libsvmdb.la \ |
| 138 | libsvm.la \ |
| 139 | libvppinfra.la \ |
| 140 | -lpthread -lm -lrt |
| 141 | |
| 142 | noinst_PROGRAMS += bin/summary_stats_client |
| 143 | |
| 144 | bin_summary_stats_client_SOURCES = \ |
| 145 | vpp/api/summary_stats_client.c |
| 146 | |
| 147 | bin_summary_stats_client_LDADD = \ |
| 148 | libvlibmemoryclient.la \ |
| 149 | libvlibapi.la \ |
| 150 | libsvm.la \ |
| 151 | libvppinfra.la \ |
| 152 | -lpthread -lm -lrt |
| 153 | |
| 154 | bin_PROGRAMS += bin/vpp_get_metrics |
| 155 | |
| 156 | bin_vpp_get_metrics_SOURCES = \ |
| 157 | vpp/api/vpp_get_metrics.c |
| 158 | |
| 159 | bin_vpp_get_metrics_LDADD = \ |
| 160 | libsvmdb.la \ |
| 161 | libsvm.la \ |
| 162 | libvppinfra.la \ |
| 163 | -lpthread -lm -lrt |
| 164 | |
| 165 | # vi:syntax=automake |