X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=Makefile;h=0d21f335c5fb63b33ea40ad591b134dabcf46c13;hb=31e59d9b01a04d734553136fdbd9e570b5241faf;hp=f78549f423d9c5db4b8d5ea1a0ed6611ec674e42;hpb=0e2e10b77d63196bfb93ae5be1251bbc1a1b561a;p=vpp.git diff --git a/Makefile b/Makefile index f78549f423d..0d21f335c5f 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" @@ -32,7 +51,7 @@ endif ifeq ($(filter ubuntu debian,$(OS_ID)),$(OS_ID)) PKG=deb -else ifeq ($(filter rhel centos fedora,$(OS_ID)),$(OS_ID)) +else ifeq ($(filter rhel centos fedora opensuse,$(OS_ID)),$(OS_ID)) PKG=rpm endif @@ -69,6 +88,10 @@ else RPM_DEPENDS += lcov endif +RPM_SUSE_DEPENDS = autoconf automake bison ccache chrpath distribution-release gcc6 glibc-devel-static +RPM_SUSE_DEPENDS += java-1_8_0-openjdk-devel libopenssl-devel libtool lsb-release make openssl-devel +RPM_SUSE_DEPENDS += python-devel python-pip python-rpm-macros shadow + ifneq ($(wildcard $(STARTUP_DIR)/startup.conf),) STARTUP_CONF ?= $(STARTUP_DIR)/startup.conf endif @@ -78,6 +101,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 @@ -128,23 +157,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) @@ -210,6 +248,8 @@ else ifneq ("$(wildcard /etc/redhat-release)","") @sudo -E yum install $(CONFIRM) $(RPM_DEPENDS) @sudo -E yum install $(CONFIRM) --enablerepo=epel $(EPEL_DEPENDS) @sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs zlib +else ifeq ($(filter opensuse,$(OS_ID)),$(OS_ID)) + @sudo -E zypper -n install -y $(RPM_SUSE_DEPENDS) else $(error "This option currently works only on Ubuntu, Debian or Centos systems") endif @@ -245,21 +285,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 @@ -336,12 +376,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 @@ -427,24 +469,22 @@ define banner @echo " " endef -verify: install-dep $(BR)/.bootstrap.ok - make -C dpdk install-$(PKG) DPDK_CRYPTO_SW_PMD=y +verify: install-dep $(BR)/.bootstrap.ok dpdk-install-dev $(call banner,"Building for PLATFORM=vpp using gcc") - @make -C build-root PLATFORM=vpp TAG=vpp wipe-all install-packages \ - vpp_uses_dpdk_cryptodev_sw=yes + @make -C build-root PLATFORM=vpp TAG=vpp wipe-all install-packages ifeq ($(OS_ID)-$(OS_VERSION_ID),ubuntu-16.04) $(call banner,"Installing dependencies") @sudo -E apt-get update @sudo -E apt-get $(CONFIRM) $(FORCE) install clang $(call banner,"Building for PLATFORM=vpp using clang") - @make -C build-root CC=clang PLATFORM=vpp TAG=vpp_clang \ - wipe-all install-packages vpp_uses_dpdk_cryptodev_sw=yes + @make -C build-root CC=clang PLATFORM=vpp TAG=vpp_clang wipe-all install-packages endif $(call banner,"Building sample-plugin") @make -C build-root PLATFORM=vpp TAG=vpp sample-plugin-install $(call banner,"Building $(PKG) packages") - @make pkg-$(PKG) vpp_uses_dpdk_cryptodev_sw=yes + @make pkg-$(PKG) ifeq ($(OS_ID)-$(OS_VERSION_ID),ubuntu-16.04) @make test endif +