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