# 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 RPM_DEPENDS += python3-virtualenv python3-jsonschema RPM_DEPENDS += infiniband-diags llvm clang cmake RPM_DEPENDS_GROUPS = 'Development Tools' else ifeq ($(OS_ID)-$(OS_VERSION_ID),centos-8) RPM_DEPENDS += yum-utils RPM_DEPENDS += compat-openssl10 openssl-devel RPM_DEPENDS += python2-devel python36-devel python3-ply RPM_DEPENDS += python3-virtualenv python3-jsonschema RPM_DEPENDS += libarchive cmake RPM_DEPENDS += infiniband-diags libibumad RPM_DEPENDS += libpcap-devel llvm-toolset RPM_DEPENDS_GROUPS = 'Development Tools' else RPM_DEPENDS += yum-utils RPM_DEPENDS += openssl-devel RPM_DEPENDS += python36-ply # for vppapigen RPM_DEPENDS += python3-devel python3-pip RPM_DEPENDS += python-virtualenv python36-jsonschema RPM_DEPENDS += devtoolset-9 devtoolset-9-libasan-devel RPM_DEPENDS += cmake3 RPM_DEPENDS_GROUPS = 'Development Tools' endif # +ganglia-devel if building the ganglia plugin RPM_DEPENDS += chrpath libffi-devel rpm-build RPM_DEPENDS_DEBUG = glibc-debuginfo e2fsprogs-debuginfo RPM_DEPENDS_DEBUG += krb5-debuginfo openssl-debuginfo RPM_DEPENDS_DEBUG += zlib-debuginfo nss-softokn-debuginfo RPM_DEPENDS_DEBUG += yum-plugin-auto-update-debug-info RPM_SUSE_BUILDTOOLS_DEPS = autoconf automake ccache check-devel chrpath RPM_SUSE_BUILDTOOLS_DEPS += clang cmake indent libtool make ninja python3-ply RPM_SUSE_DEVEL_DEPS = glibc-devel-static libnuma-devel libelf-devel RPM_SUSE_DEVEL_DEPS += libopenssl-devel libuuid-devel lsb-release RPM_SUSE_DEVEL_DEPS += curl libstdc++-devel bison gcc-c++ zlib-devel RPM_SUSE_PYTHON_DEPS = python3-devel python3-pip python3-rpm-macros RPM_SUSE_PLATFORM_DEPS = shadow rpm-build ifeq ($(OS_ID),opensuse-leap) RPM_SUSE_DEVEL_DEPS += xmlto openssl-devel asciidoc git nasm RPM_SUSE_PYTHON_DEPS += python3 python3-ply python3-virtualenv RPM_SUSE_PLATFORM_DEPS += distribution-release endif RPM_SUSE_DEPENDS += $(RPM_SUSE_BUILDTOOLS_DEPS) $(RPM_SUSE_DEVEL_DEPS) $(RPM_SUSE_PYTHON_DEPS) $(RPM_SUSE_PLATFORM_DEPS) ifneq ($(wildcard $(STARTUP_DIR)/startup.conf),) STARTUP_CONF ?= $(STARTUP_DIR)/startup.conf endif ifeq ($(findstring y,$(UNATTENDED)),y) CONFIRM=-y FORCE=--allow-downgrades --allow-remove-essential --allow-change-held-packages endif TARGETS = vpp ifneq ($(SAMPLE_PLUGIN),no) TARGETS += sample-plugin endif define banner @echo "========================================================================" @echo " $(1)" @echo "========================================================================" @echo " " endef .PHONY: help help: @echo "Make Targets:" @echo " install-dep[s] - install software dependencies" @echo " wipe - wipe all products of debug build "
<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (c) 2017 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.
--><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <groupId>io.fd.hc2vpp.common</groupId>
        <artifactId>vpp-impl-parent</artifactId>
        <version>1.17.10-SNAPSHOT</version>
        <relativePath>../../vpp-common/vpp-impl-parent</relativePath>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <groupId>io.fd.hc2vpp.dhcp</groupId>
    <artifactId>dhcp-impl</artifactId>
    <name>dhcp-impl</name>
    <version>1.17.10-SNAPSHOT</version>
    <packaging>bundle</packaging>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>dhcp-api</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- Honeycomb infrastructure-->
        <dependency>
            <groupId>io.fd.honeycomb</groupId>
            <artifactId>translate-api</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>io.fd.honeycomb</groupId>
            <artifactId>translate-spi</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- Translation -->
        <dependency>
            <groupId>io.fd.hc2vpp.common</groupId>
            <artifactId>vpp-translate-utils</artifactId>
        </dependency>

        <!-- DI -->
        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
        </dependency>
        <dependency>
            <groupId>net.jmob</groupId>
            <artifactId>guice.conf</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.inject.extensions</groupId>
            <artifactId>guice-multibindings</artifactId>
        </dependency>
        <dependency>
            <groupId>io.fd.honeycomb</groupId>
            <artifactId>translate-impl</artifactId>
            <version>1.17.10-SNAPSHOT</version>
        </dependency>


        <!-- Testing dependencies-->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.inject.extensions</groupId>
            <artifactId>guice-testlib</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.fd.hc2vpp.common</groupId>
            <artifactId>vpp-translate-test</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.fd.honeycomb.infra</groupId>
            <artifactId>test-tools</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
(OS_VERSION_ID),centos-8) @sudo -E yum install $(CONFIRM) python3-pyyaml endif .PHONY: featurelist featurelist: centos-pyyaml @extras/scripts/fts.py --all --markdown .PHONY: checkfeaturelist checkfeaturelist: centos-pyyaml @extras/scripts/fts.py --validate --all # # Build the documentation # .PHONY: bootstrap-doxygen bootstrap-doxygen: @echo "make bootstrap-doxygen is DEPRECATED" sleep 300 .PHONY: doxygen doxygen: docs @echo "make doxygen is DEPRECATED: use 'make docs'" sleep 300 .PHONY: wipe-doxygen wipe-doxygen: @echo "make wipe-doxygen is DEPRECATED" sleep 300 .PHONY: docs-% docs-%: @make -C $(WS_ROOT)/docs $* .PHONY: docs docs: @make -C $(WS_ROOT)/docs docs .PHONY: pkg-verify pkg-verify: install-dep $(BR)/.deps.ok install-ext-deps $(call banner,"Building for PLATFORM=vpp") @make -C build-root PLATFORM=vpp TAG=vpp wipe-all install-packages $(call banner,"Building sample-plugin") @make -C build-root PLATFORM=vpp TAG=vpp sample-plugin-install $(call banner,"Building libmemif") @make -C build-root PLATFORM=vpp TAG=vpp libmemif-install $(call banner,"Building $(PKG) packages") @make pkg-$(PKG) # Note: 'make verify' target is not used by ci-management scripts MAKE_VERIFY_GATE_OS ?= ubuntu-22.04 .PHONY: verify verify: pkg-verify ifeq ($(OS_ID)-$(OS_VERSION_ID),$(MAKE_VERIFY_GATE_OS)) $(call banner,"Testing vppapigen") @src/tools/vppapigen/test_vppapigen.py $(call banner,"Running tests") @make COMPRESS_FAILED_TEST_LOGS=yes RETRIES=3 test else $(call banner,"Skipping tests. Tests under 'make verify' supported on $(MAKE_VERIFY_GATE_OS)") endif .PHONY: check-dpdk-mlx check-dpdk-mlx: @[ $$(make -sC build/external dpdk-show-DPDK_MLX_DEFAULT) = y ]