1 # Copyright (c) 2021 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:
6 # http://www.apache.org/licenses/LICENSE-2.0
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.
14 export WS_ROOT=$(CURDIR)
15 export BR=$(WS_ROOT)/build-root
16 CCACHE_DIR?=$(BR)/.ccache
17 SHELL:=$(shell which bash)
22 MACHINE=$(shell uname -m)
26 ifeq ($(strip $(SHELL)),)
27 $(error "bash not found, VPP requires bash to build")
31 define disable_plugins
34 $(patsubst %,"plugin %_plugin.so { disable }",$(subst $(,), ,$(1))) \
39 MINIMAL_STARTUP_CONF=" \
42 cli-listen /run/vpp/cli.sock \
44 $(if $(wildcard startup.vpp),"exec startup.vpp",) \
46 $(if $(DPDK_CONFIG), "dpdk { $(DPDK_CONFIG) }",) \
47 $(if $(EXTRA_VPP_CONFIG), "$(EXTRA_VPP_CONFIG)",) \
48 $(call disable_plugins,$(DISABLED_PLUGINS)) \
51 GDB_ARGS= -ex "handle SIGUSR1 noprint nostop"
56 # We allow Darwin (MacOS) for docs generation; VPP build will still fail.
57 ifneq ($(shell uname),Darwin)
58 OS_ID = $(shell grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
59 OS_VERSION_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
62 ifeq ($(filter ubuntu debian linuxmint,$(OS_ID)),$(OS_ID))
64 else ifeq ($(filter rhel centos fedora opensuse-leap rocky almalinux,$(OS_ID)),$(OS_ID))
68 # +libganglia1-dev if building the gmond plugin
70 DEB_DEPENDS = curl build-essential autoconf automake ccache
71 DEB_DEPENDS += debhelper dkms git libtool libapr1-dev dh-python
72 DEB_DEPENDS += libconfuse-dev git-review exuberant-ctags cscope pkg-config
73 DEB_DEPENDS += gcovr lcov chrpath autoconf libnuma-dev
74 DEB_DEPENDS += python3-all python3-setuptools check
75 DEB_DEPENDS += libffi-dev python3-ply libunwind-dev
76 DEB_DEPENDS += cmake ninja-build python3-jsonschema python3-yaml
77 DEB_DEPENDS += python3-venv # ensurepip
78 DEB_DEPENDS += python3-dev python3-pip
79 DEB_DEPENDS += libnl-3-dev libnl-route-3-dev libmnl-dev
80 # DEB_DEPENDS += enchant # for docs
81 DEB_DEPENDS += python3-virtualenv
82 DEB_DEPENDS += libssl-dev
83 DEB_DEPENDS += libelf-dev libpcap-dev # for libxdp (af_xdp)
84 DEB_DEPENDS += iperf3 # for 'make test TEST=vcl'
86 DEB_DEPENDS += iperf ethtool # for 'make test TEST=vm_vpp_interfaces'
87 DEB_DEPENDS += libpcap-dev
89 DEB_DEPENDS += jq # for extracting test summary from .json report (hs-test)
91 LIBFFI=libffi6 # works on all but 20.04 and debian-testing
93 ifeq ($(OS_VERSION_ID),22.04)
94 DEB_DEPENDS += python3-virtualenv
95 DEB_DEPENDS += libssl-dev
96 DEB_DEPENDS += clang clang-format-11
98 DEB_DEPENDS += enchant-2 # for docs
99 else ifeq ($(OS_VERSION_ID),20.04)
100 DEB_DEPENDS += python3-virtualenv
101 DEB_DEPENDS += libssl-dev
102 DEB_DEPENDS += clang clang-format-11
104 DEB_DEPENDS += enchant-2 # for docs
105 else ifeq ($(OS_VERSION_ID),20.10)
106 DEB_DEPENDS += clang clang-format-11
107 LIBFFI=libffi8ubuntu1
108 else ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-10)
109 DEB_DEPENDS += virtualenv
110 else ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-11)
111 DEB_DEPENDS += virtualenv
112 DEB_DEPENDS += clang clang-format-11
114 else ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-12)
115 DEB_DEPENDS += virtualenv
116 DEB_DEPENDS += clang-14 clang-format-14
117 # for extras/scripts/checkstyle.sh
118 export CLANG_FORMAT_VER=14
121 DEB_DEPENDS += clang-11 clang-format-11
123 DEB_DEPENDS += enchant-2 # for docs
126 DEB_DEPENDS += $(LIBFFI)
128 RPM_DEPENDS = glibc-static
129 RPM_DEPENDS += apr-devel
130 RPM_DEPENDS += numactl-devel
131 RPM_DEPENDS += check check-devel
132 RPM_DEPENDS += selinux-policy selinux-policy-devel
133 RPM_DEPENDS += ninja-build
134 RPM_DEPENDS += ccache
136 RPM_DEPENDS += elfutils-libelf-devel libpcap-devel
137 RPM_DEPENDS += libnl3-devel libmnl-devel
140 ifeq ($(OS_ID),fedora)
141 RPM_DEPENDS += dnf-utils
142 RPM_DEPENDS += subunit subunit-devel
143 RPM_DEPENDS += compat-openssl10-devel
144 RPM_DEPENDS += python3-devel # needed for python3 -m pip install psutil
145 RPM_DEPENDS += python3-ply # for vppapigen
146 RPM_DEPENDS += python3-virtualenv python3-jsonschema
148 RPM_DEPENDS_GROUPS = 'C Development Tools and Libraries'
149 else ifeq ($(OS_ID),rocky)
150 RPM_DEPENDS += yum-utils
151 RPM_DEPENDS += subunit subunit-devel
152 RPM_DEPENDS += openssl-devel
153 RPM_DEPENDS += python3-devel # needed for python3 -m pip install psutil
154 RPM_DEPENDS += python3-ply # for vppapigen
155 RPM_DEPENDS += python3-virtualenv python3-jsonschema
156 RPM_DEPENDS += infiniband-diags llvm clang cmake
157 RPM_DEPENDS_GROUPS = 'Development Tools'
158 else ifeq ($(OS_ID),almalinux)
159 RPM_DEPENDS += yum-utils
160 RPM_DEPENDS += subunit subunit-devel
161 RPM_DEPENDS += openssl-devel
162 RPM_DEPENDS += python3-devel # needed for python3 -m pip install psutil
163 RPM_DEPENDS += python3-ply # for vppapigen
164 RPM_DEPENDS += python3-virtualenv python3-jsonschema
165 RPM_DEPENDS += infiniband-diags llvm clang cmake
166 RPM_DEPENDS_GROUPS = 'Development Tools'
167 else ifeq ($(OS_ID)-$(OS_VERSION_ID),centos-8)
168 RPM_DEPENDS += yum-utils
169 RPM_DEPENDS += compat-openssl10 openssl-devel
170 RPM_DEPENDS += python2-devel python36-devel python3-ply
171 RPM_DEPENDS += python3-virtualenv python3-jsonschema
172 RPM_DEPENDS += libarchive cmake
173 RPM_DEPENDS += infiniband-diags libibumad
174 RPM_DEPENDS += libpcap-devel llvm-toolset
175 RPM_DEPENDS_GROUPS = 'Development Tools'
177 RPM_DEPENDS += yum-utils
178 RPM_DEPENDS += openssl-devel
179 RPM_DEPENDS += python36-ply # for vppapigen
180 RPM_DEPENDS += python3-devel python3-pip
181 RPM_DEPENDS += python-virtualenv python36-jsonschema
182 RPM_DEPENDS += devtoolset-9 devtoolset-9-libasan-devel
183 RPM_DEPENDS += cmake3
184 RPM_DEPENDS_GROUPS = 'Development Tools'
187 # +ganglia-devel if building the ganglia plugin
189 RPM_DEPENDS += chrpath libffi-devel rpm-build
191 RPM_DEPENDS_DEBUG = glibc-debuginfo e2fsprogs-debuginfo
192 RPM_DEPENDS_DEBUG += krb5-debuginfo openssl-debuginfo
193 RPM_DEPENDS_DEBUG += zlib-debuginfo nss-softokn-debuginfo
194 RPM_DEPENDS_DEBUG += yum-plugin-auto-update-debug-info
196 RPM_SUSE_BUILDTOOLS_DEPS = autoconf automake ccache check-devel chrpath
197 RPM_SUSE_BUILDTOOLS_DEPS += clang cmake indent libtool make ninja python3-ply
199 RPM_SUSE_DEVEL_DEPS = glibc-devel-static libnuma-devel libelf-devel
200 RPM_SUSE_DEVEL_DEPS += libopenssl-devel lsb-release
201 RPM_SUSE_DEVEL_DEPS += libpcap-devel llvm-devel
202 RPM_SUSE_DEVEL_DEPS += curl libstdc++-devel bison gcc-c++ zlib-devel
204 RPM_SUSE_PYTHON_DEPS = python3-devel python3-pip python3-rpm-macros
206 RPM_SUSE_PLATFORM_DEPS = shadow rpm-build
208 ifeq ($(OS_ID),opensuse-leap)
209 RPM_SUSE_DEVEL_DEPS += xmlto openssl-devel asciidoc git nasm
210 RPM_SUSE_PYTHON_DEPS += python3 python3-ply python3-virtualenv
211 RPM_SUSE_PLATFORM_DEPS += distribution-release
214 RPM_SUSE_DEPENDS += $(RPM_SUSE_BUILDTOOLS_DEPS) $(RPM_SUSE_DEVEL_DEPS) $(RPM_SUSE_PYTHON_DEPS) $(RPM_SUSE_PLATFORM_DEPS)
216 ifneq ($(wildcard $(STARTUP_DIR)/startup.conf),)
217 STARTUP_CONF ?= $(STARTUP_DIR)/startup.conf
220 ifeq ($(findstring y,$(UNATTENDED)),y)
221 DEBIAN_FRONTEND=noninteractive
223 FORCE=--allow-downgrades --allow-remove-essential --allow-change-held-packages
228 ifneq ($(SAMPLE_PLUGIN),no)
229 TARGETS += sample-plugin
233 @echo "========================================================================"
235 @echo "========================================================================"
241 @echo "Make Targets:"
242 @echo " install-dep[s] - install software dependencies"
243 @echo " wipe - wipe all products of debug build "
244 @echo " wipe-release - wipe all products of release build "
245 @echo " build - build debug binaries"
246 @echo " build-release - build release binaries"
247 @echo " build-coverity - build coverity artifacts"
248 @echo " build-vpp-gcov - build gcov vpp only"
249 @echo " rebuild - wipe and build debug binaries"
250 @echo " rebuild-release - wipe and build release binaries"
251 @echo " run - run debug binary"
252 @echo " run-release - run release binary"
253 @echo " debug - run debug binary with debugger"
254 @echo " debug-release - run release binary with debugger"
255 @echo " test - build and run tests"
256 @echo " test-cov-hs - build and run host stack tests with coverage"
257 @echo " test-cov-both - build and run python and host stack tests, merge coverage data"
258 @echo " test-help - show help on test framework"
259 @echo " run-vat - run vpp-api-test tool"
260 @echo " pkg-deb - build DEB packages"
261 @echo " pkg-deb-debug - build DEB debug packages"
262 @echo " pkg-snap - build SNAP package"
263 @echo " snap-clean - clean up snap build environment"
264 @echo " pkg-rpm - build RPM packages"
265 @echo " install-ext-dep[s] - install external development dependencies"
266 @echo " ctags - (re)generate ctags database"
267 @echo " gtags - (re)generate gtags database"
268 @echo " cscope - (re)generate cscope database"
269 @echo " compdb - (re)generate compile_commands.json"
270 @echo " checkstyle - check coding style"
271 @echo " checkstyle-commit - check commit message format"
272 @echo " checkstyle-python - check python coding style using 'black' formatter"
273 @echo " checkstyle-api - check api for incompatible changes"
274 @echo " fixstyle - fix coding style"
275 @echo " fixstyle-python - fix python coding style using 'black' formatter"
276 @echo " doxygen - DEPRECATED - use 'make docs'"
277 @echo " bootstrap-doxygen - DEPRECATED"
278 @echo " wipe-doxygen - DEPRECATED"
279 @echo " checkfeaturelist - check FEATURE.yaml according to schema"
280 @echo " featurelist - dump feature list in markdown"
281 @echo " json-api-files - (re)-generate json api files"
282 @echo " json-api-files-debug - (re)-generate json api files for debug target"
283 @echo " go-api-files - (re)-generate golang api files"
284 @echo " docs - Build the Sphinx documentation"
285 @echo " docs-venv - Build the virtual environment for the Sphinx docs"
286 @echo " docs-clean - Remove the generated files from the Sphinx docs"
287 @echo " docs-rebuild - Rebuild all of the Sphinx documentation"
289 @echo "Make Arguments:"
290 @echo " V=[0|1] - set build verbosity level"
291 @echo " STARTUP_CONF=<path> - startup configuration file"
292 @echo " (e.g. /etc/vpp/startup.conf)"
293 @echo " STARTUP_DIR=<path> - startup directory (e.g. /etc/vpp)"
294 @echo " It also sets STARTUP_CONF if"
295 @echo " startup.conf file is present"
296 @echo " GDB=<path> - gdb binary to use for debugging"
297 @echo " PLATFORM=<name> - target platform. default is vpp"
298 @echo " DPDK_CONFIG=<conf> - add specified dpdk config commands to"
299 @echo " autogenerated startup.conf"
300 @echo " (e.g. \"no-pci\" )"
301 @echo " SAMPLE_PLUGIN=yes - in addition build/run/debug sample plugin"
302 @echo " DISABLED_PLUGINS=<list> - comma separated list of plugins which"
303 @echo " should not be loaded"
305 @echo "Current Argument Values:"
307 @echo " STARTUP_CONF = $(STARTUP_CONF)"
308 @echo " STARTUP_DIR = $(STARTUP_DIR)"
309 @echo " GDB = $(GDB)"
310 @echo " PLATFORM = $(PLATFORM)"
311 @echo " DPDK_VERSION = $(DPDK_VERSION)"
312 @echo " DPDK_CONFIG = $(DPDK_CONFIG)"
313 @echo " SAMPLE_PLUGIN = $(SAMPLE_PLUGIN)"
314 @echo " DISABLED_PLUGINS = $(DISABLED_PLUGINS)"
317 ifeq ($(findstring y,$(UNATTENDED)),y)
320 ifeq ($(filter ubuntu debian linuxmint,$(OS_ID)),$(OS_ID))
321 @MISSING=$$(apt-get install -y -qq -s $(DEB_DEPENDS) | grep "^Inst ") ; \
322 if [ -n "$$MISSING" ] ; then \
323 echo "\nPlease install missing packages: \n$$MISSING\n" ; \
324 echo "by executing \"make install-dep\"\n" ; \
328 else ifneq ("$(wildcard /etc/redhat-release)","")
329 @for i in $(RPM_DEPENDS) ; do \
330 RPM=$$(basename -s .rpm "$${i##*/}" | cut -d- -f1,2,3,4) ; \
331 MISSING+=$$(rpm -q $$RPM | grep "^package") ; \
333 if [ -n "$$MISSING" ] ; then \
334 echo "Please install missing RPMs: \n$$MISSING\n" ; \
335 echo "by executing \"make install-dep\"\n" ; \
344 @echo "'make bootstrap' is not needed anymore"
348 ifeq ($(filter ubuntu debian linuxmint,$(OS_ID)),$(OS_ID))
349 @sudo -E apt-get update
350 @sudo -E apt-get $(APT_ARGS) $(CONFIRM) $(FORCE) install $(DEB_DEPENDS)
351 else ifneq ("$(wildcard /etc/redhat-release)","")
353 @sudo -E yum-config-manager --enable rhel-server-rhscl-7-rpms
354 @sudo -E yum groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
355 @sudo -E yum install $(CONFIRM) $(RPM_DEPENDS)
356 @sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs zlib
357 else ifeq ($(OS_ID),rocky)
358 @sudo -E dnf install $(CONFIRM) dnf-plugins-core epel-release
359 @sudo -E dnf config-manager --set-enabled \
360 $(shell dnf repolist all 2>/dev/null|grep -i crb|cut -d' ' -f1|grep -v source)
361 @sudo -E dnf groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
362 @sudo -E dnf install $(CONFIRM) $(RPM_DEPENDS)
363 else ifeq ($(OS_ID)-$(OS_VERSION_ID),centos-8)
364 @sudo -E dnf install $(CONFIRM) dnf-plugins-core epel-release
365 @sudo -E dnf config-manager --set-enabled \
366 $(shell dnf repolist all 2>/dev/null|grep -i powertools|cut -d' ' -f1|grep -v source)
367 @sudo -E dnf groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
368 @sudo -E dnf install --skip-broken $(CONFIRM) $(RPM_DEPENDS)
369 else ifeq ($(OS_ID),centos)
370 @sudo -E yum install $(CONFIRM) centos-release-scl-rh epel-release
371 @sudo -E yum groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
372 @sudo -E yum install $(CONFIRM) $(RPM_DEPENDS)
373 @sudo -E yum install $(CONFIRM) --enablerepo=base-debuginfo $(RPM_DEPENDS_DEBUG)
374 else ifeq ($(OS_ID),fedora)
375 @sudo -E dnf groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
376 @sudo -E dnf install $(CONFIRM) $(RPM_DEPENDS)
377 @sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs zlib
379 else ifeq ($(filter opensuse-leap-15.3 opensuse-leap-15.4 ,$(OS_ID)-$(OS_VERSION_ID)),$(OS_ID)-$(OS_VERSION_ID))
380 @sudo -E zypper refresh
381 @sudo -E zypper install -y $(RPM_SUSE_DEPENDS)
383 $(error "This option currently works only on Ubuntu, Debian, RHEL, CentOS or openSUSE-leap systems")
385 git config commit.template .git_commit_template.txt
388 install-deps: install-dep
391 @$(MAKE) -C $(BR) PLATFORM=$(PLATFORM) TAG=$(1) $(2)
394 $(BR)/scripts/.version:
395 ifneq ("$(wildcard /etc/redhat-release)","")
396 $(shell $(BR)/scripts/version rpm-string > $(BR)/scripts/.version)
398 $(shell $(BR)/scripts/version > $(BR)/scripts/.version)
401 DIST_FILE = $(BR)/vpp-$(shell src/scripts/version).tar
402 DIST_SUBDIR = vpp-$(shell src/scripts/version|cut -f1 -d-)
406 @if git rev-parse 2> /dev/null ; then \
408 --prefix=$(DIST_SUBDIR)/ \
412 git describe --long > $(BR)/.version ; \
414 (cd .. ; tar -cf $(DIST_FILE) $(DIST_SUBDIR) --exclude=*.tar) ; \
415 src/scripts/version > $(BR)/.version ; \
418 --file $(DIST_FILE) \
419 --transform='s,.*/.version,$(DIST_SUBDIR)/src/scripts/.version,' \
421 @$(RM) $(BR)/.version $(DIST_FILE).xz
422 @xz -v --threads=0 $(DIST_FILE)
423 @$(RM) $(BR)/vpp-latest.tar.xz
424 @ln -rs $(DIST_FILE).xz $(BR)/vpp-latest.tar.xz
427 build: $(BR)/.deps.ok
428 $(call make,$(PLATFORM)_debug,$(addsuffix -install,$(TARGETS)))
432 @$(RM) $(BR)/*.tar.xz
435 wipe: wipedist test-wipe $(BR)/.deps.ok
436 $(call make,$(PLATFORM)_debug,$(addsuffix -wipe,$(TARGETS)))
437 @find . -type f -name "*.api.json" ! -path "./src/*" -exec rm {} \;
442 .PHONY: build-release
443 build-release: $(BR)/.deps.ok
444 $(call make,$(PLATFORM),$(addsuffix -install,$(TARGETS)))
446 .PHONY: build-vpp-gcov
448 $(call test,vpp_gcov)
451 wipe-release: test-wipe $(BR)/.deps.ok
452 $(call make,$(PLATFORM),$(addsuffix -wipe,$(TARGETS)))
454 .PHONY: rebuild-release
455 rebuild-release: wipe-release build-release
457 export TEST_DIR ?= $(WS_ROOT)/test
460 $(if $(filter-out $(2),retest),$(MAKE) -C $(BR) PLATFORM=vpp TAG=$(1) CC=$(CC) vpp-install,)
461 $(eval libs:=lib lib64)
463 VPP_BUILD_DIR=$(BR)/build-$(1)-native/vpp \
464 VPP_BIN=$(BR)/install-$(1)-native/vpp/bin/vpp \
465 VPP_INSTALL_PATH=$(BR)/install-$(1)-native/ \
466 EXTENDED_TESTS=$(EXTENDED_TESTS) \
467 TEST_GCOV=$(TEST_GCOV) \
470 RND_SEED=$(RND_SEED) \
471 CACHE_OUTPUT=$(CACHE_OUTPUT) \
481 $(call test,vpp,test)
488 $(call test,vpp_debug,test)
494 $(call test,vpp_gcov,cov)
498 @make -C extras/hs-test build-cov
499 @make -C extras/hs-test test-cov
501 .PHONY: test-cov-both
503 @echo "Running Python, Golang tests and merging coverage reports."
504 find $(BR) -name '*.gcda' -delete
506 find $(BR) -name '*.gcda' -delete
510 .PHONY: test-cov-build
514 $(call test,vpp_gcov,test)
516 .PHONY: test-cov-prep
519 $(call test,vpp_gcov,cov-prep)
521 .PHONY: test-cov-post
524 $(call test,vpp_gcov,cov-post)
528 @lcov --add-tracefile $(BR)/test-coverage-merged/coverage-filtered.info \
529 -a $(BR)/test-coverage-merged/coverage-filtered1.info -o $(BR)/test-coverage-merged/coverage-merged.info
530 @genhtml $(BR)/test-coverage-merged/coverage-merged.info \
531 --output-directory $(BR)/test-coverage-merged/html
532 @echo "Code coverage report is in $(BR)/test-coverage-merged/html/index.html"
536 $(eval EXTENDED_TESTS=1)
537 $(call test,vpp,test)
539 .PHONY: test-all-debug
541 $(eval EXTENDED_TESTS=1)
542 $(call test,vpp_debug,test)
548 $(eval EXTENDED_TESTS=1)
549 $(call test,vpp_gcov,test)
552 papi-wipe: test-wipe-papi
553 $(call banner,"This command is deprecated. Please use 'test-wipe-papi'")
555 .PHONY: test-wipe-papi
557 @$(MAKE) -C test wipe-papi
561 @$(MAKE) -C test help
565 @$(MAKE) -C test wipe
569 $(call test,vpp,shell)
571 .PHONY: test-shell-debug
573 $(call test,vpp_debug,shell)
575 .PHONY: test-shell-cov
579 $(call test,vpp_gcov,shell)
583 @make -C test test-dep
587 @echo "make test-doc is DEPRECATED: use 'make docs'"
590 .PHONY: test-wipe-doc
592 @echo "make test-wipe-doc is DEPRECATED"
595 .PHONY: test-wipe-cov
597 $(call make,$(PLATFORM)_gcov,$(addsuffix -wipe,$(TARGETS)))
598 @$(MAKE) -C test wipe-cov
600 .PHONY: test-wipe-all
602 @$(MAKE) -C test wipe-all
604 # Note: All python venv consolidated in test/Makefile, test/requirements*.txt
605 .PHONY: test-checkstyle
607 $(warning test-checkstyle is deprecated. Running checkstyle-python.")
608 @$(MAKE) -C test checkstyle-python-all
610 # Note: All python venv consolidated in test/Makefile, test/requirements*.txt
611 .PHONY: test-checkstyle-diff
612 test-checkstyle-diff:
613 $(warning test-checkstyle-diff is deprecated. Running checkstyle-python.")
614 @$(MAKE) -C test checkstyle-python-all
616 .PHONY: test-refresh-deps
618 @$(MAKE) -C test refresh-deps
622 $(call test,vpp,retest)
626 $(call test,vpp_debug,retest)
630 $(eval EXTENDED_TESTS=1)
631 $(call test,vpp,retest)
633 .PHONY: retest-all-debug
635 $(eval EXTENDED_TESTS=1)
636 $(call test,vpp_debug,retest)
638 .PHONY: test-start-vpp-in-gdb
639 test-start-vpp-in-gdb:
640 $(call test,vpp,start-gdb)
642 .PHONY: test-start-vpp-debug-in-gdb
643 test-start-vpp-debug-in-gdb:
644 $(call test,vpp_debug,start-gdb)
646 ifeq ("$(wildcard $(STARTUP_CONF))","")
648 @echo "WARNING: STARTUP_CONF not defined or file doesn't exist."
649 @echo " Running with minimal startup config: $(MINIMAL_STARTUP_CONF)\n"
650 @cd $(STARTUP_DIR) && \
651 $(SUDO) $(2) $(1)/vpp/bin/vpp $(MINIMAL_STARTUP_CONF)
655 @cd $(STARTUP_DIR) && \
656 $(SUDO) $(2) $(1)/vpp/bin/vpp $(shell cat $(STARTUP_CONF) | sed -e 's/#.*//')
661 @find src -name '*.[chS]' > $@
667 $(call run, $(BR)/install-$(PLATFORM)_debug-native)
671 $(call run, $(BR)/install-$(PLATFORM)-native)
675 $(call run, $(BR)/install-$(PLATFORM)_debug-native,$(GDB) $(GDB_ARGS) --args)
677 .PHONY: build-coverity
679 $(call make,$(PLATFORM)_coverity,install-packages)
680 @$(MAKE) -C build-root PLATFORM=vpp TAG=vpp_coverity libmemif-install
682 .PHONY: debug-release
684 $(call run, $(BR)/install-$(PLATFORM)-native,$(GDB) $(GDB_ARGS) --args)
688 $(call make,$(PLATFORM)_debug,vpp-api-test-install)
692 @$(SUDO) $(BR)/install-$(PLATFORM)_debug-native/vpp/bin/vpp_api_test
696 $(call make,$(PLATFORM),vpp-package-deb)
702 SNAPCRAFT_BUILD_ENVIRONMENT_MEMORY=8G \
703 SNAPCRAFT_BUILD_ENVIRONMENT_CPU=6 \
712 .PHONY: pkg-deb-debug
714 $(call make,$(PLATFORM)_debug,vpp-package-deb)
718 $(MAKE) -C extras/rpm
722 $(MAKE) -C extras/rpm srpm
724 .PHONY: install-ext-deps
726 $(MAKE) -C build/external install-$(PKG)
728 .PHONY: install-ext-dep
729 install-ext-dep: install-ext-deps
731 .PHONY: json-api-files
733 $(WS_ROOT)/src/tools/vppapigen/generate_json.py
735 .PHONY: json-api-files-debug
736 json-api-files-debug:
737 $(WS_ROOT)/src/tools/vppapigen/generate_json.py --debug-target
740 go-api-files: json-api-files
741 $(WS_ROOT)/src/tools/vppapigen/generate_go.py $(ARGS)
745 @ctags --totals --tag-relative=yes -L $<
750 @gtags --gtagslabel=ctags
758 @ninja -C build-root/build-vpp_debug-native/vpp build.ninja
759 @ninja -C build-root/build-vpp_debug-native/vpp -t compdb | \
760 src/scripts/compdb_cleanup.py > compile_commands.json
763 checkstyle: checkfeaturelist
764 @extras/scripts/checkstyle.sh
766 .PHONY: checkstyle-commit
768 @extras/scripts/check_commit_msg.sh
770 .PHONY: checkstyle-test
772 $(warning test-checkstyle is deprecated. Running checkstyle-python.")
773 @$(MAKE) -C test checkstyle-python-all
775 # Note: All python venv consolidated in test/Makefile, test/requirements*.txt
776 .PHONY: checkstyle-python
778 @$(MAKE) -C test checkstyle-python-all
780 .PHONY: checkstyle-all
781 checkstyle-all: checkstyle-commit checkstyle checkstyle-python docs-spell
785 @extras/scripts/checkstyle.sh --fix
787 # Note: All python venv consolidated in test/Makefile, test/requirements*.txt
788 .PHONY: fixstyle-python
790 @$(MAKE) -C test fixstyle-python-all
792 .PHONY: checkstyle-api
794 @extras/scripts/crcchecker.py --check-patchset
796 # necessary because Bug 1696324 - Update to python3.6 breaks PyYAML dependencies
797 # Status: CLOSED CANTFIX
798 # https://bugzilla.redhat.com/show_bug.cgi?id=1696324
799 .PHONY: centos-pyyaml
801 ifeq ($(OS_ID)-$(OS_VERSION_ID),centos-8)
802 @sudo -E yum install $(CONFIRM) python3-pyyaml
806 featurelist: centos-pyyaml
807 @extras/scripts/fts.py --all --markdown
809 .PHONY: checkfeaturelist
810 checkfeaturelist: centos-pyyaml
811 @extras/scripts/fts.py --validate --all
814 # Build the documentation
817 .PHONY: bootstrap-doxygen
819 @echo "make bootstrap-doxygen is DEPRECATED"
824 @echo "make doxygen is DEPRECATED: use 'make docs'"
829 @echo "make wipe-doxygen is DEPRECATED"
834 @$(MAKE) -C $(WS_ROOT)/docs $*
838 @$(MAKE) -C $(WS_ROOT)/docs docs
841 pkg-verify: install-dep $(BR)/.deps.ok install-ext-deps
842 $(call banner,"Building for PLATFORM=vpp")
843 @$(MAKE) -C build-root PLATFORM=vpp TAG=vpp wipe-all install-packages
844 $(call banner,"Building sample-plugin")
845 @$(MAKE) -C build-root PLATFORM=vpp TAG=vpp sample-plugin-install
846 $(call banner,"Building libmemif")
847 @$(MAKE) -C build-root PLATFORM=vpp TAG=vpp libmemif-install
848 $(call banner,"Building $(PKG) packages")
851 # Note: 'make verify' target is not used by ci-management scripts
852 MAKE_VERIFY_GATE_OS ?= ubuntu-22.04
855 ifeq ($(OS_ID)-$(OS_VERSION_ID),$(MAKE_VERIFY_GATE_OS))
856 $(call banner,"Testing vppapigen")
857 @src/tools/vppapigen/test_vppapigen.py
858 $(call banner,"Running tests")
859 @$(MAKE) COMPRESS_FAILED_TEST_LOGS=yes RETRIES=3 test
861 $(call banner,"Skipping tests. Tests under 'make verify' supported on $(MAKE_VERIFY_GATE_OS)")
864 .PHONY: check-dpdk-mlx
866 @[ $$($(MAKE) -sC build/external dpdk-show-DPDK_MLX_DEFAULT) = y ]