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