1e17fdb5dSDamjan Marion# Copyright (c) 2016 Cisco and/or its affiliates.
2e17fdb5dSDamjan Marion# Licensed under the Apache License, Version 2.0 (the "License");
3e17fdb5dSDamjan Marion# you may not use this file except in compliance with the License.
4e17fdb5dSDamjan Marion# You may obtain a copy of the License at:
5e17fdb5dSDamjan Marion#
6e17fdb5dSDamjan Marion#     http://www.apache.org/licenses/LICENSE-2.0
7e17fdb5dSDamjan Marion#
8e17fdb5dSDamjan Marion# Unless required by applicable law or agreed to in writing, software
9e17fdb5dSDamjan Marion# distributed under the License is distributed on an "AS IS" BASIS,
10e17fdb5dSDamjan Marion# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11e17fdb5dSDamjan Marion# See the License for the specific language governing permissions and
12e17fdb5dSDamjan Marion# limitations under the License.
13e17fdb5dSDamjan Marion
146484b3baSDamjan Marionexport WS_ROOT=$(CURDIR)
156484b3baSDamjan Marionexport BR=$(WS_ROOT)/build-root
16e17fdb5dSDamjan MarionCCACHE_DIR?=$(BR)/.ccache
17e17fdb5dSDamjan MarionGDB?=gdb
18e6f9023fSDamjan MarionPLATFORM?=vpp
190dc3f191SDamjan MarionSAMPLE_PLUGIN?=no
20005849ecSDamjan MarionSTARTUP_DIR?=$(PWD)
2140b655c3SBrian BrooksMACHINE=$(shell uname -m)
2272d2c4f3SDamjan MarionSUDO?=sudo
23be7ef3b5SDamjan MarionDPDK_CONFIG?=no-pci
2440b655c3SBrian Brooks
25b1dab65aSDamjan Marion,:=,
26b1dab65aSDamjan Mariondefine disable_plugins
27b1dab65aSDamjan Marion$(if $(1), \
28b1dab65aSDamjan Marion  "plugins {" \
29b1dab65aSDamjan Marion  $(patsubst %,"plugin %_plugin.so { disable }",$(subst $(,), ,$(1))) \
30b1dab65aSDamjan Marion  " }" \
31b1dab65aSDamjan Marion  ,)
32b1dab65aSDamjan Marionendef
33b1dab65aSDamjan Marion
34b1dab65aSDamjan MarionMINIMAL_STARTUP_CONF="							\
35b1dab65aSDamjan Marionunix { 									\
36b1dab65aSDamjan Marion	interactive 							\
37b1dab65aSDamjan Marion	cli-listen /run/vpp/cli.sock					\
38b1dab65aSDamjan Marion	gid $(shell id -g)						\
39b1dab65aSDamjan Marion	$(if $(wildcard startup.vpp),"exec startup.vpp",)		\
40b1dab65aSDamjan Marion}									\
41b1dab65aSDamjan Marion$(if $(DPDK_CONFIG), "dpdk { $(DPDK_CONFIG) }",)			\
42b1dab65aSDamjan Marion$(call disable_plugins,$(DISABLED_PLUGINS))				\
43b1dab65aSDamjan Marion"
44e17fdb5dSDamjan Marion
45eef4d99bSDamjan MarionGDB_ARGS= -ex "handle SIGUSR1 noprint nostop"
46eef4d99bSDamjan Marion
47c5e8681bSDamjan Marion#
48c5e8681bSDamjan Marion# OS Detection
49c5e8681bSDamjan Marion#
5036d25063SChris Luke# We allow Darwin (MacOS) for docs generation; VPP build will still fail.
5136d25063SChris Lukeifneq ($(shell uname),Darwin)
52c5e8681bSDamjan MarionOS_ID        = $(shell grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
53c5e8681bSDamjan MarionOS_VERSION_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
5436d25063SChris Lukeendif
55c5e8681bSDamjan Marion
56898171afSGabriel Ganneifeq ($(filter ubuntu debian,$(OS_ID)),$(OS_ID))
572ce7f983SDamjan MarionPKG=deb
5819be50edSMarco Varleseelse ifeq ($(filter rhel centos fedora opensuse opensuse-leap opensuse-tumbleweed,$(OS_ID)),$(OS_ID))
592ce7f983SDamjan MarionPKG=rpm
602ce7f983SDamjan Marionendif
612ce7f983SDamjan Marion
62d756b350SDave Wallace# +libganglia1-dev if building the gmond plugin
63d756b350SDave Wallace
649d420871SOle TroanDEB_DEPENDS  = curl build-essential autoconf automake ccache
65d756b350SDave WallaceDEB_DEPENDS += debhelper dkms git libtool libapr1-dev dh-systemd
666bbf83a0SDamjan MarionDEB_DEPENDS += libconfuse-dev git-review exuberant-ctags cscope pkg-config
676184db35SSergio Gonzalez MonroyDEB_DEPENDS += lcov chrpath autoconf indent clang-format libnuma-dev
68c03bb3b4SEd KernDEB_DEPENDS += python-all python3-all python3-setuptools
69e4a6d69fSOle TroanDEB_DEPENDS += python-virtualenv python-pip libffi6 check
707e0c48e3SPaul VinciguerraDEB_DEPENDS += libboost-all-dev libffi-dev python3-ply libmbedtls-dev
71f3aebda7SOle TroanDEB_DEPENDS += cmake ninja-build uuid-dev python3-jsonschema python3-yaml
722c6efec5SPaul VinciguerraDEB_DEPENDS += python3-venv  # ensurepip
739d0ca07fSPaul VinciguerraDEB_DEPENDS += python3-dev   # needed for python3 -m pip install psutil
749d0ca07fSPaul Vinciguerra# python3.6 on 16.04 requires python36-dev
759d0ca07fSPaul Vinciguerra 
76c03bb3b4SEd Kernifeq ($(OS_VERSION_ID),16.04)
77c03bb3b4SEd Kern	DEB_DEPENDS += python-dev
78c03bb3b4SEd Kernelse ifeq ($(OS_VERSION_ID),18.04)
79c03bb3b4SEd Kern	DEB_DEPENDS += python-dev
809b6463d7SDamjan Marionelse ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-8)
81e6f3b467SAnton Ivanov	DEB_DEPENDS += libssl-dev
829b6463d7SDamjan Marion	APT_ARGS = -t jessie-backports
83e6f3b467SAnton Ivanovelse ifeq ($(OS_ID)-$(OS_VERSION_ID),debian-9)
84e6f3b467SAnton Ivanov	DEB_DEPENDS += libssl1.0-dev
85005849ecSDamjan Marionelse
86e6f3b467SAnton Ivanov	DEB_DEPENDS += libssl-dev
87027103e5SEd Warnickeendif
88e17fdb5dSDamjan Marion
894e633e10SMichal CmaradaRPM_DEPENDS  = redhat-lsb glibc-static
90555d9203SGabriel GanneRPM_DEPENDS += apr-devel
91bd8e2420SThomas F HerbertRPM_DEPENDS += numactl-devel
92e4128911SThomas F HerbertRPM_DEPENDS += check check-devel
93812ed39fSNeale RannsRPM_DEPENDS += boost boost-devel
9428cf3b7dSBilly McFallRPM_DEPENDS += selinux-policy selinux-policy-devel
956eb61639SThomas F HerbertRPM_DEPENDS += ninja-build
966fbef232SStephen HemmingerRPM_DEPENDS += libuuid-devel
97e8692691SjdeniscoRPM_DEPENDS += mbedtls-devel
98d3e671e0SKlement Sekera
996eb61639SThomas F Herbertifeq ($(OS_ID),fedora)
1006eb61639SThomas F Herbert	RPM_DEPENDS += dnf-utils
1016673178dSThomas F Herbert	RPM_DEPENDS += subunit subunit-devel
102440751b9SThomas F Herbert	RPM_DEPENDS += compat-openssl10-devel
10386e8bce4SEd Kern	RPM_DEPENDS += python3-devel  # needed for python3 -m pip install psutil
1049d0ca07fSPaul Vinciguerra	RPM_DEPENDS += python3-ply  # for vppapigen
1056a3064fdSOle Troan	RPM_DEPENDS += python3-virtualenv python3-jsonschema
1066eb61639SThomas F Herbert	RPM_DEPENDS += cmake
107bc1c8487SThomas F Herbert	RPM_DEPENDS_GROUPS = 'C Development Tools and Libraries'
108c025329bSRenato Botelho do Coutoelse ifeq ($(OS_ID)-$(OS_VERSION_ID),centos-8)
10986e8bce4SEd Kern	RPM_DEPENDS += yum-utils
110c025329bSRenato Botelho do Couto	RPM_DEPENDS += compat-openssl10
11186e8bce4SEd Kern	RPM_DEPENDS += python36-devel python3-ply
112c025329bSRenato Botelho do Couto	RPM_DEPENDS += python3-virtualenv python3-jsonschema
113c025329bSRenato Botelho do Couto	RPM_DEPENDS += cmake
114c025329bSRenato Botelho do Couto	RPM_DEPENDS_GROUPS = 'Development Tools'
11528ea2515SThomas F Herbertelse
1166eb61639SThomas F Herbert	RPM_DEPENDS += yum-utils
117440751b9SThomas F Herbert	RPM_DEPENDS += openssl-devel
1189d0ca07fSPaul Vinciguerra	RPM_DEPENDS += python36-ply  # for vppapigen
119c63c0166SEd Kern	RPM_DEPENDS += python3-devel python3-pip
1206a3064fdSOle Troan	RPM_DEPENDS += python-virtualenv python36-jsonschema
121855e2686SDamjan Marion	RPM_DEPENDS += devtoolset-7
1226eb61639SThomas F Herbert	RPM_DEPENDS += cmake3
123bc1c8487SThomas F Herbert	RPM_DEPENDS_GROUPS = 'Development Tools'
12428ea2515SThomas F Herbertendif
125d756b350SDave Wallace
126d756b350SDave Wallace# +ganglia-devel if building the ganglia plugin
127d756b350SDave Wallace
128bc1c8487SThomas F HerbertRPM_DEPENDS += chrpath libffi-devel rpm-build
1291538824aSPaul Vinciguerra# lowercase- replace spaces with dashes.
1301538824aSPaul VinciguerraSUSE_NAME= $(shell grep '^NAME=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g' | sed -e 's/ /-/' | awk '{print tolower($$0)}')
131e3ae09f8SEd KernSUSE_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g' | cut -d' ' -f2)
1329d420871SOle TroanRPM_SUSE_BUILDTOOLS_DEPS = autoconf automake ccache check-devel chrpath
1337e0c48e3SPaul VinciguerraRPM_SUSE_BUILDTOOLS_DEPS += clang cmake indent libtool make ninja python3-ply
134fedc455bSMarco Varlese
1354e633e10SMichal CmaradaRPM_SUSE_DEVEL_DEPS = glibc-devel-static libnuma-devel
1366fbef232SStephen HemmingerRPM_SUSE_DEVEL_DEPS += libopenssl-devel openssl-devel mbedtls-devel libuuid-devel
137fedc455bSMarco Varlese
138fedc455bSMarco VarleseRPM_SUSE_PYTHON_DEPS = python-devel python3-devel python-pip python3-pip
139fedc455bSMarco VarleseRPM_SUSE_PYTHON_DEPS += python-rpm-macros python3-rpm-macros
140fedc455bSMarco Varlese
141db41776aSMarco VarleseRPM_SUSE_PLATFORM_DEPS = distribution-release shadow rpm-build
1425f1231c5SMarco Varlese
1435f1231c5SMarco Varleseifeq ($(OS_ID),opensuse)
1441538824aSPaul Vinciguerraifeq ($(SUSE_NAME),tumbleweed)
145223548d4SFlorin Coras	RPM_SUSE_DEVEL_DEPS = libboost_headers1_68_0-devel-1.68.0  libboost_thread1_68_0-devel-1.68.0 gcc
1467e0c48e3SPaul Vinciguerra	RPM_SUSE_PYTHON_DEPS += python3-ply python2-virtualenv
1475f1231c5SMarco Varleseendif
148e3ae09f8SEd Kernifeq ($(SUSE_ID),15.0)
149fd9d04d8SEd Kern	RPM_SUSE_DEVEL_DEPS += libboost_headers-devel libboost_thread-devel gcc
1507e0c48e3SPaul Vinciguerra	RPM_SUSE_PYTHON_DEPS += python3-ply python2-virtualenv
151e3ae09f8SEd Kernelse
152223548d4SFlorin Coras	RPM_SUSE_DEVEL_DEPS += libboost_headers1_68_0-devel-1.68.0 gcc6
153e3ae09f8SEd Kern	RPM_SUSE_PYTHON_DEPS += python-virtualenv
154e3ae09f8SEd Kernendif
1555f1231c5SMarco Varleseendif
156d6ad5a51SMarco Varlese
157947fe5e8SEd Kernifeq ($(OS_ID),opensuse-leap)
158947fe5e8SEd Kernifeq ($(SUSE_ID),15.0)
159ec6e8d26SBenoît Ganne	RPM_SUSE_DEVEL_DEPS += libboost_headers-devel libboost_thread-devel gcc git curl
1607e0c48e3SPaul Vinciguerra	RPM_SUSE_PYTHON_DEPS += python3-ply python2-virtualenv
161947fe5e8SEd Kernendif
162947fe5e8SEd Kernendif
163947fe5e8SEd Kern
164db41776aSMarco VarleseRPM_SUSE_DEPENDS += $(RPM_SUSE_BUILDTOOLS_DEPS) $(RPM_SUSE_DEVEL_DEPS) $(RPM_SUSE_PYTHON_DEPS) $(RPM_SUSE_PLATFORM_DEPS)
165db41776aSMarco Varlese
1660df78ddaSDamjan Marionifneq ($(wildcard $(STARTUP_DIR)/startup.conf),)
167eef4d99bSDamjan Marion        STARTUP_CONF ?= $(STARTUP_DIR)/startup.conf
168eef4d99bSDamjan Marionendif
169e17fdb5dSDamjan Marion
170c5e8681bSDamjan Marionifeq ($(findstring y,$(UNATTENDED)),y)
171c5e8681bSDamjan MarionCONFIRM=-y
172f289ca6bSKeith Burns (alagalah)FORCE=--force-yes
173c5e8681bSDamjan Marionendif
174c5e8681bSDamjan Marion
1750dc3f191SDamjan MarionTARGETS = vpp
1760dc3f191SDamjan Marion
1770dc3f191SDamjan Marionifneq ($(SAMPLE_PLUGIN),no)
1780dc3f191SDamjan MarionTARGETS += sample-plugin
1790dc3f191SDamjan Marionendif
1800dc3f191SDamjan Marion
1814a6cb83dSDamjan Mariondefine banner
1824a6cb83dSDamjan Marion	@echo "========================================================================"
1834a6cb83dSDamjan Marion	@echo " $(1)"
1844a6cb83dSDamjan Marion	@echo "========================================================================"
1854a6cb83dSDamjan Marion	@echo " "
1864a6cb83dSDamjan Marionendef
1874a6cb83dSDamjan Marion
188e7906906SDave Wallace.PHONY: help
189e17fdb5dSDamjan Marionhelp:
190e17fdb5dSDamjan Marion	@echo "Make Targets:"
191e7906906SDave Wallace	@echo " install-dep[s]       - install software dependencies"
1922777ec76SDave Wallace	@echo " wipe                 - wipe all products of debug build "
1932777ec76SDave Wallace	@echo " wipe-release         - wipe all products of release build "
1942777ec76SDave Wallace	@echo " build                - build debug binaries"
1952777ec76SDave Wallace	@echo " build-release        - build release binaries"
1962777ec76SDave Wallace	@echo " build-coverity       - build coverity artifacts"
197ea1a6513SPaul Vinciguerra	@echo " rebuild              - wipe and build debug binaries"
198ea1a6513SPaul Vinciguerra	@echo " rebuild-release      - wipe and build release binaries"
1992777ec76SDave Wallace	@echo " run                  - run debug binary"
2002777ec76SDave Wallace	@echo " run-release          - run release binary"
2012777ec76SDave Wallace	@echo " debug                - run debug binary with debugger"
2022777ec76SDave Wallace	@echo " debug-release        - run release binary with debugger"
203f0797d13SDave Wallace	@echo " test                 - build and run tests"
2042777ec76SDave Wallace	@echo " test-help            - show help on test framework"
2052777ec76SDave Wallace	@echo " run-vat              - run vpp-api-test tool"
2062777ec76SDave Wallace	@echo " pkg-deb              - build DEB packages"
2072777ec76SDave Wallace	@echo " pkg-deb-debug        - build DEB debug packages"
2082777ec76SDave Wallace	@echo " vom-pkg-deb          - build vom DEB packages"
2092777ec76SDave Wallace	@echo " vom-pkg-deb-debug    - build vom DEB debug packages"
2102777ec76SDave Wallace	@echo " pkg-rpm              - build RPM packages"
211e7906906SDave Wallace	@echo " install-ext-dep[s]   - install external development dependencies"
2122777ec76SDave Wallace	@echo " ctags                - (re)generate ctags database"
2132777ec76SDave Wallace	@echo " gtags                - (re)generate gtags database"
2142777ec76SDave Wallace	@echo " cscope               - (re)generate cscope database"
2152777ec76SDave Wallace	@echo " checkstyle           - check coding style"
216e7906906SDave Wallace	@echo " checkstyle-commit    - check commit message format"
217e7906906SDave Wallace	@echo " checkstyle-test      - check test framework coding style"
2182777ec76SDave Wallace	@echo " fixstyle             - fix coding style"
2192777ec76SDave Wallace	@echo " doxygen              - (re)generate documentation"
2202777ec76SDave Wallace	@echo " bootstrap-doxygen    - setup Doxygen dependencies"
2212777ec76SDave Wallace	@echo " wipe-doxygen         - wipe all generated documentation"
2222777ec76SDave Wallace	@echo " checkfeaturelist     - check FEATURE.yaml according to schema"
2232777ec76SDave Wallace	@echo " featurelist          - dump feature list in markdown"
2242777ec76SDave Wallace	@echo " json-api-files       - (re)-generate json api files"
2259529feb4SPaul Vinciguerra	@echo " json-api-files-debug - (re)-generate json api files for debug target"
2263138d723Sjdenisco	@echo " docs                 - Build the Sphinx documentation"
2272777ec76SDave Wallace	@echo " docs-venv            - Build the virtual environment for the Sphinx docs"
2282777ec76SDave Wallace	@echo " docs-clean           - Remove the generated files from the Sphinx docs"
229e17fdb5dSDamjan Marion	@echo ""
230e17fdb5dSDamjan Marion	@echo "Make Arguments:"
231b1dab65aSDamjan Marion	@echo " V=[0|1]                  - set build verbosity level"
232b1dab65aSDamjan Marion	@echo " STARTUP_CONF=<path>      - startup configuration file"
233b1dab65aSDamjan Marion	@echo "                            (e.g. /etc/vpp/startup.conf)"
234ea1a6513SPaul Vinciguerra	@echo " STARTUP_DIR=<path>       - startup directory (e.g. /etc/vpp)"
235b1dab65aSDamjan Marion	@echo "                            It also sets STARTUP_CONF if"
236b1dab65aSDamjan Marion	@echo "                            startup.conf file is present"
237b1dab65aSDamjan Marion	@echo " GDB=<path>               - gdb binary to use for debugging"
238b1dab65aSDamjan Marion	@echo " PLATFORM=<name>          - target platform. default is vpp"
239b1dab65aSDamjan Marion	@echo " TEST=<filter>            - apply filter to test set, see test-help"
240b1dab65aSDamjan Marion	@echo " DPDK_CONFIG=<conf>       - add specified dpdk config commands to"
241b1dab65aSDamjan Marion	@echo "                            autogenerated startup.conf"
242b1dab65aSDamjan Marion	@echo "                            (e.g. \"no-pci\" )"
243b1dab65aSDamjan Marion	@echo " SAMPLE_PLUGIN=yes        - in addition build/run/debug sample plugin"
244b1dab65aSDamjan Marion	@echo " DISABLED_PLUGINS=<list>  - comma separated list of plugins which"
245b1dab65aSDamjan Marion	@echo "                            should not be loaded"
246e17fdb5dSDamjan Marion	@echo ""
247277b89c9SKlement Sekera	@echo "Current Argument Values:"
2480dc3f191SDamjan Marion	@echo " V                 = $(V)"
2490dc3f191SDamjan Marion	@echo " STARTUP_CONF      = $(STARTUP_CONF)"
2500dc3f191SDamjan Marion	@echo " STARTUP_DIR       = $(STARTUP_DIR)"
2510dc3f191SDamjan Marion	@echo " GDB               = $(GDB)"
2520dc3f191SDamjan Marion	@echo " PLATFORM          = $(PLATFORM)"
2530dc3f191SDamjan Marion	@echo " DPDK_VERSION      = $(DPDK_VERSION)"
254b1dab65aSDamjan Marion	@echo " DPDK_CONFIG       = $(DPDK_CONFIG)"
2550dc3f191SDamjan Marion	@echo " SAMPLE_PLUGIN     = $(SAMPLE_PLUGIN)"
256b1dab65aSDamjan Marion	@echo " DISABLED_PLUGINS  = $(DISABLED_PLUGINS)"
257e17fdb5dSDamjan Marion
25855f99675SDamjan Marion$(BR)/.deps.ok:
259c21d59faSDamjan Marionifeq ($(findstring y,$(UNATTENDED)),y)
260c21d59faSDamjan Marion	make install-dep
261c21d59faSDamjan Marionendif
2629b6463d7SDamjan Marionifeq ($(filter ubuntu debian,$(OS_ID)),$(OS_ID))
263e17fdb5dSDamjan Marion	@MISSING=$$(apt-get install -y -qq -s $(DEB_DEPENDS) | grep "^Inst ") ; \
264e17fdb5dSDamjan Marion	if [ -n "$$MISSING" ] ; then \
265e17fdb5dSDamjan Marion	  echo "\nPlease install missing packages: \n$$MISSING\n" ; \
266ebb27fb4SDamjan Marion	  echo "by executing \"make install-dep\"\n" ; \
267e17fdb5dSDamjan Marion	  exit 1 ; \
268e17fdb5dSDamjan Marion	fi ; \
269e17fdb5dSDamjan Marion	exit 0
27070efbfcdSThomas F Herbertelse ifneq ("$(wildcard /etc/redhat-release)","")
271bd8e2420SThomas F Herbert	@for i in $(RPM_DEPENDS) ; do \
27270efbfcdSThomas F Herbert	    RPM=$$(basename -s .rpm "$${i##*/}" | cut -d- -f1,2,3)  ;	\
273bd8e2420SThomas F Herbert	    MISSING+=$$(rpm -q $$RPM | grep "^package")	   ;    \
27470efbfcdSThomas F Herbert	done							   ;	\
27570efbfcdSThomas F Herbert	if [ -n "$$MISSING" ] ; then \
27670efbfcdSThomas F Herbert	  echo "Please install missing RPMs: \n$$MISSING\n" ; \
27770efbfcdSThomas F Herbert	  echo "by executing \"make install-dep\"\n" ; \
27870efbfcdSThomas F Herbert	  exit 1 ; \
27970efbfcdSThomas F Herbert	fi ; \
28070efbfcdSThomas F Herbert	exit 0
281e17fdb5dSDamjan Marionendif
282e17fdb5dSDamjan Marion	@touch $@
283e17fdb5dSDamjan Marion
284e7906906SDave Wallace.PHONY: bootstrap
28555f99675SDamjan Marionbootstrap:
28655f99675SDamjan Marion	@echo "'make bootstrap' is not needed anymore"
287e17fdb5dSDamjan Marion
288e7906906SDave Wallace.PHONY: install-dep
289ebb27fb4SDamjan Marioninstall-dep:
2909b6463d7SDamjan Marionifeq ($(filter ubuntu debian,$(OS_ID)),$(OS_ID))
291c5e8681bSDamjan Marionifeq ($(OS_VERSION_ID),14.04)
292f289ca6bSKeith Burns (alagalah)	@sudo -E apt-get $(CONFIRM) $(FORCE) install software-properties-common
2939b6463d7SDamjan Marionendif
2949b6463d7SDamjan Marionifeq ($(OS_ID)-$(OS_VERSION_ID),debian-8)
2959b6463d7SDamjan Marion	@grep -q jessie-backports /etc/apt/sources.list /etc/apt/sources.list.d/* 2> /dev/null \
2969b6463d7SDamjan Marion           || ( echo "Please install jessie-backports" ; exit 1 )
297c5e8681bSDamjan Marionendif
298eb82e7f2SEd Warnicke	@sudo -E apt-get update
2999b6463d7SDamjan Marion	@sudo -E apt-get $(APT_ARGS) $(CONFIRM) $(FORCE) install $(DEB_DEPENDS)
30084eda9deSEd Warnickeelse ifneq ("$(wildcard /etc/redhat-release)","")
301840cd12eSYichen Wangifeq ($(OS_ID),rhel)
302840cd12eSYichen Wang	@sudo -E yum-config-manager --enable rhel-server-rhscl-7-rpms
30300cbd57aSYichen Wang	@sudo -E yum groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
30400cbd57aSYichen Wang	@sudo -E yum install $(CONFIRM) $(RPM_DEPENDS)
30500cbd57aSYichen Wang	@sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs mbedtls-devel zlib
306c025329bSRenato Botelho do Coutoelse ifeq ($(OS_ID)-$(OS_VERSION_ID),centos-8)
307c025329bSRenato Botelho do Couto	@sudo -E dnf groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
308c025329bSRenato Botelho do Couto	@sudo -E dnf install $(CONFIRM) $(RPM_DEPENDS)
309840cd12eSYichen Wangelse ifeq ($(OS_ID),centos)
3106dd5e340Sdrenfong.wang	@sudo -E yum install $(CONFIRM) centos-release-scl-rh epel-release
311840cd12eSYichen Wang	@sudo -E yum groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
312b17402ecSGabriel Ganne	@sudo -E yum install $(CONFIRM) $(RPM_DEPENDS)
313371ca50aSFlorin Coras	@sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs mbedtls-devel zlib
3146eb61639SThomas F Herbertelse ifeq ($(OS_ID),fedora)
3156eb61639SThomas F Herbert	@sudo -E dnf groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
3166eb61639SThomas F Herbert	@sudo -E dnf install $(CONFIRM) $(RPM_DEPENDS)
3176eb61639SThomas F Herbert	@sudo -E debuginfo-install $(CONFIRM) glibc openssl-libs mbedtls-devel zlib
3186eb61639SThomas F Herbertendif
31923722e6bSMarco Varleseelse ifeq ($(filter opensuse-tumbleweed,$(OS_ID)),$(OS_ID))
32050ec7211SMarco Varlese	@sudo -E zypper refresh
32150ec7211SMarco Varlese	@sudo -E zypper install -y $(RPM_SUSE_DEPENDS)
322947fe5e8SEd Kernelse ifeq ($(filter opensuse-leap,$(OS_ID)),$(OS_ID))
323947fe5e8SEd Kern	@sudo -E zypper refresh
324223548d4SFlorin Coras	@sudo -E zypper install  -y $(RPM_SUSE_DEPENDS)
3256604ddeaSEd Kernelse ifeq ($(filter opensuse,$(OS_ID)),$(OS_ID))
3266604ddeaSEd Kern	@sudo -E zypper refresh
3276604ddeaSEd Kern	@sudo -E zypper install -y $(RPM_SUSE_DEPENDS)
328ebb27fb4SDamjan Marionelse
329840cd12eSYichen Wang	$(error "This option currently works only on Ubuntu, Debian, RHEL, CentOS or openSUSE systems")
330ebb27fb4SDamjan Marionendif
331e4218be6SOle Troan	git config commit.template .git_commit_template.txt
332ebb27fb4SDamjan Marion
333e7906906SDave Wallace.PHONY: install-deps
334e7906906SDave Wallaceinstall-deps: install-dep
335e7906906SDave Wallace
336e17fdb5dSDamjan Mariondefine make
3376b1d7c55SDamjan Marion	@make -C $(BR) PLATFORM=$(PLATFORM) TAG=$(1) $(2)
338e17fdb5dSDamjan Marionendef
339e17fdb5dSDamjan Marion
34020a29c7bSThomas F Herbert$(BR)/scripts/.version:
34120a29c7bSThomas F Herbertifneq ("$(wildcard /etc/redhat-release)","")
34220a29c7bSThomas F Herbert	$(shell $(BR)/scripts/version rpm-string > $(BR)/scripts/.version)
34320a29c7bSThomas F Herbertelse
34420a29c7bSThomas F Herbert	$(shell $(BR)/scripts/version > $(BR)/scripts/.version)
34520a29c7bSThomas F Herbertendif
34620a29c7bSThomas F Herbert
347c06eeb0eSDamjan MarionDIST_FILE = $(BR)/vpp-$(shell src/scripts/version).tar
348c06eeb0eSDamjan MarionDIST_SUBDIR = vpp-$(shell src/scripts/version|cut -f1 -d-)
349c06eeb0eSDamjan Marion
350e7906906SDave Wallace.PHONY: dist
351c06eeb0eSDamjan Mariondist:
3528d48722bSThomas F Herbert	@if git rev-parse 2> /dev/null ; then \
3538d48722bSThomas F Herbert	    git archive \
3548d48722bSThomas F Herbert	      --prefix=$(DIST_SUBDIR)/ \
3558d48722bSThomas F Herbert	      --format=tar \
3568d48722bSThomas F Herbert	      -o $(DIST_FILE) \
3578d48722bSThomas F Herbert	    HEAD ; \
3588d48722bSThomas F Herbert	    git describe > $(BR)/.version ; \
3598d48722bSThomas F Herbert	else \
3608d48722bSThomas F Herbert	    (cd .. ; tar -cf $(DIST_FILE) $(DIST_SUBDIR) --exclude=*.tar) ; \
3618d48722bSThomas F Herbert	    src/scripts/version > $(BR)/.version ; \
3628d48722bSThomas F Herbert	fi
363c06eeb0eSDamjan Marion	@tar --append \
364c06eeb0eSDamjan Marion	  --file $(DIST_FILE) \
365c06eeb0eSDamjan Marion	  --transform='s,.*/.version,$(DIST_SUBDIR)/src/scripts/.version,' \
366c06eeb0eSDamjan Marion	  $(BR)/.version
367c06eeb0eSDamjan Marion	@$(RM) $(BR)/.version $(DIST_FILE).xz
368c06eeb0eSDamjan Marion	@xz -v --threads=0 $(DIST_FILE)
369c06eeb0eSDamjan Marion	@$(RM) $(BR)/vpp-latest.tar.xz
370c06eeb0eSDamjan Marion	@ln -rs $(DIST_FILE).xz $(BR)/vpp-latest.tar.xz
37120a29c7bSThomas F Herbert
372e7906906SDave Wallace.PHONY: build
37355f99675SDamjan Marionbuild: $(BR)/.deps.ok
3749d7a7ba3SDamjan Marion	$(call make,$(PLATFORM)_debug,$(addsuffix -install,$(TARGETS)))
375e17fdb5dSDamjan Marion
376e7906906SDave Wallace.PHONY: wipedist
37720a29c7bSThomas F Herbertwipedist:
378c06eeb0eSDamjan Marion	@$(RM) $(BR)/*.tar.xz
37920a29c7bSThomas F Herbert
380e7906906SDave Wallace.PHONY: wipe
38155f99675SDamjan Marionwipe: wipedist test-wipe $(BR)/.deps.ok
3820dc3f191SDamjan Marion	$(call make,$(PLATFORM)_debug,$(addsuffix -wipe,$(TARGETS)))
38305b5d1b3SPaul Vinciguerra	@find . -type f -name "*.api.json" ! -path "./test/*" -exec rm {} \;
384e17fdb5dSDamjan Marion
385e7906906SDave Wallace.PHONY: rebuild
386e17fdb5dSDamjan Marionrebuild: wipe build
387e17fdb5dSDamjan Marion
388e7906906SDave Wallace.PHONY: build-release
38955f99675SDamjan Marionbuild-release: $(BR)/.deps.ok
3900dc3f191SDamjan Marion	$(call make,$(PLATFORM),$(addsuffix -install,$(TARGETS)))
391e17fdb5dSDamjan Marion
392e7906906SDave Wallace.PHONY: wipe-release
39355f99675SDamjan Marionwipe-release: test-wipe $(BR)/.deps.ok
3940dc3f191SDamjan Marion	$(call make,$(PLATFORM),$(addsuffix -wipe,$(TARGETS)))
395e17fdb5dSDamjan Marion
396e7906906SDave Wallace.PHONY: rebuild-release
397e17fdb5dSDamjan Marionrebuild-release: wipe-release build-release
398e17fdb5dSDamjan Marion
399ee29dd28SIgor Mikhailov (imichail)libexpand = $(subst $(subst ,, ),:,$(foreach lib,$(1),$(BR)/install-$(2)-native/vpp/$(lib)/$(3)))
400ee29dd28SIgor Mikhailov (imichail)
401b8c72a4aSKlement Sekeraexport TEST_DIR ?= $(WS_ROOT)/test
402c701e571SPaul Vinciguerraexport RND_SEED ?= $(shell python3 -c 'import time; print(time.time())')
403b8c72a4aSKlement Sekera
404f56b77a0SDamjan Mariondefine test
405b7d41fc1SNeale Ranns	$(if $(filter-out $(3),retest),make -C $(BR) PLATFORM=$(1) TAG=$(2) vpp-install,)
406ee29dd28SIgor Mikhailov (imichail)	$(eval libs:=lib lib64)
407f62ae128SKlement Sekera	make -C test \
408b8c72a4aSKlement Sekera	  VPP_BUILD_DIR=$(BR)/build-$(2)-native \
409b8c72a4aSKlement Sekera	  VPP_BIN=$(BR)/install-$(2)-native/vpp/bin/vpp \
410b8c72a4aSKlement Sekera	  VPP_PLUGIN_PATH=$(call libexpand,$(libs),$(2),vpp_plugins) \
4117d31ab2aSDave Barach	  VPP_TEST_PLUGIN_PATH=$(call libexpand,$(libs),$(2),vpp_api_test_plugins) \
412b8c72a4aSKlement Sekera	  VPP_INSTALL_PATH=$(BR)/install-$(2)-native/ \
413ee29dd28SIgor Mikhailov (imichail)	  LD_LIBRARY_PATH=$(call libexpand,$(libs),$(2),) \
41487134937SKlement Sekera	  EXTENDED_TESTS=$(EXTENDED_TESTS) \
415937bf301Svagrant	  PYTHON=$(PYTHON) \
416d3e671e0SKlement Sekera	  OS_ID=$(OS_ID) \
417c701e571SPaul Vinciguerra	  RND_SEED=$(RND_SEED) \
418a3d933c8SKlement Sekera	  CACHE_OUTPUT=$(CACHE_OUTPUT) \
4196484b3baSDamjan Marion	  $(3)
420f56b77a0SDamjan Marionendef
421f56b77a0SDamjan Marion
422e7906906SDave Wallace.PHONY: test
42355f99675SDamjan Mariontest:
424374e2c5fSDamjan Marion	$(call test,vpp,vpp,test)
425f56b77a0SDamjan Marion
426e7906906SDave Wallace.PHONY: test-debug
42755f99675SDamjan Mariontest-debug:
428374e2c5fSDamjan Marion	$(call test,vpp,vpp_debug,test)
429f62ae128SKlement Sekera
430e7906906SDave Wallace.PHONY: test-gcov
431b757d1a7SDave Barachtest-gcov:
432b757d1a7SDave Barach	$(call test,vpp,vpp_gcov,test)
433b757d1a7SDave Barach
434e7906906SDave Wallace.PHONY: test-all
43555f99675SDamjan Mariontest-all:
4364e633e10SMichal Cmarada	$(if $(filter-out $(3),retest),make -C $(BR) PLATFORM=vpp TAG=vpp vom-install,)
437b7d41fc1SNeale Ranns	$(eval EXTENDED_TESTS=yes)
438e61ad8d6SKlement Sekera	$(call test,vpp,vpp,test)
439b7d41fc1SNeale Ranns
440e7906906SDave Wallace.PHONY: test-all-debug
44155f99675SDamjan Mariontest-all-debug:
4424e633e10SMichal Cmarada	$(if $(filter-out $(3),retest),make -C $(BR) PLATFORM=vpp TAG=vpp_debug vom-install,)
44387134937SKlement Sekera	$(eval EXTENDED_TESTS=yes)
444374e2c5fSDamjan Marion	$(call test,vpp,vpp_debug,test)
44587134937SKlement Sekera
446e7906906SDave Wallace.PHONY: papi-wipe
447e7906906SDave Wallacepapi-wipe: test-wipe-papi
448e7906906SDave Wallace	$(call banner,"This command is deprecated. Please use 'test-wipe-papi'")
449e7906906SDave Wallace
450e7906906SDave Wallace.PHONY: test-wipe-papi
451e7906906SDave Wallacetest-wipe-papi:
4522648e447SPaul Vinciguerra	@make -C test papi-wipe
4532648e447SPaul Vinciguerra
454e7906906SDave Wallace.PHONY: test-help
455277b89c9SKlement Sekeratest-help:
456277b89c9SKlement Sekera	@make -C test help
457277b89c9SKlement Sekera
458e7906906SDave Wallace.PHONY: test-wipe
459277b89c9SKlement Sekeratest-wipe:
460277b89c9SKlement Sekera	@make -C test wipe
461277b89c9SKlement Sekera
462e7906906SDave Wallace.PHONY: test-shell
46355f99675SDamjan Mariontest-shell:
464993e0edfSKlement Sekera	$(call test,vpp,vpp,shell)
465a86e2895SKlement Sekera
466e7906906SDave Wallace.PHONY: test-shell-debug
46755f99675SDamjan Mariontest-shell-debug:
468993e0edfSKlement Sekera	$(call test,vpp,vpp_debug,shell)
469a86e2895SKlement Sekera
470e7906906SDave Wallace.PHONY: test-shell-gcov
4717d31ab2aSDave Barachtest-shell-gcov:
4727d31ab2aSDave Barach	$(call test,vpp,vpp_gcov,shell)
4737d31ab2aSDave Barach
474e7906906SDave Wallace.PHONY: test-dep
47556ccc23fSEd Kerntest-dep:
47656ccc23fSEd Kern	@make -C test test-dep
47756ccc23fSEd Kern
478e7906906SDave Wallace.PHONY: test-doc
479f62ae128SKlement Sekeratest-doc:
4806484b3baSDamjan Marion	@make -C test doc
481f62ae128SKlement Sekera
482e7906906SDave Wallace.PHONY: test-wipe-doc
483277b89c9SKlement Sekeratest-wipe-doc:
4846484b3baSDamjan Marion	@make -C test wipe-doc
485f56b77a0SDamjan Marion
486e7906906SDave Wallace.PHONY: test-cov
48755f99675SDamjan Mariontest-cov:
4886a4c9af3SNeale Ranns	@make -C $(BR) PLATFORM=vpp TAG=vpp_gcov vom-install
48988d38c4fSKlement Sekera	$(eval EXTENDED_TESTS=yes)
490374e2c5fSDamjan Marion	$(call test,vpp,vpp_gcov,cov)
4910279b29fSJuraj Sloboda
492e7906906SDave Wallace.PHONY: test-wipe-cov
4930279b29fSJuraj Slobodatest-wipe-cov:
4946484b3baSDamjan Marion	@make -C test wipe-cov
4950279b29fSJuraj Sloboda
496f0797d13SDave Wallace.PHONY: test-wipe-all
497f0797d13SDave Wallacetest-wipe-all:
498f0797d13SDave Wallace	@make -C test wipe-all
499f0797d13SDave Wallace
500e7906906SDave Wallace.PHONY: test-checkstyle
50172715ee4SKlement Sekeratest-checkstyle:
50272715ee4SKlement Sekera	@make -C test checkstyle
50372715ee4SKlement Sekera
504e7906906SDave Wallace.PHONY: test-refresh-deps
50528fa8cbcSAloys Augustintest-refresh-deps:
50628fa8cbcSAloys Augustin	@make -C test refresh-deps
50728fa8cbcSAloys Augustin
508e7906906SDave Wallace.PHONY: retest
509f56b77a0SDamjan Marionretest:
510374e2c5fSDamjan Marion	$(call test,vpp,vpp,retest)
511f56b77a0SDamjan Marion
512e7906906SDave Wallace.PHONY: retest-debug
513f56b77a0SDamjan Marionretest-debug:
514374e2c5fSDamjan Marion	$(call test,vpp,vpp_debug,retest)
515f56b77a0SDamjan Marion
516e7906906SDave Wallace.PHONY: retest-all
517e7906906SDave Wallaceretest-all:
518e7906906SDave Wallace	$(eval EXTENDED_TESTS=yes)
519e7906906SDave Wallace	$(call test,vpp,vpp,retest)
520e7906906SDave Wallace
521e7906906SDave Wallace.PHONY: retest-all-debug
522e7906906SDave Wallaceretest-all-debug:
523e7906906SDave Wallace	$(eval EXTENDED_TESTS=yes)
524e7906906SDave Wallace	$(call test,vpp,vpp_debug,retest)
525e7906906SDave Wallace
526e17fdb5dSDamjan Marionifeq ("$(wildcard $(STARTUP_CONF))","")
527e17fdb5dSDamjan Mariondefine run
528e17fdb5dSDamjan Marion	@echo "WARNING: STARTUP_CONF not defined or file doesn't exist."
529e17fdb5dSDamjan Marion	@echo "         Running with minimal startup config: $(MINIMAL_STARTUP_CONF)\n"
530a7775387SDamjan Marion	@cd $(STARTUP_DIR) && \
53172d2c4f3SDamjan Marion	  $(SUDO) $(2) $(1)/vpp/bin/vpp $(MINIMAL_STARTUP_CONF)
532e17fdb5dSDamjan Marionendef
533e17fdb5dSDamjan Marionelse
534e17fdb5dSDamjan Mariondefine run
535a7775387SDamjan Marion	@cd $(STARTUP_DIR) && \
53672d2c4f3SDamjan Marion	  $(SUDO) $(2) $(1)/vpp/bin/vpp $(shell cat $(STARTUP_CONF) | sed -e 's/#.*//')
537e17fdb5dSDamjan Marionendef
538e17fdb5dSDamjan Marionendif
539e17fdb5dSDamjan Marion
540e6f9023fSDamjan Marion%.files: .FORCE
541e6f9023fSDamjan Marion	@find . \( -name '*\.[chyS]' -o -name '*\.java' -o -name '*\.lex' \) -and \
542e6f9023fSDamjan Marion		\( -not -path './build-root*' -o -path \
543e6f9023fSDamjan Marion		'./build-root/build-vpp_debug-native/dpdk*' \) > $@
544e6f9023fSDamjan Marion
545e6f9023fSDamjan Marion.FORCE:
546e6f9023fSDamjan Marion
547e7906906SDave Wallace.PHONY: run
548e17fdb5dSDamjan Marionrun:
549a7775387SDamjan Marion	$(call run, $(BR)/install-$(PLATFORM)_debug-native)
550e17fdb5dSDamjan Marion
551e7906906SDave Wallace.PHONY: run-release
552e17fdb5dSDamjan Marionrun-release:
553a7775387SDamjan Marion	$(call run, $(BR)/install-$(PLATFORM)-native)
554e17fdb5dSDamjan Marion
555e7906906SDave Wallace.PHONY: debug
556e17fdb5dSDamjan Mariondebug:
557a7775387SDamjan Marion	$(call run, $(BR)/install-$(PLATFORM)_debug-native,$(GDB) $(GDB_ARGS) --args)
558e17fdb5dSDamjan Marion
559e7906906SDave Wallace.PHONY: build-coverity
560005849ecSDamjan Marionbuild-coverity:
5613ad7704fSDave Barach	$(call make,$(PLATFORM)_coverity,install-packages)
5623ad7704fSDave Barach
563e7906906SDave Wallace.PHONY: debug-release
564e17fdb5dSDamjan Mariondebug-release:
565a7775387SDamjan Marion	$(call run, $(BR)/install-$(PLATFORM)-native,$(GDB) $(GDB_ARGS) --args)
566e17fdb5dSDamjan Marion
567e7906906SDave Wallace.PHONY: build-vat
568e17fdb5dSDamjan Marionbuild-vat:
569e6f9023fSDamjan Marion	$(call make,$(PLATFORM)_debug,vpp-api-test-install)
570e17fdb5dSDamjan Marion
571e7906906SDave Wallace.PHONY: run-vat
572e17fdb5dSDamjan Marionrun-vat:
57372d2c4f3SDamjan Marion	@$(SUDO) $(BR)/install-$(PLATFORM)_debug-native/vpp/bin/vpp_api_test
574e17fdb5dSDamjan Marion
575e7906906SDave Wallace.PHONY: pkg-deb
5766bbf83a0SDamjan Marionpkg-deb:
5774d2f86a1SDamjan Marion	$(call make,$(PLATFORM),vpp-package-deb)
5784d2f86a1SDamjan Marion
579e7906906SDave Wallace.PHONY: vom-pkg-deb
580e7906906SDave Wallacevom-pkg-deb: pkg-deb
581752f5b43SMohsin Kazmi	$(call make,$(PLATFORM),vom-package-deb)
582752f5b43SMohsin Kazmi
583e7906906SDave Wallace.PHONY: pkg-deb-debug
5844d2f86a1SDamjan Marionpkg-deb-debug:
5854d2f86a1SDamjan Marion	$(call make,$(PLATFORM)_debug,vpp-package-deb)
586e17fdb5dSDamjan Marion
587e7906906SDave Wallace.PHONY: vom-pkg-deb-debug
588e7906906SDave Wallacevom-pkg-deb-debug: pkg-deb-debug
589752f5b43SMohsin Kazmi	$(call make,$(PLATFORM)_debug,vom-package-deb)
590752f5b43SMohsin Kazmi
591e7906906SDave Wallace.PHONY: pkg-rpm
5926bbf83a0SDamjan Marionpkg-rpm: dist
593c06eeb0eSDamjan Marion	make -C extras/rpm
594e6f9023fSDamjan Marion
595e7906906SDave Wallace.PHONY: pkg-srpm
596b60f4965SThomas F Herbertpkg-srpm: dist
597b60f4965SThomas F Herbert	make -C extras/rpm srpm
598b60f4965SThomas F Herbert
599e7906906SDave Wallace.PHONY: dpdk-install-dev
6002ce7f983SDamjan Mariondpdk-install-dev:
6018e7ba4adSPaul Vinciguerra	$(call banner,"This command is deprecated. Please use 'make install-ext-deps'")
6024a6cb83dSDamjan Marion	make -C build/external install-$(PKG)
6034a6cb83dSDamjan Marion
604e7906906SDave Wallace.PHONY: install-ext-deps
6054a6cb83dSDamjan Marioninstall-ext-deps:
6064a6cb83dSDamjan Marion	make -C build/external install-$(PKG)
6072ce7f983SDamjan Marion
608e7906906SDave Wallace.PHONY: install-ext-dep
609e7906906SDave Wallaceinstall-ext-dep: install-ext-deps
610e7906906SDave Wallace
611e7906906SDave Wallace.PHONY: json-api-files
6129529feb4SPaul Vinciguerrajson-api-files:
6139529feb4SPaul Vinciguerra	$(WS_ROOT)/src/tools/vppapigen/generate_json.py
6149529feb4SPaul Vinciguerra
615e7906906SDave Wallace.PHONY: json-api-files-debug
6169529feb4SPaul Vinciguerrajson-api-files-debug:
6179529feb4SPaul Vinciguerra	$(WS_ROOT)/src/tools/vppapigen/generate_json.py --debug-target
6189529feb4SPaul Vinciguerra
619e7906906SDave Wallace.PHONY: ctags
620e6f9023fSDamjan Marionctags: ctags.files
621e6f9023fSDamjan Marion	@ctags --totals --tag-relative -L $<
622e6f9023fSDamjan Marion	@rm $<
623e6f9023fSDamjan Marion
624e7906906SDave Wallace.PHONY: gtags
6254b72a581SKeith Burns (alagalah)gtags: ctags
6264b72a581SKeith Burns (alagalah)	@gtags --gtagslabel=ctags
6274b72a581SKeith Burns (alagalah)
628e7906906SDave Wallace.PHONY: cscope
629e6f9023fSDamjan Marioncscope: cscope.files
630e6f9023fSDamjan Marion	@cscope -b -q -v
63160c63c7bSMarek Gradzki
632e7906906SDave Wallace.PHONY: checkstyle
633f3aebda7SOle Troancheckstyle: checkfeaturelist
63424704851SDamjan Marion	@build-root/scripts/checkstyle.sh
63524704851SDamjan Marion
636e7906906SDave Wallace.PHONY: checkstyle-commit
637e7906906SDave Wallacecheckstyle-commit:
638e7906906SDave Wallace	@extras/scripts/check_commit_msg.sh
639e7906906SDave Wallace
640e7906906SDave Wallace.PHONY: checkstyle-test
641e7906906SDave Wallacecheckstyle-test: test-checkstyle
642e7906906SDave Wallace
643e7906906SDave Wallace.PHONY: checkstyle-all
644e7906906SDave Wallacecheckstyle-all: checkstyle-commit checkstyle checkstyle-test
645e7906906SDave Wallace
646e7906906SDave Wallace.PHONY: fixstyle
64724704851SDamjan Marionfixstyle:
64824704851SDamjan Marion	@build-root/scripts/checkstyle.sh --fix
649b5850970SChris Luke
650ea1a6513SPaul Vinciguerra# necessary because Bug 1696324 - Update to python3.6 breaks PyYAML dependencies
651ea1a6513SPaul Vinciguerra# Status:	CLOSED CANTFIX
652ea1a6513SPaul Vinciguerra# https://bugzilla.redhat.com/show_bug.cgi?id=1696324
653e7906906SDave Wallace.PHONY: centos-pyyaml
654ea1a6513SPaul Vinciguerracentos-pyyaml:
655ea1a6513SPaul Vinciguerraifeq ($(OS_ID)-$(OS_VERSION_ID),centos-7)
656ea1a6513SPaul Vinciguerra	@python3 -m pip install pyyaml
657ea1a6513SPaul Vinciguerraendif
658ea1a6513SPaul Vinciguerraifeq ($(OS_ID)-$(OS_VERSION_ID),centos-8)
659ea1a6513SPaul Vinciguerra	@sudo -E yum install $(CONFIRM) python3-pyyaml
660ea1a6513SPaul Vinciguerraendif
661ea1a6513SPaul Vinciguerra
662e7906906SDave Wallace.PHONY: featurelist
663ea1a6513SPaul Vinciguerrafeaturelist: centos-pyyaml
6646a3064fdSOle Troan	@build-root/scripts/fts.py --all --markdown
6656a3064fdSOle Troan
666e7906906SDave Wallace.PHONY: checkfeaturelist
667ea1a6513SPaul Vinciguerracheckfeaturelist: centos-pyyaml
668f3aebda7SOle Troan	@build-root/scripts/fts.py --validate --all
6696a3064fdSOle Troan
6701d1644c2SChris Luke#
6711d1644c2SChris Luke# Build the documentation
6721d1644c2SChris Luke#
673