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