api: Implement log_dump/log_details
[vpp.git] / Makefile
1 # Copyright (c) 2016 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:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
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.
13
14 export WS_ROOT=$(CURDIR)
15 export BR=$(WS_ROOT)/build-root
16 CCACHE_DIR?=$(BR)/.ccache
17 GDB?=gdb
18 PLATFORM?=vpp
19 SAMPLE_PLUGIN?=no
20 STARTUP_DIR?=$(PWD)
21 MACHINE=$(shell uname -m)
22 SUDO?=sudo
23
24 ,:=,
25 define disable_plugins
26 $(if $(1), \
27   "plugins {" \
28   $(patsubst %,"plugin %_plugin.so { disable }",$(subst $(,), ,$(1))) \
29   " }" \
30   ,)
31 endef
32
33 MINIMAL_STARTUP_CONF="                                                  \
34 unix {                                                                  \
35         interactive                                                     \
36         cli-listen /run/vpp/cli.sock                                    \
37         gid $(shell id -g)                                              \
38         $(if $(wildcard startup.vpp),"exec startup.vpp",)               \
39 }                                                                       \
40 $(if $(DPDK_CONFIG), "dpdk { $(DPDK_CONFIG) }",)                        \
41 $(call disable_plugins,$(DISABLED_PLUGINS))                             \
42 "
43
44 GDB_ARGS= -ex "handle SIGUSR1 noprint nostop"
45
46 #
47 # OS Detection
48 #
49 # We allow Darwin (MacOS) for docs generation; VPP build will still fail.
50 ifneq ($(shell uname),Darwin)
51 OS_ID        = $(shell grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
52 OS_VERSION_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
53 endif
54
55 ifeq ($(filter ubuntu debian,$(OS_ID)),$(OS_ID))
56 PKG=deb
57 else ifeq ($(filter rhel centos fedora opensuse opensuse-leap opensuse-tumbleweed,$(OS_ID)),$(OS_ID))
58 PKG=rpm
59 endif
60
61 # +libganglia1-dev if building the gmond plugin
62
63 DEB_DEPENDS  = curl build-essential autoconf automake ccache
64 DEB_DEPENDS += debhelper dkms git libtool libapr1-dev dh-systemd
65 DEB_DEPENDS += libconfuse-dev git-review exuberant-ctags cscope pkg-config
66 DEB_DEPENDS += lcov chrpath autoconf indent clang-format libnuma-dev
67 DEB_DEPENDS += python-all python3-all python3-setuptools python-dev
68 DEB_DEPENDS += python-virtualenv python-pip libffi6 check
69 DEB_DEPENDS += libboost-all-dev libffi-dev python3-ply libmbedtls-dev
70 DEB_DEPENDS += cmake ninja-build uuid-dev python3-jsonschema
71 ifeq ($(OS_VERSION_ID),14.04)
72         DEB_DEPENDS += libssl-dev
73 else ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-8)
74         DEB_DEPENDS += libssl-dev
75         APT_ARGS = -t jessie-backports
76 else ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-9)
77         DEB_DEPENDS += libssl1.0-dev
78 else
79         DEB_DEPENDS += libssl-dev
80 endif
81
82 RPM_DEPENDS  = redhat-lsb glibc-static
83 RPM_DEPENDS += apr-devel
84 RPM_DEPENDS += numactl-devel
85 RPM_DEPENDS += check check-devel
86 RPM_DEPENDS += boost boost-devel
87 RPM_DEPENDS += selinux-policy selinux-policy-devel
88 RPM_DEPENDS += ninja-build
89 RPM_DEPENDS += libuuid-devel
90 RPM_DEPENDS += mbedtls-devel
91
92 ifeq ($(OS_ID),fedora)
93         RPM_DEPENDS += dnf-utils
94         RPM_DEPENDS += subunit subunit-devel
95         RPM_DEPENDS += compat-openssl10-devel
96         RPM_DEPENDS += python3-devel python3-ply
97         RPM_DEPENDS += python3-virtualenv python3-jsonschema
98         RPM_DEPENDS += cmake
99         RPM_DEPENDS_GROUPS = 'C Development Tools and Libraries'
100 else
101         RPM_DEPENDS += yum-utils
102         RPM_DEPENDS += openssl-devel
103         RPM_DEPENDS += python-devel python36-ply
104         RPM_DEPENDS += python36-devel python36-pip
105         RPM_DEPENDS += python-virtualenv python36-jsonschema
106         RPM_DEPENDS += devtoolset-7
107         RPM_DEPENDS += cmake3
108         RPM_DEPENDS_GROUPS = 'Development Tools'
109 endif
110
111 # +ganglia-devel if building the ganglia plugin
112
113 RPM_DEPENDS += chrpath libffi-devel rpm-build
114 # lowercase- replace spaces with dashes.
115 SUSE_NAME= $(shell grep '^NAME=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g' | sed -e 's/ /-/' | awk '{print tolower($$0)}')
116 SUSE_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g' | cut -d' ' -f2)
117 RPM_SUSE_BUILDTOOLS_DEPS = autoconf automake ccache check-devel chrpath
118 RPM_SUSE_BUILDTOOLS_DEPS += clang cmake indent libtool make ninja python3-ply
119
120 RPM_SUSE_DEVEL_DEPS = glibc-devel-static libnuma-devel
121 RPM_SUSE_DEVEL_DEPS += libopenssl-devel openssl-devel mbedtls-devel libuuid-devel
122
123 RPM_SUSE_PYTHON_DEPS = python-devel python3-devel python-pip python3-pip
124 RPM_SUSE_PYTHON_DEPS += python-rpm-macros python3-rpm-macros
125
126 RPM_SUSE_PLATFORM_DEPS = distribution-release shadow rpm-build
127
128 ifeq ($(OS_ID),opensuse)
129 ifeq ($(SUSE_NAME),tumbleweed)
130         RPM_SUSE_DEVEL_DEPS = libboost_headers1_68_0-devel-1.68.0  libboost_thread1_68_0-devel-1.68.0 gcc
131         RPM_SUSE_PYTHON_DEPS += python3-ply python2-virtualenv
132 endif
133 ifeq ($(SUSE_ID),15.0)
134         RPM_SUSE_DEVEL_DEPS += libboost_headers-devel libboost_thread-devel gcc
135         RPM_SUSE_PYTHON_DEPS += python3-ply python2-virtualenv
136 else
137         RPM_SUSE_DEVEL_DEPS += libboost_headers1_68_0-devel-1.68.0 gcc6
138         RPM_SUSE_PYTHON_DEPS += python-virtualenv
139 endif
140 endif
141
142 ifeq ($(OS_ID),opensuse-leap)
143 ifeq ($(SUSE_ID),15.0)
144         RPM_SUSE_DEVEL_DEPS += libboost_headers-devel libboost_thread-devel gcc git curl
145         RPM_SUSE_PYTHON_DEPS += python3-ply python2-virtualenv
146 endif
147 endif
148
149 RPM_SUSE_DEPENDS += $(RPM_SUSE_BUILDTOOLS_DEPS) $(RPM_SUSE_DEVEL_DEPS) $(RPM_SUSE_PYTHON_DEPS) $(RPM_SUSE_PLATFORM_DEPS)
150
151 ifneq ($(wildcard $(STARTUP_DIR)/startup.conf),)
152         STARTUP_CONF ?= $(STARTUP_DIR)/startup.conf
153 endif
154
155 ifeq ($(findstring y,$(UNATTENDED)),y)
156 CONFIRM=-y
157 FORCE=--force-yes
158 endif
159
160 TARGETS = vpp
161
162 ifneq ($(SAMPLE_PLUGIN),no)
163 TARGETS += sample-plugin
164 endif
165
166 .PHONY: help wipe wipe-release build build-release rebuild rebuild-release
167 .PHONY: run run-release debug debug-release build-vat run-vat pkg-deb pkg-rpm
168 .PHONY: ctags cscope
169 .PHONY: test test-debug retest retest-debug test-doc test-wipe-doc test-help test-wipe
170 .PHONY: test-cov test-wipe-cov
171
172 define banner
173         @echo "========================================================================"
174         @echo " $(1)"
175         @echo "========================================================================"
176         @echo " "
177 endef
178
179 help:
180         @echo "Make Targets:"
181         @echo " install-dep         - install software dependencies"
182         @echo " wipe                - wipe all products of debug build "
183         @echo " wipe-release        - wipe all products of release build "
184         @echo " build               - build debug binaries"
185         @echo " build-release       - build release binaries"
186         @echo " build-coverity      - build coverity artifacts"
187         @echo " rebuild             - wipe and build debug binares"
188         @echo " rebuild-release     - wipe and build release binares"
189         @echo " run                 - run debug binary"
190         @echo " run-release         - run release binary"
191         @echo " debug               - run debug binary with debugger"
192         @echo " debug-release       - run release binary with debugger"
193         @echo " test                - build and run (basic) functional tests"
194         @echo " test-debug          - build and run (basic) functional tests (debug build)"
195         @echo " test-all            - build and run (all) functional tests"
196         @echo " test-all-debug      - build and run (all) functional tests (debug build)"
197         @echo " test-gcov           - build and run functional tests (gcov build)"
198         @echo " test-shell          - enter shell with test environment"
199         @echo " test-shell-debug    - enter shell with test environment (debug build)"
200         @echo " test-wipe           - wipe files generated by unit tests"
201         @echo " retest              - run functional tests"
202         @echo " retest-debug        - run functional tests (debug build)"
203         @echo " test-help           - show help on test framework"
204         @echo " run-vat             - run vpp-api-test tool"
205         @echo " pkg-deb             - build DEB packages"
206         @echo " pkg-deb-debug       - build DEB debug packages"
207         @echo " vom-pkg-deb         - build vom DEB packages"
208         @echo " vom-pkg-deb-debug   - build vom DEB debug packages"
209         @echo " pkg-rpm             - build RPM packages"
210         @echo " install-ext-deps    - install external development dependencies"
211         @echo " ctags               - (re)generate ctags database"
212         @echo " gtags               - (re)generate gtags database"
213         @echo " cscope              - (re)generate cscope database"
214         @echo " checkstyle          - check coding style"
215         @echo " fixstyle            - fix coding style"
216         @echo " doxygen             - (re)generate documentation"
217         @echo " bootstrap-doxygen   - setup Doxygen dependencies"
218         @echo " wipe-doxygen        - wipe all generated documentation"
219         @echo " checkfeaturelist    - check FEATURE.yaml according to schema"
220         @echo " featurelist         - dump feature list in markdown"
221         @echo " docs                 - Build the Sphinx documentation"
222         @echo " docs-venv         - Build the virtual environment for the Sphinx docs"
223         @echo " docs-clean        - Remove the generated files from the Sphinx docs"
224         @echo " test-doc            - generate documentation for test framework"
225         @echo " test-wipe-doc       - wipe documentation for test framework"
226         @echo " test-cov            - generate code coverage report for test framework"
227         @echo " test-wipe-cov       - wipe code coverage report for test framework"
228         @echo " test-checkstyle     - check PEP8 compliance for test framework"
229         @echo " test-refresh-deps   - refresh the Python dependencies for the tests"
230         @echo ""
231         @echo "Make Arguments:"
232         @echo " V=[0|1]                  - set build verbosity level"
233         @echo " STARTUP_CONF=<path>      - startup configuration file"
234         @echo "                            (e.g. /etc/vpp/startup.conf)"
235         @echo " STARTUP_DIR=<path>       - startup drectory (e.g. /etc/vpp)"
236         @echo "                            It also sets STARTUP_CONF if"
237         @echo "                            startup.conf file is present"
238         @echo " GDB=<path>               - gdb binary to use for debugging"
239         @echo " PLATFORM=<name>          - target platform. default is vpp"
240         @echo " TEST=<filter>            - apply filter to test set, see test-help"
241         @echo " DPDK_CONFIG=<conf>       - add specified dpdk config commands to"
242         @echo "                            autogenerated startup.conf"
243         @echo "                            (e.g. \"no-pci\" )"
244         @echo " SAMPLE_PLUGIN=yes        - in addition build/run/debug sample plugin"
245         @echo " DISABLED_PLUGINS=<list>  - comma separated list of plugins which"
246         @echo "                            should not be loaded"
247         @echo ""
248         @echo "Current Argument Values:"
249         @echo " V                 = $(V)"
250         @echo " STARTUP_CONF      = $(STARTUP_CONF)"
251         @echo " STARTUP_DIR       = $(STARTUP_DIR)"
252         @echo " GDB               = $(GDB)"
253         @echo " PLATFORM          = $(PLATFORM)"
254         @echo " DPDK_VERSION      = $(DPDK_VERSION)"
255         @echo " DPDK_CONFIG       = $(DPDK_CONFIG)"
256         @echo " SAMPLE_PLUGIN     = $(SAMPLE_PLUGIN)"
257         @echo " DISABLED_PLUGINS  = $(DISABLED_PLUGINS)"
258
259 $(BR)/.deps.ok:
260 ifeq ($(findstring y,$(UNATTENDED)),y)
261         make install-dep
262 endif
263 ifeq ($(filter ubuntu debian,$(OS_ID)),$(OS_ID))
264         @MISSING=$$(apt-get install -y -qq -s $(DEB_DEPENDS) | grep "^Inst ") ; \
265         if [ -n "$$MISSING" ] ; then \
266           echo "\nPlease install missing packages: \n$$MISSING\n" ; \
267           echo "by executing \"make install-dep\"\n" ; \
268           exit 1 ; \
269         fi ; \
270         exit 0
271 else ifneq ("$(wildcard /etc/redhat-release)","")
272         @for i in $(RPM_DEPENDS) ; do \
273             RPM=$$(basename -s .rpm "$${i##*/}" | cut -d- -f1,2,3)  ;   \
274             MISSING+=$$(rpm -q $$RPM | grep "^package")    ;    \
275         done                                                       ;    \
276         if [ -n "$$MISSING" ] ; then \
277           echo "Please install missing RPMs: \n$$MISSING\n" ; \
278           echo "by executing \"make install-dep\"\n" ; \
279           exit 1 ; \
280         fi ; \
281         exit 0
282 endif
283         @touch $@
284
285 bootstrap:
286         @echo "'make bootstrap' is not needed anymore"
287
288 install-dep:
289 ifeq ($(filter ubuntu debian,$(OS_ID)),$(OS_ID))
290 ifeq ($(OS_VERSION_ID),14.04)
291         @sudo -E apt-get $(CONFIRM) $(FORCE) install software-properties-common
292 endif
293 ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-8)
294         @grep -q jessie-backports /etc/apt/sources.list /etc/apt/sources.list.d/* 2> /dev/null \
295            || ( echo "Please install jessie-backports" ; exit 1 )
296 endif
297         @sudo -E apt-get update
298         @sudo -E apt-get $(APT_ARGS) $(CONFIRM) $(FORCE) install $(DEB_DEPENDS)
299 else ifneq ("$(wildcard /etc/redhat-release)","")
300 ifeq ($(OS_ID),rhel)
301         @sudo -E yum-config-manager --enable rhel-server-rhscl-7-rpms
302         @sudo -E yum groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
303         @sudo -E yum install $(CONFIRM) $(RPM_DEPENDS)
304         @sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs mbedtls-devel zlib
305 else ifeq ($(OS_ID),centos)
306         @sudo -E yum install $(CONFIRM) centos-release-scl-rh epel-release
307         @sudo -E yum groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
308         @sudo -E yum install $(CONFIRM) $(RPM_DEPENDS)
309         @sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs mbedtls-devel zlib
310 else ifeq ($(OS_ID),fedora)
311         @sudo -E dnf groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
312         @sudo -E dnf install $(CONFIRM) $(RPM_DEPENDS)
313         @sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs mbedtls-devel zlib
314 endif
315 else ifeq ($(filter opensuse-tumbleweed,$(OS_ID)),$(OS_ID))
316         @sudo -E zypper refresh
317         @sudo -E zypper install -y $(RPM_SUSE_DEPENDS)
318 else ifeq ($(filter opensuse-leap,$(OS_ID)),$(OS_ID))
319         @sudo -E zypper refresh
320         @sudo -E zypper install  -y $(RPM_SUSE_DEPENDS)
321 else ifeq ($(filter opensuse,$(OS_ID)),$(OS_ID))
322         @sudo -E zypper refresh
323         @sudo -E zypper install -y $(RPM_SUSE_DEPENDS)
324 else
325         $(error "This option currently works only on Ubuntu, Debian, RHEL, CentOS or openSUSE systems")
326 endif
327         git config commit.template .git_commit_template.txt
328
329 define make
330         @make -C $(BR) PLATFORM=$(PLATFORM) TAG=$(1) $(2)
331 endef
332
333 $(BR)/scripts/.version:
334 ifneq ("$(wildcard /etc/redhat-release)","")
335         $(shell $(BR)/scripts/version rpm-string > $(BR)/scripts/.version)
336 else
337         $(shell $(BR)/scripts/version > $(BR)/scripts/.version)
338 endif
339
340 DIST_FILE = $(BR)/vpp-$(shell src/scripts/version).tar
341 DIST_SUBDIR = vpp-$(shell src/scripts/version|cut -f1 -d-)
342
343 dist:
344         @if git rev-parse 2> /dev/null ; then \
345             git archive \
346               --prefix=$(DIST_SUBDIR)/ \
347               --format=tar \
348               -o $(DIST_FILE) \
349             HEAD ; \
350             git describe > $(BR)/.version ; \
351         else \
352             (cd .. ; tar -cf $(DIST_FILE) $(DIST_SUBDIR) --exclude=*.tar) ; \
353             src/scripts/version > $(BR)/.version ; \
354         fi
355         @tar --append \
356           --file $(DIST_FILE) \
357           --transform='s,.*/.version,$(DIST_SUBDIR)/src/scripts/.version,' \
358           $(BR)/.version
359         @$(RM) $(BR)/.version $(DIST_FILE).xz
360         @xz -v --threads=0 $(DIST_FILE)
361         @$(RM) $(BR)/vpp-latest.tar.xz
362         @ln -rs $(DIST_FILE).xz $(BR)/vpp-latest.tar.xz
363
364 build: $(BR)/.deps.ok
365         $(call make,$(PLATFORM)_debug,$(addsuffix -install,$(TARGETS)))
366
367 wipedist:
368         @$(RM) $(BR)/*.tar.xz
369
370 wipe: wipedist test-wipe $(BR)/.deps.ok
371         $(call make,$(PLATFORM)_debug,$(addsuffix -wipe,$(TARGETS)))
372         @find . -type f -name "*.api.json" ! -path "./test/*" -exec rm {} \;
373
374 rebuild: wipe build
375
376 build-release: $(BR)/.deps.ok
377         $(call make,$(PLATFORM),$(addsuffix -install,$(TARGETS)))
378
379 wipe-release: test-wipe $(BR)/.deps.ok
380         $(call make,$(PLATFORM),$(addsuffix -wipe,$(TARGETS)))
381
382 rebuild-release: wipe-release build-release
383
384 libexpand = $(subst $(subst ,, ),:,$(foreach lib,$(1),$(BR)/install-$(2)-native/vpp/$(lib)/$(3)))
385
386 export TEST_DIR ?= $(WS_ROOT)/test
387
388 define test
389         $(if $(filter-out $(3),retest),make -C $(BR) PLATFORM=$(1) TAG=$(2) vpp-install,)
390         $(eval libs:=lib lib64)
391         make -C test \
392           VPP_BUILD_DIR=$(BR)/build-$(2)-native \
393           VPP_BIN=$(BR)/install-$(2)-native/vpp/bin/vpp \
394           VPP_PLUGIN_PATH=$(call libexpand,$(libs),$(2),vpp_plugins) \
395           VPP_TEST_PLUGIN_PATH=$(call libexpand,$(libs),$(2),vpp_api_test_plugins) \
396           VPP_INSTALL_PATH=$(BR)/install-$(2)-native/ \
397           LD_LIBRARY_PATH=$(call libexpand,$(libs),$(2),) \
398           EXTENDED_TESTS=$(EXTENDED_TESTS) \
399           PYTHON=$(PYTHON) \
400           OS_ID=$(OS_ID) \
401           CACHE_OUTPUT=$(CACHE_OUTPUT) \
402           $(3)
403 endef
404
405 test:
406         $(call test,vpp,vpp,test)
407
408 test-debug:
409         $(call test,vpp,vpp_debug,test)
410
411 test-gcov:
412         $(call test,vpp,vpp_gcov,test)
413
414 test-all:
415         $(if $(filter-out $(3),retest),make -C $(BR) PLATFORM=vpp TAG=vpp vom-install,)
416         $(eval EXTENDED_TESTS=yes)
417         $(call test,vpp,vpp,test)
418
419 test-all-debug:
420         $(if $(filter-out $(3),retest),make -C $(BR) PLATFORM=vpp TAG=vpp_debug vom-install,)
421         $(eval EXTENDED_TESTS=yes)
422         $(call test,vpp,vpp_debug,test)
423
424 test-help:
425         @make -C test help
426
427 test-wipe:
428         @make -C test wipe
429
430 test-shell:
431         $(call test,vpp,vpp,shell)
432
433 test-shell-debug:
434         $(call test,vpp,vpp_debug,shell)
435
436 test-shell-gcov:
437         $(call test,vpp,vpp_gcov,shell)
438
439 test-dep:
440         @make -C test test-dep
441
442 test-doc:
443         @make -C test doc
444
445 test-wipe-doc:
446         @make -C test wipe-doc
447
448 test-cov:
449         @make -C $(BR) PLATFORM=vpp TAG=vpp_gcov vom-install
450         $(eval EXTENDED_TESTS=yes)
451         $(call test,vpp,vpp_gcov,cov)
452
453 test-wipe-cov:
454         @make -C test wipe-cov
455
456 test-checkstyle:
457         @make -C test checkstyle
458
459 test-refresh-deps:
460         @make -C test refresh-deps
461
462 retest:
463         $(call test,vpp,vpp,retest)
464
465 retest-debug:
466         $(call test,vpp,vpp_debug,retest)
467
468 ifeq ("$(wildcard $(STARTUP_CONF))","")
469 define run
470         @echo "WARNING: STARTUP_CONF not defined or file doesn't exist."
471         @echo "         Running with minimal startup config: $(MINIMAL_STARTUP_CONF)\n"
472         @cd $(STARTUP_DIR) && \
473           $(SUDO) $(2) $(1)/vpp/bin/vpp $(MINIMAL_STARTUP_CONF)
474 endef
475 else
476 define run
477         @cd $(STARTUP_DIR) && \
478           $(SUDO) $(2) $(1)/vpp/bin/vpp $(shell cat $(STARTUP_CONF) | sed -e 's/#.*//')
479 endef
480 endif
481
482 %.files: .FORCE
483         @find . \( -name '*\.[chyS]' -o -name '*\.java' -o -name '*\.lex' \) -and \
484                 \( -not -path './build-root*' -o -path \
485                 './build-root/build-vpp_debug-native/dpdk*' \) > $@
486
487 .FORCE:
488
489 run:
490         $(call run, $(BR)/install-$(PLATFORM)_debug-native)
491
492 run-release:
493         $(call run, $(BR)/install-$(PLATFORM)-native)
494
495 debug:
496         $(call run, $(BR)/install-$(PLATFORM)_debug-native,$(GDB) $(GDB_ARGS) --args)
497
498 build-coverity:
499         $(call make,$(PLATFORM)_coverity,install-packages)
500
501 debug-release:
502         $(call run, $(BR)/install-$(PLATFORM)-native,$(GDB) $(GDB_ARGS) --args)
503
504 build-vat:
505         $(call make,$(PLATFORM)_debug,vpp-api-test-install)
506
507 run-vat:
508         @$(SUDO) $(BR)/install-$(PLATFORM)_debug-native/vpp/bin/vpp_api_test
509
510 pkg-deb:
511         $(call make,$(PLATFORM),vpp-package-deb)
512
513 vom-pkg-deb:
514         $(call make,$(PLATFORM),vpp-package-deb)
515         $(call make,$(PLATFORM),vom-package-deb)
516
517 pkg-deb-debug:
518         $(call make,$(PLATFORM)_debug,vpp-package-deb)
519
520 vom-pkg-deb-debug:
521         $(call make,$(PLATFORM)_debug,vpp-package-deb)
522         $(call make,$(PLATFORM)_debug,vom-package-deb)
523
524 pkg-rpm: dist
525         make -C extras/rpm
526
527 pkg-srpm: dist
528         make -C extras/rpm srpm
529
530 dpdk-install-dev:
531         $(call banner,"This command is deprecated. Please use 'make install-ext-deps'")
532         make -C build/external install-$(PKG)
533
534 install-ext-deps:
535         make -C build/external install-$(PKG)
536
537 ctags: ctags.files
538         @ctags --totals --tag-relative -L $<
539         @rm $<
540
541 gtags: ctags
542         @gtags --gtagslabel=ctags
543
544 cscope: cscope.files
545         @cscope -b -q -v
546
547 checkstyle:
548         @build-root/scripts/checkstyle.sh
549
550 fixstyle:
551         @build-root/scripts/checkstyle.sh --fix
552
553 featurelist:
554         @build-root/scripts/fts.py --all --markdown
555
556 checkfeaturelist:
557         @build-root/scripts/fts.py --validate --git-status
558
559 #
560 # Build the documentation
561 #
562
563 # Doxygen configuration and our utility scripts
564 export DOXY_DIR ?= $(WS_ROOT)/doxygen
565
566 define make-doxy
567         @OS_ID="$(OS_ID)" make -C $(DOXY_DIR) $@
568 endef
569
570 .PHONY: bootstrap-doxygen doxygen wipe-doxygen
571
572 bootstrap-doxygen:
573         $(call make-doxy)
574
575 doxygen:
576         $(call make-doxy)
577
578 wipe-doxygen:
579         $(call make-doxy)
580
581 # Sphinx Documents
582 export DOCS_DIR = $(WS_ROOT)/docs
583 export VENV_DIR = $(WS_ROOT)/sphinx_venv
584 export SPHINX_SCRIPTS_DIR = $(WS_ROOT)/docs/scripts
585
586 .PHONY: docs-venv docs docs-clean
587
588 docs-venv:
589         @($(SPHINX_SCRIPTS_DIR)/sphinx-make.sh venv)
590
591 docs: $(DOCS_DIR)
592         @($(SPHINX_SCRIPTS_DIR)/sphinx-make.sh html)
593
594 docs-clean:
595         @($(SPHINX_SCRIPTS_DIR)/sphinx-make.sh clean)
596
597 verify: install-dep $(BR)/.deps.ok install-ext-deps
598         $(call banner,"Building for PLATFORM=vpp using gcc")
599         @make -C build-root PLATFORM=vpp TAG=vpp wipe-all install-packages
600         $(call banner,"Building sample-plugin")
601         @make -C build-root PLATFORM=vpp TAG=vpp sample-plugin-install
602         $(call banner,"Building libmemif")
603         @make -C build-root PLATFORM=vpp TAG=vpp libmemif-install
604         $(call banner,"Building VOM")
605         @make -C build-root PLATFORM=vpp TAG=vpp vom-install
606         $(call banner,"Building $(PKG) packages")
607         @make pkg-$(PKG)
608 ifeq ($(OS_ID)-$(OS_VERSION_ID),ubuntu-18.04)
609         $(call banner,"Running tests")
610         @make COMPRESS_FAILED_TEST_LOGS=yes RETRIES=3 test
611 endif