VPP Object Model (VOM)
[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 MACHINE=$(shell uname -m)
21
22 ifeq ($(MACHINE),$(filter $(MACHINE),x86_64))
23 export AESNI?=y
24 else
25 export AESNI?=N
26 endif
27
28 ,:=,
29 define disable_plugins
30 $(if $(1), \
31   "plugins {" \
32   $(patsubst %,"plugin %_plugin.so { disable }",$(subst $(,), ,$(1))) \
33   " }" \
34   ,)
35 endef
36
37 MINIMAL_STARTUP_CONF="                                                  \
38 unix {                                                                  \
39         interactive                                                     \
40         cli-listen /run/vpp/cli.sock                                    \
41         gid $(shell id -g)                                              \
42         $(if $(wildcard startup.vpp),"exec startup.vpp",)               \
43 }                                                                       \
44 $(if $(DPDK_CONFIG), "dpdk { $(DPDK_CONFIG) }",)                        \
45 $(call disable_plugins,$(DISABLED_PLUGINS))                             \
46 "
47
48 GDB_ARGS= -ex "handle SIGUSR1 noprint nostop"
49
50 #
51 # OS Detection
52 #
53 # We allow Darwin (MacOS) for docs generation; VPP build will still fail.
54 ifneq ($(shell uname),Darwin)
55 OS_ID        = $(shell grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
56 OS_VERSION_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
57 endif
58
59 ifeq ($(filter ubuntu debian,$(OS_ID)),$(OS_ID))
60 PKG=deb
61 else ifeq ($(filter rhel centos fedora opensuse,$(OS_ID)),$(OS_ID))
62 PKG=rpm
63 endif
64
65 # +libganglia1-dev if building the gmond plugin
66
67 DEB_DEPENDS  = curl build-essential autoconf automake bison ccache
68 DEB_DEPENDS += debhelper dkms git libtool libapr1-dev dh-systemd
69 DEB_DEPENDS += libconfuse-dev git-review exuberant-ctags cscope pkg-config
70 DEB_DEPENDS += lcov chrpath autoconf nasm indent clang-format libnuma-dev
71 DEB_DEPENDS += python-all python-dev python-virtualenv python-pip libffi6 check
72 DEB_DEPENDS += libboost-all-dev
73 ifeq ($(OS_VERSION_ID),14.04)
74         DEB_DEPENDS += openjdk-8-jdk-headless
75         DEB_DEPENDS += libssl-dev
76 else ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-8)
77         DEB_DEPENDS += openjdk-8-jdk-headless
78         DEB_DEPENDS += libssl-dev
79         APT_ARGS = -t jessie-backports
80 else ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-9)
81         DEB_DEPENDS += default-jdk-headless
82         DEB_DEPENDS += libssl1.0-dev
83 else 
84         DEB_DEPENDS += default-jdk-headless
85         DEB_DEPENDS += libssl-dev
86 endif
87
88 RPM_DEPENDS  = redhat-lsb glibc-static java-1.8.0-openjdk-devel yum-utils
89 RPM_DEPENDS += apr-devel
90 RPM_DEPENDS += numactl-devel
91 RPM_DEPENDS += check check-devel
92 RPM_DEPENDS += boost boost-devel
93
94 ifeq ($(OS_ID)-$(OS_VERSION_ID),fedora-25)
95         RPM_DEPENDS += subunit subunit-devel
96         RPM_DEPENDS += openssl-devel
97         RPM_DEPENDS += python-devel
98         RPM_DEPENDS += python2-virtualenv
99         RPM_DEPENDS_GROUPS = 'C Development Tools and Libraries'
100 else ifeq ($(shell if [ "$(OS_ID)" = "fedora" ]; then test $(OS_VERSION_ID) -gt 25; echo $$?; fi),0)
101         RPM_DEPENDS += subunit subunit-devel
102         RPM_DEPENDS += compat-openssl10-devel
103         RPM_DEPENDS += python2-devel
104         RPM_DEPENDS += python2-virtualenv
105         RPM_DEPENDS_GROUPS = 'C Development Tools and Libraries'
106 else
107         RPM_DEPENDS += openssl-devel
108         RPM_DEPENDS += python-devel
109         RPM_DEPENDS += python-virtualenv
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 ifeq ($(OS_ID),fedora)
117         RPM_DEPENDS += nasm
118 else ifeq ($(findstring y,$(AESNI)),y)
119         RPM_DEPENDS += https://kojipkgs.fedoraproject.org//packages/nasm/2.12.02/2.fc26/x86_64/nasm-2.12.02-2.fc26.x86_64.rpm
120 endif
121
122 SUSE_NAME= $(shell grep '^NAME=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g' | cut -d' ' -f2)
123 RPM_SUSE_BUILDTOOLS_DEPS = autoconf automake bison ccache check-devel chrpath clang indent libtool make
124 RPM_SUSE_DEVEL_DEPS = glibc-devel-static java-1_8_0-openjdk-devel libnuma-devel libopenssl-devel openssl-devel 
125 RPM_SUSE_PYTHON_DEPS = python-devel python3-devel python-pip python3-pip python-rpm-macros python3-rpm-macros 
126 RPM_SUSE_PLATFORM_DEPS = distribution-release shadow rpm-build
127
128 ifeq ($(OS_ID),opensuse)
129 ifneq ($(SUSE_NAME),Tumbleweed)
130         RPM_SUSE_DEVEL_DEPS += boost_1_61-devel gcc6 
131         RPM_SUSE_PYTHON_DEPS += python-virtualenv
132         RPM_SUSE_BUILDTOOL_DEPS += https://download.opensuse.org/tumbleweed/repo/oss/suse/x86_64/nasm-2.13.01-2.2.x86_64.rpm
133 else
134         RPM_SUSE_DEVEL_DEPS += boost_1_65-devel gcc
135         RPM_SUSE_PYTHON_DEPS += python2-virtualenv
136         RPM_SUSE_BUILDTOOL_DEPS += nasm
137 endif
138 endif
139
140 RPM_SUSE_DEPENDS += $(RPM_SUSE_BUILDTOOLS_DEPS) $(RPM_SUSE_DEVEL_DEPS) $(RPM_SUSE_PYTHON_DEPS) $(RPM_SUSE_PLATFORM_DEPS)
141
142 ifneq ($(wildcard $(STARTUP_DIR)/startup.conf),)
143         STARTUP_CONF ?= $(STARTUP_DIR)/startup.conf
144 endif
145
146 ifeq ($(findstring y,$(UNATTENDED)),y)
147 CONFIRM=-y
148 FORCE=--force-yes
149 endif
150
151 TARGETS = vpp
152
153 ifneq ($(SAMPLE_PLUGIN),no)
154 TARGETS += sample-plugin
155 endif
156
157 .PHONY: help bootstrap wipe wipe-release build build-release rebuild rebuild-release
158 .PHONY: run run-release debug debug-release build-vat run-vat pkg-deb pkg-rpm
159 .PHONY: ctags cscope
160 .PHONY: test test-debug retest retest-debug test-doc test-wipe-doc test-help test-wipe
161 .PHONY: test-cov test-wipe-cov
162
163 help:
164         @echo "Make Targets:"
165         @echo " bootstrap           - prepare tree for build"
166         @echo " install-dep         - install software dependencies"
167         @echo " wipe                - wipe all products of debug build "
168         @echo " wipe-release        - wipe all products of release build "
169         @echo " build               - build debug binaries"
170         @echo " build-release       - build release binaries"
171         @echo " build-coverity      - build coverity artifacts"
172         @echo " rebuild             - wipe and build debug binares"
173         @echo " rebuild-release     - wipe and build release binares"
174         @echo " run                 - run debug binary"
175         @echo " run-release         - run release binary"
176         @echo " debug               - run debug binary with debugger"
177         @echo " debug-release       - run release binary with debugger"
178         @echo " test                - build and run (basic) functional tests"
179         @echo " test-debug          - build and run (basic) functional tests (debug build)"
180         @echo " test-all            - build and run (all) functional tests"
181         @echo " test-all-debug      - build and run (all) functional tests (debug build)"
182         @echo " test-shell          - enter shell with test environment"
183         @echo " test-shell-debug    - enter shell with test environment (debug build)"
184         @echo " test-wipe           - wipe files generated by unit tests"
185         @echo " retest              - run functional tests"
186         @echo " retest-debug        - run functional tests (debug build)"
187         @echo " test-help           - show help on test framework"
188         @echo " run-vat             - run vpp-api-test tool"
189         @echo " pkg-deb             - build DEB packages"
190         @echo " pkg-rpm             - build RPM packages"
191         @echo " dpdk-install-dev    - install DPDK development packages"
192         @echo " ctags               - (re)generate ctags database"
193         @echo " gtags               - (re)generate gtags database"
194         @echo " cscope              - (re)generate cscope database"
195         @echo " checkstyle          - check coding style"
196         @echo " fixstyle            - fix coding style"
197         @echo " doxygen             - (re)generate documentation"
198         @echo " bootstrap-doxygen   - setup Doxygen dependencies"
199         @echo " wipe-doxygen        - wipe all generated documentation"
200         @echo " test-doc            - generate documentation for test framework"
201         @echo " test-wipe-doc       - wipe documentation for test framework"
202         @echo " test-cov            - generate code coverage report for test framework"
203         @echo " test-wipe-cov       - wipe code coverage report for test framework"
204         @echo " test-checkstyle     - check PEP8 compliance for test framework"
205         @echo ""
206         @echo "Make Arguments:"
207         @echo " V=[0|1]                  - set build verbosity level"
208         @echo " STARTUP_CONF=<path>      - startup configuration file"
209         @echo "                            (e.g. /etc/vpp/startup.conf)"
210         @echo " STARTUP_DIR=<path>       - startup drectory (e.g. /etc/vpp)"
211         @echo "                            It also sets STARTUP_CONF if"
212         @echo "                            startup.conf file is present"
213         @echo " GDB=<path>               - gdb binary to use for debugging"
214         @echo " PLATFORM=<name>          - target platform. default is vpp"
215         @echo " TEST=<filter>            - apply filter to test set, see test-help"
216         @echo " DPDK_CONFIG=<conf>       - add specified dpdk config commands to"
217         @echo "                            autogenerated startup.conf"
218         @echo "                            (e.g. \"no-pci\" )"
219         @echo " SAMPLE_PLUGIN=yes        - in addition build/run/debug sample plugin"
220         @echo " DISABLED_PLUGINS=<list>  - comma separated list of plugins which"
221         @echo "                            should not be loaded"
222         @echo ""
223         @echo "Current Argument Values:"
224         @echo " V                 = $(V)"
225         @echo " STARTUP_CONF      = $(STARTUP_CONF)"
226         @echo " STARTUP_DIR       = $(STARTUP_DIR)"
227         @echo " GDB               = $(GDB)"
228         @echo " PLATFORM          = $(PLATFORM)"
229         @echo " DPDK_VERSION      = $(DPDK_VERSION)"
230         @echo " DPDK_CONFIG       = $(DPDK_CONFIG)"
231         @echo " SAMPLE_PLUGIN     = $(SAMPLE_PLUGIN)"
232         @echo " DISABLED_PLUGINS  = $(DISABLED_PLUGINS)"
233
234 $(BR)/.bootstrap.ok:
235 ifeq ($(findstring y,$(UNATTENDED)),y)
236         make install-dep
237 endif
238 ifeq ($(filter ubuntu debian,$(OS_ID)),$(OS_ID))
239         @MISSING=$$(apt-get install -y -qq -s $(DEB_DEPENDS) | grep "^Inst ") ; \
240         if [ -n "$$MISSING" ] ; then \
241           echo "\nPlease install missing packages: \n$$MISSING\n" ; \
242           echo "by executing \"make install-dep\"\n" ; \
243           exit 1 ; \
244         fi ; \
245         exit 0
246 else ifneq ("$(wildcard /etc/redhat-release)","")
247         @for i in $(RPM_DEPENDS) ; do \
248             RPM=$$(basename -s .rpm "$${i##*/}" | cut -d- -f1,2,3)  ;   \
249             MISSING+=$$(rpm -q $$RPM | grep "^package")    ;    \
250         done                                                       ;    \
251         if [ -n "$$MISSING" ] ; then \
252           echo "Please install missing RPMs: \n$$MISSING\n" ; \
253           echo "by executing \"make install-dep\"\n" ; \
254           exit 1 ; \
255         fi ; \
256         exit 0
257 endif
258         @echo "SOURCE_PATH = $(WS_ROOT)"                   > $(BR)/build-config.mk
259         @echo "#!/bin/bash\n"                              > $(BR)/path_setup
260         @echo 'export PATH=$(BR)/tools/ccache-bin:$$PATH' >> $(BR)/path_setup
261         @echo 'export PATH=$(BR)/tools/bin:$$PATH'        >> $(BR)/path_setup
262         @echo 'export CCACHE_DIR=$(CCACHE_DIR)'           >> $(BR)/path_setup
263
264 ifeq ("$(wildcard /usr/bin/ccache )","")
265         @echo "WARNING: Please install ccache AYEC and re-run this script"
266 else
267         @rm -rf $(BR)/tools/ccache-bin
268         @mkdir -p $(BR)/tools/ccache-bin
269         @ln -s /usr/bin/ccache $(BR)/tools/ccache-bin/gcc
270         @ln -s /usr/bin/ccache $(BR)/tools/ccache-bin/g++
271 endif
272         @make -C $(BR) V=$(V) is_build_tool=yes tools-install
273         @touch $@
274
275 bootstrap: $(BR)/.bootstrap.ok
276
277 install-dep:
278 ifeq ($(filter ubuntu debian,$(OS_ID)),$(OS_ID))
279 ifeq ($(OS_VERSION_ID),14.04)
280         @sudo -E apt-get $(CONFIRM) $(FORCE) install software-properties-common
281         @sudo -E add-apt-repository ppa:openjdk-r/ppa $(CONFIRM)
282 endif
283 ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-8)
284         @grep -q jessie-backports /etc/apt/sources.list /etc/apt/sources.list.d/* 2> /dev/null \
285            || ( echo "Please install jessie-backports" ; exit 1 )
286 endif
287         @sudo -E apt-get update
288         @sudo -E apt-get $(APT_ARGS) $(CONFIRM) $(FORCE) install $(DEB_DEPENDS)
289 else ifneq ("$(wildcard /etc/redhat-release)","")
290         @sudo -E yum groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
291         @sudo -E yum install $(CONFIRM) $(RPM_DEPENDS)
292         @sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs zlib
293 else ifeq ($(filter opensuse,$(OS_ID)),$(OS_ID))
294         @sudo -E zypper refresh
295         @sudo -E zypper install -y $(RPM_SUSE_DEPENDS)
296 else
297         $(error "This option currently works only on Ubuntu, Debian, Centos or openSUSE systems")
298 endif
299
300 define make
301         @make -C $(BR) PLATFORM=$(PLATFORM) TAG=$(1) $(2)
302 endef
303
304 $(BR)/scripts/.version:
305 ifneq ("$(wildcard /etc/redhat-release)","")
306         $(shell $(BR)/scripts/version rpm-string > $(BR)/scripts/.version)
307 else
308         $(shell $(BR)/scripts/version > $(BR)/scripts/.version)
309 endif
310
311 DIST_FILE = $(BR)/vpp-$(shell src/scripts/version).tar
312 DIST_SUBDIR = vpp-$(shell src/scripts/version|cut -f1 -d-)
313
314 dist:
315         @if git rev-parse 2> /dev/null ; then \
316             git archive \
317               --prefix=$(DIST_SUBDIR)/ \
318               --format=tar \
319               -o $(DIST_FILE) \
320             HEAD ; \
321             git describe > $(BR)/.version ; \
322         else \
323             (cd .. ; tar -cf $(DIST_FILE) $(DIST_SUBDIR) --exclude=*.tar) ; \
324             src/scripts/version > $(BR)/.version ; \
325         fi
326         @tar --append \
327           --file $(DIST_FILE) \
328           --transform='s,.*/.version,$(DIST_SUBDIR)/src/scripts/.version,' \
329           $(BR)/.version
330         @$(RM) $(BR)/.version $(DIST_FILE).xz
331         @xz -v --threads=0 $(DIST_FILE)
332         @$(RM) $(BR)/vpp-latest.tar.xz
333         @ln -rs $(DIST_FILE).xz $(BR)/vpp-latest.tar.xz
334
335 build: $(BR)/.bootstrap.ok
336         $(call make,$(PLATFORM)_debug,$(addsuffix -install,$(TARGETS)))
337
338 wipedist:
339         @$(RM) $(BR)/*.tar.xz
340
341 wipe: wipedist $(BR)/.bootstrap.ok
342         $(call make,$(PLATFORM)_debug,$(addsuffix -wipe,$(TARGETS)))
343
344 rebuild: wipe build
345
346 build-release: $(BR)/.bootstrap.ok
347         $(call make,$(PLATFORM),$(addsuffix -install,$(TARGETS)))
348
349 wipe-release: $(BR)/.bootstrap.ok
350         $(call make,$(PLATFORM),$(addsuffix -wipe,$(TARGETS)))
351
352 rebuild-release: wipe-release build-release
353
354 export VPP_PYTHON_PREFIX=$(BR)/python
355
356 libexpand = $(subst $(subst ,, ),:,$(foreach lib,$(1),$(BR)/install-$(2)-native/vpp/$(lib)/$(3)))
357
358 define test
359         $(if $(filter-out $(3),retest),make -C $(BR) PLATFORM=$(1) TAG=$(2) vpp-install,)
360         $(eval libs:=lib lib64)
361         make -C test \
362           TEST_DIR=$(WS_ROOT)/test \
363           VPP_TEST_BUILD_DIR=$(BR)/build-$(2)-native \
364           VPP_TEST_BIN=$(BR)/install-$(2)-native/vpp/bin/vpp \
365           VPP_TEST_PLUGIN_PATH=$(call libexpand,$(libs),$(2),vpp_plugins) \
366           VPP_TEST_INSTALL_PATH=$(BR)/install-$(2)-native/ \
367           LD_LIBRARY_PATH=$(call libexpand,$(libs),$(2),) \
368           EXTENDED_TESTS=$(EXTENDED_TESTS) \
369           PYTHON=$(PYTHON) \
370           OS_ID=$(OS_ID) \
371           $(3)
372 endef
373
374 test: bootstrap
375         $(call test,vpp,vpp,test)
376
377 test-debug: bootstrap
378         $(call test,vpp,vpp_debug,test)
379
380 test-all: bootstrap
381         $(eval EXTENDED_TESTS=yes)
382         $(call test,vpp,vpp,test)
383
384 test-all-debug: bootstrap
385         $(eval EXTENDED_TESTS=yes)
386         $(call test,vpp,vpp_debug,test)
387
388 test-help:
389         @make -C test help
390
391 test-wipe:
392         @make -C test wipe
393
394 test-shell: bootstrap
395         $(call test,vpp,vpp,shell)
396
397 test-shell-debug: bootstrap
398         $(call test,vpp,vpp_debug,shell)
399
400 test-doc:
401         @make -C test doc
402
403 test-wipe-doc:
404         @make -C test wipe-doc
405
406 test-cov: bootstrap
407         $(eval EXTENDED_TESTS=yes)
408         $(call test,vpp,vpp_gcov,cov)
409
410 test-wipe-cov:
411         @make -C test wipe-cov
412
413 test-checkstyle:
414         @make -C test checkstyle
415
416 retest:
417         $(call test,vpp,vpp,retest)
418
419 retest-debug:
420         $(call test,vpp,vpp_debug,retest)
421
422 STARTUP_DIR ?= $(PWD)
423 ifeq ("$(wildcard $(STARTUP_CONF))","")
424 define run
425         @echo "WARNING: STARTUP_CONF not defined or file doesn't exist."
426         @echo "         Running with minimal startup config: $(MINIMAL_STARTUP_CONF)\n"
427         @cd $(STARTUP_DIR) && \
428           sudo $(2) $(1)/vpp/bin/vpp $(MINIMAL_STARTUP_CONF) \
429             plugin_path $(subst $(subst ,, ),:,$(wildcard $(1)/*/lib*/vpp_plugins))
430 endef
431 else
432 define run
433         @cd $(STARTUP_DIR) && \
434           sudo $(2) $(1)/vpp/bin/vpp $(shell cat $(STARTUP_CONF) | sed -e 's/#.*//') \
435             plugin_path $(subst $(subst ,, ),:,$(wildcard $(1)/*/lib*/vpp_plugins))
436 endef
437 endif
438
439 %.files: .FORCE
440         @find . \( -name '*\.[chyS]' -o -name '*\.java' -o -name '*\.lex' \) -and \
441                 \( -not -path './build-root*' -o -path \
442                 './build-root/build-vpp_debug-native/dpdk*' \) > $@
443
444 .FORCE:
445
446 run:
447         $(call run, $(BR)/install-$(PLATFORM)_debug-native)
448
449 run-release:
450         $(call run, $(BR)/install-$(PLATFORM)-native)
451
452 debug:
453         $(call run, $(BR)/install-$(PLATFORM)_debug-native,$(GDB) $(GDB_ARGS) --args)
454
455 build-coverity: 
456         $(call make,$(PLATFORM)_coverity,install-packages)
457
458 debug-release:
459         $(call run, $(BR)/install-$(PLATFORM)-native,$(GDB) $(GDB_ARGS) --args)
460
461 build-vat:
462         $(call make,$(PLATFORM)_debug,vpp-api-test-install)
463
464 run-vat:
465         @sudo $(BR)/install-$(PLATFORM)_debug-native/vpp/bin/vpp_api_test
466
467 pkg-deb:
468         $(call make,$(PLATFORM),install-deb)
469
470 pkg-rpm: dist
471         make -C extras/rpm
472
473 pkg-srpm: dist
474         make -C extras/rpm srpm
475
476 dpdk-install-dev:
477         make -C dpdk install-$(PKG)
478
479 ctags: ctags.files
480         @ctags --totals --tag-relative -L $<
481         @rm $<
482
483 gtags: ctags
484         @gtags --gtagslabel=ctags
485
486 cscope: cscope.files
487         @cscope -b -q -v
488
489 checkstyle:
490         @build-root/scripts/checkstyle.sh
491
492 fixstyle:
493         @build-root/scripts/checkstyle.sh --fix
494
495 #
496 # Build the documentation
497 #
498
499 # Doxygen configuration and our utility scripts
500 export DOXY_DIR ?= $(WS_ROOT)/doxygen
501
502 define make-doxy
503         @OS_ID="$(OS_ID)" make -C $(DOXY_DIR) $@
504 endef
505
506 .PHONY: bootstrap-doxygen doxygen wipe-doxygen
507
508 bootstrap-doxygen:
509         $(call make-doxy)
510
511 doxygen:
512         $(call make-doxy)
513
514 wipe-doxygen:
515         $(call make-doxy)
516
517 define banner
518         @echo "========================================================================"
519         @echo " $(1)"
520         @echo "========================================================================"
521         @echo " "
522 endef
523
524 verify: install-dep $(BR)/.bootstrap.ok dpdk-install-dev
525         $(call banner,"Building for PLATFORM=vpp using gcc")
526         @make -C build-root PLATFORM=vpp TAG=vpp wipe-all install-packages
527 ifeq ($(OS_ID)-$(OS_VERSION_ID),ubuntu-16.04)
528         $(call banner,"Installing dependencies")
529         @sudo -E apt-get update
530         @sudo -E apt-get $(CONFIRM) $(FORCE) install clang
531         $(call banner,"Building for PLATFORM=vpp using clang")
532         @make -C build-root CC=clang PLATFORM=vpp TAG=vpp_clang wipe-all install-packages
533 endif
534         $(call banner,"Building sample-plugin")
535         @make -C build-root PLATFORM=vpp TAG=vpp sample-plugin-install
536         $(call banner,"Building $(PKG) packages")
537         @make pkg-$(PKG)
538 ifeq ($(OS_ID)-$(OS_VERSION_ID),ubuntu-16.04)
539         @make COMPRESS_FAILED_TEST_LOGS=yes RETRIES=3 test
540 endif
541
542