# Copyright (c) 2021 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. export WS_ROOT=$(CURDIR) export BR=$(WS_ROOT)/build-root CCACHE_DIR?=$(BR)/.ccache SHELL:=/bin/bash GDB?=gdb PLATFORM?=vpp SAMPLE_PLUGIN?=no STARTUP_DIR?=$(PWD) MACHINE=$(shell uname -m) SUDO?=sudo -E DPDK_CONFIG?=no-pci ,:=, define disable_plugins $(if $(1), \ "plugins {" \ $(patsubst %,"plugin %_plugin.so { disable }",$(subst $(,), ,$(1))) \ " }" \ ,) endef 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" # # OS Detection # # We allow Darwin (MacOS) for docs generation; VPP build will still fail. ifneq ($(shell uname),Darwin) OS_ID = $(shell grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g') OS_VERSION_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g') endif ifeq ($(filter ubuntu debian,$(OS_ID)),$(OS_ID)) PKG=deb else ifeq ($(filter rhel centos fedora opensuse-leap rocky,$(OS_ID)),$(OS_ID)) PKG=rpm endif # +libganglia1-dev if building the gmond plugin DEB_DEPENDS = curl build-essential autoconf automake ccache DEB_DEPENDS += debhelper dkms git libtool libapr1-dev dh-python DEB_DEPENDS += libconfuse-dev git-review exuberant-ctags cscope pkg-config DEB_DEPENDS += lcov chrpath autoconf libnuma-dev DEB_DEPENDS += python3-all python3-setuptools check DEB_DEPENDS += libffi-dev python3-ply DEB_DEPENDS += cmake ninja-build uuid-dev python3-jsonschema python3-yaml DEB_DEPENDS += python3-venv # ensurepip DEB_DEPENDS += python3-dev python3-pip DEB_DEPENDS += libnl-3-dev libnl-route-3-dev libmnl-dev # DEB_DEPENDS += enchant # for docs DEB_DEPENDS += python3-virtualenv DEB_DEPENDS += libssl-dev DEB_DEPENDS += libelf-dev libpcap-dev # for libxdp (af_xdp) DEB_DEPENDS += iperf3 # for 'make test TEST=vcl' DEB_DEPENDS += nasm DEB_DEPENDS += iperf ethtool # for 'make test TEST=vm_vpp_interfaces' LIBFFI=libffi6 # works on all but 20.04 and debian-testing ifeq ($(OS_VERSION_ID),22.04) DEB_DEPENDS += python3-virtualenv DEB_DEPENDS += libssl-dev DEB_DEPENDS += clang clang-format-11 LIBFFI=libffi7 DEB_DEPENDS += enchant-2 # for docs else ifeq ($(OS_VERSION_ID),20.04) DEB_DEPENDS += python3-virtualenv DEB_DEPENDS += libssl-dev DEB_DEPENDS += clang clang-format-11 LIBFFI=libffi7 DEB_DEPENDS += enchant-2 # for docs else ifeq ($(OS_VERSION_ID),20.10) DEB_DEPENDS += clang clang-format-11 LIBFFI=libffi8ubuntu1 else ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-10) DEB_DEPENDS += virtualenv else ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-11) DEB_DEPENDS += virtualenv DEB_DEPENDS += clang clang-format-11 LIBFFI=libffi7 else DEB_DEPENDS += clang-11 clang-format-11 LIBFFI=libffi7 DEB_DEPENDS += enchant-2 # for docs endif DEB_DEPENDS += $(LIBFFI) RPM_DEPENDS = glibc-static RPM_DEPENDS += apr-devel RPM_DEPENDS += numactl-devel RPM_DEPENDS += check check-devel RPM_DEPENDS += selinux-policy selinux-policy-devel RPM_DEPENDS += ninja-build RPM_DEPENDS += libuuid-devel RPM_DEPENDS += ccache RPM_DEPENDS += xmlto RPM_DEPENDS += elfutils-libelf-devel libpcap-devel RPM_DEPENDS += libnl3-devel libmnl-devel RPM_DEPENDS += nasm ifeq ($(OS_ID),fedora) RPM_DEPENDS += dnf-utils RPM_DEPENDS += subunit subunit-devel RPM_DEPENDS += compat-openssl10-devel RPM_DEPENDS += python3-devel # needed for python3 -m pip install psutil RPM_DEPENDS += python3-ply # for vppapigen RPM_DEPENDS += python3-virtualenv python3-jsonschema RPM_DEPENDS += cmake RPM_DEPENDS_GROUPS = 'C Development Tools and Libraries' else ifeq ($(OS_ID),rocky) RPM_DEPENDS += yum-utils RPM_DEPENDS += subunit subunit-devel RPM_DEPENDS += openssl-devel RPM_DEPENDS += python3-devel # needed for python3 -m pip install psutil RPM_DEPENDS += python3-ply # for vppapigen
../extras/vagrant