X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=Makefile;h=46c51dd891e0e919c18318f511f44397cebaa362;hb=d756b35032cdf7fdaaf0d6611388a54d32d72e92;hp=1b51d8f386951080d9d6addeca2f78daf24b38fb;hpb=d6ad5a51130018113648f4c7220996b2c43c8cfb;p=vpp.git diff --git a/Makefile b/Makefile index 1b51d8f3869..46c51dd891e 100644 --- a/Makefile +++ b/Makefile @@ -16,8 +16,27 @@ export BR=$(WS_ROOT)/build-root CCACHE_DIR?=$(BR)/.ccache GDB?=gdb PLATFORM?=vpp +SAMPLE_PLUGIN?=no + +,:=, +define disable_plugins +$(if $(1), \ + "plugins {" \ + $(patsubst %,"plugin %_plugin.so { disable }",$(subst $(,), ,$(1))) \ + " }" \ + ,) +endef -MINIMAL_STARTUP_CONF="unix { interactive }" +MINIMAL_STARTUP_CONF=" \ +unix { \ + interactive \ + cli-listen /run/vpp/cli.sock \ + gid $(shell id -g) \ + $(if $(wildcard startup.vpp),"exec startup.vpp",) \ +} \ +$(if $(DPDK_CONFIG), "dpdk { $(DPDK_CONFIG) }",) \ +$(call disable_plugins,$(DISABLED_PLUGINS)) \ +" GDB_ARGS= -ex "handle SIGUSR1 noprint nostop" @@ -36,8 +55,10 @@ else ifeq ($(filter rhel centos fedora opensuse,$(OS_ID)),$(OS_ID)) PKG=rpm endif +# +libganglia1-dev if building the gmond plugin + DEB_DEPENDS = curl build-essential autoconf automake bison libssl-dev ccache -DEB_DEPENDS += debhelper dkms git libtool libganglia1-dev libapr1-dev dh-systemd +DEB_DEPENDS += debhelper dkms git libtool libapr1-dev dh-systemd DEB_DEPENDS += libconfuse-dev git-review exuberant-ctags cscope pkg-config DEB_DEPENDS += lcov chrpath autoconf nasm indent DEB_DEPENDS += python-all python-dev python-virtualenv python-pip libffi6 @@ -60,9 +81,12 @@ else RPM_DEPENDS += python-virtualenv RPM_DEPENDS_GROUPS = 'Development Tools' endif + +# +ganglia-devel if building the ganglia plugin + RPM_DEPENDS += chrpath libffi-devel rpm-build RPM_DEPENDS += https://kojipkgs.fedoraproject.org//packages/nasm/2.12.02/2.fc26/x86_64/nasm-2.12.02-2.fc26.x86_64.rpm -EPEL_DEPENDS = libconfuse-devel ganglia-devel epel-rpm-macros +EPEL_DEPENDS = libconfuse-devel epel-rpm-macros ifeq ($(filter rhel centos,$(OS_ID)),$(OS_ID)) EPEL_DEPENDS += lcov else @@ -82,6 +106,12 @@ CONFIRM=-y FORCE=--force-yes endif +TARGETS = vpp + +ifneq ($(SAMPLE_PLUGIN),no) +TARGETS += sample-plugin +endif + .PHONY: help bootstrap wipe wipe-release build build-release rebuild rebuild-release .PHONY: run run-release debug debug-release build-vat run-vat pkg-deb pkg-rpm .PHONY: ctags cscope @@ -132,23 +162,32 @@ help: @echo " test-checkstyle - check PEP8 compliance for test framework" @echo "" @echo "Make Arguments:" - @echo " V=[0|1] - set build verbosity level" - @echo " STARTUP_CONF= - startup configuration file" - @echo " (e.g. /etc/vpp/startup.conf)" - @echo " STARTUP_DIR= - startup drectory (e.g. /etc/vpp)" - @echo " It also sets STARTUP_CONF if" - @echo " startup.conf file is present" - @echo " GDB= - gdb binary to use for debugging" - @echo " PLATFORM= - target platform. default is vpp" - @echo " TEST= - apply filter to test set, see test-help" + @echo " V=[0|1] - set build verbosity level" + @echo " STARTUP_CONF= - startup configuration file" + @echo " (e.g. /etc/vpp/startup.conf)" + @echo " STARTUP_DIR= - startup drectory (e.g. /etc/vpp)" + @echo " It also sets STARTUP_CONF if" + @echo " startup.conf file is present" + @echo " GDB= - gdb binary to use for debugging" + @echo " PLATFORM= - target platform. default is vpp" + @echo " TEST= - apply filter to test set, see test-help" + @echo " DPDK_CONFIG= - add specified dpdk config commands to" + @echo " autogenerated startup.conf" + @echo " (e.g. \"no-pci\" )" + @echo " SAMPLE_PLUGIN=yes - in addition build/run/debug sample plugin" + @echo " DISABLED_PLUGINS= - comma separated list of plugins which" + @echo " should not be loaded" @echo "" @echo "Current Argument Values:" - @echo " V = $(V)" - @echo " STARTUP_CONF = $(STARTUP_CONF)" - @echo " STARTUP_DIR = $(STARTUP_DIR)" - @echo " GDB = $(GDB)" - @echo " PLATFORM = $(PLATFORM)" - @echo " DPDK_VERSION = $(DPDK_VERSION)" + @echo " V = $(V)" + @echo " STARTUP_CONF = $(STARTUP_CONF)" + @echo " STARTUP_DIR = $(STARTUP_DIR)" + @echo " GDB = $(GDB)" + @echo " PLATFORM = $(PLATFORM)" + @echo " DPDK_VERSION = $(DPDK_VERSION)" + @echo " DPDK_CONFIG = $(DPDK_CONFIG)" + @echo " SAMPLE_PLUGIN = $(SAMPLE_PLUGIN)" + @echo " DISABLED_PLUGINS = $(DISABLED_PLUGINS)" $(BR)/.bootstrap.ok: ifeq ($(findstring y,$(UNATTENDED)),y) @@ -251,21 +290,21 @@ dist: @ln -rs $(DIST_FILE).xz $(BR)/vpp-latest.tar.xz build: $(BR)/.bootstrap.ok - $(call make,$(PLATFORM)_debug,vpp-install) + $(call make,$(PLATFORM)_debug,$(addsuffix -install,$(TARGETS))) wipedist: @$(RM) $(BR)/*.tar.xz wipe: wipedist $(BR)/.bootstrap.ok - $(call make,$(PLATFORM)_debug,vpp-wipe) + $(call make,$(PLATFORM)_debug,$(addsuffix -wipe,$(TARGETS))) rebuild: wipe build build-release: $(BR)/.bootstrap.ok - $(call make,$(PLATFORM),vpp-install) + $(call make,$(PLATFORM),$(addsuffix -install,$(TARGETS))) wipe-release: $(BR)/.bootstrap.ok - $(call make,$(PLATFORM),vpp-wipe) + $(call make,$(PLATFORM),$(addsuffix -wipe,$(TARGETS))) rebuild-release: wipe-release build-release @@ -342,12 +381,14 @@ define run @echo "WARNING: STARTUP_CONF not defined or file doesn't exist." @echo " Running with minimal startup config: $(MINIMAL_STARTUP_CONF)\n" @cd $(STARTUP_DIR) && \ - sudo $(2) $(1)/vpp/bin/vpp $(MINIMAL_STARTUP_CONF) plugin_path $(wildcard $(1)/vpp/lib*/vpp_plugins) + sudo $(2) $(1)/vpp/bin/vpp $(MINIMAL_STARTUP_CONF) \ + plugin_path $(subst $(subst ,, ),:,$(wildcard $(1)/*/lib*/vpp_plugins)) endef else define run @cd $(STARTUP_DIR) && \ - sudo $(2) $(1)/vpp/bin/vpp $(shell cat $(STARTUP_CONF) | sed -e 's/#.*//') plugin_path $(wildcard $(1)/vpp/lib*/vpp_plugins) + sudo $(2) $(1)/vpp/bin/vpp $(shell cat $(STARTUP_CONF) | sed -e 's/#.*//') \ + plugin_path $(subst $(subst ,, ),:,$(wildcard $(1)/*/lib*/vpp_plugins)) endef endif