VOL-4977 - Failure in voltha-protos verification job.

Makefile
makefiles/consts.mk
makefiles/include.mk
virtualenv.mk
requirements.txt
--------------------
  o Added library makefiles from repo:onf-make to handle virtualenv setup/removal.
  o go-clean - augment clean rule, current behavior leaves directory unbuildable.

makefiles/docker/include.mk
---------------------------
  o Replace inlined copies of docker cli arguments with macros: is-stdin, docker-run, etc.
  o Moved docker command wrappers: PROTOC, etc into docker/include.mk

makefiles/help/*.mk
-------------------
  o Update and align makefile target help text.

Change-Id: Ifcf72e8081efc6e0d828ee4b1b96c66a219a39b9
diff --git a/makefiles/consts.mk b/makefiles/consts.mk
index ce71862..c1306ac 100644
--- a/makefiles/consts.mk
+++ b/makefiles/consts.mk
@@ -13,25 +13,42 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+#
+# SPDX-FileCopyrightText: 2022-2023 Open Networking Foundation (ONF) and the ONF Contributors
+# SPDX-License-Identifier: Apache-2.0
+# -----------------------------------------------------------------------
+# https://gerrit.opencord.org/plugins/gitiles/onf-make
+# ONF.makefile.version = 1.0
 # -----------------------------------------------------------------------
 
 $(if $(DEBUG),$(warning ENTER))
 
-##-------------------##
-##---]  GLOBALS  [---##
-##-------------------##
-null         :=#
-space        :=$(null) $(null)
-dot          :=.
+# include makefiles/constants.mk
+export dot          :=.
+export null         :=#
+export space        := $(null) $(null)
+export quote-single := $(null)'$(null)#'
+export quote-double := $(null)"$(null)#"
 
-HIDE         ?=@
+# [DEBUG] make {target} HIDE=
+HIDE        ?= @
 
-env-clean   = /usr/bin/env --ignore-environment
-xargs-n1    := xargs -0 -t -n1 --no-run-if-empty
+env-clean      ?= /usr/bin/env --ignore-environment
+xargs-n1       := xargs -0 -t -n1 --no-run-if-empty
+xargs-n1-clean := $(env-clean) $(xargs-n1)
 
+## -----------------------------------------------------------------------
+## Default shell:
+##   o set -e            enable error checking
+##   o set -u            report undefined errors
+##   o set -o pipefail   propogate shell pipeline failures.
+## -----------------------------------------------------------------------
+SHELL ?= /bin/bash
 have-shell-bash := $(filter bash,$(subst /,$(space),$(SHELL)))
 $(if $(have-shell-bash),$(null),\
-  $(eval export SHELL := /bin/bash -euo pipefail))
+  $(eval export SHELL := bash -euo pipefail))
+
+export SHELL ?= bash -euo pipefail
 
 $(if $(DEBUG),$(warning LEAVE))
 
diff --git a/makefiles/docker/include.mk b/makefiles/docker/include.mk
new file mode 100644
index 0000000..d78d008
--- /dev/null
+++ b/makefiles/docker/include.mk
@@ -0,0 +1,38 @@
+# -*- makefile -*-
+# -----------------------------------------------------------------------
+# Copyright 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.d
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+# tool containers
+VOLTHA_TOOLS_VERSION ?= 2.4.0
+
+docker-run     = docker run --rm --user $$(id -u):$$(id -g)#   # Docker command stem
+docker-run-app = $(docker-run) -v ${CURDIR}:/app#              # w/filesystem mount
+is-stdin       = $(shell test -t 0 && echo "-it")
+
+# Docker volume mounts: container:/app/release <=> localhost:{pwd}/release
+vee-golang     = -v gocache-${VOLTHA_TOOLS_VERSION}:/go/pkg
+vee-citools    = voltha/voltha-ci-tools:${VOLTHA_TOOLS_VERSION}
+
+# Tool Containers
+PROTOC    = $(docker-run) -v ${CURDIR}:/app $(is-stdin) $(vee-citools)-protoc protoc
+PROTOC_SH = $(docker-run) -v ${CURDIR}:/go/src/github.com/opencord/voltha-protos/v5 $(is-stdin) --workdir=/go/src/github.com/opencord/voltha-protos/v5 $(vee-citools)-protoc sh -c
+GO        = $(docker-run) -v ${CURDIR}:/app $(is-stdin) -v gocache:/.cache $(vee-golang) $(vee-citools)-golang go
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]
diff --git a/makefiles/help/include.mk b/makefiles/help/include.mk
index 7a93bd0..ffd390f 100644
--- a/makefiles/help/include.mk
+++ b/makefiles/help/include.mk
@@ -18,29 +18,28 @@
 # Parent makefile should include this early so help
 # message will be prefixed by a usage statement.
 help ::
-	@echo "Usage: $(MAKE) [options] [target] ..."
 	@echo
-	@echo '[Virtual Env]'
-	@echo '  venv           Create a python virtual environment'
-	@echo '  venv_protos    Create a python virtual environment'
-	@echo "  $(VENV_NAME)"
+	@echo "Usage: $(MAKE) [options] [target] ..."
+
 	@echo
 	@echo '[ACTION] - golang, java and python'
 	@echo '  protos'
 	@echo '  build'
 	@echo '  test'
-	@echo
-	@echo '[CLEAN]'
-	@echo '  clean          Remove generated targets'
-	@echo '  sterile        clean + remove virtual env interpreter install'
+
 	@echo
 	@echo '[HELP]'
-	@echo '  help           Display program help'
+	@echo '  help                         Display program help'
 #	@echo '  help-verbose   Display additional targets and help'
+
 	@echo
 	@echo '[PROTOS: generate]'
 	@echo '  go-protos'
 	@echo '  java-protos'
 	@echo '  python-protos'
 
+	@echo
+	@echo '[MISC]'
+	@echo '  repair                       Recover from a common fatal build condition'
+
 # [EOF]
diff --git a/makefiles/include.mk b/makefiles/include.mk
index 919ddaf..3cdbf2c 100644
--- a/makefiles/include.mk
+++ b/makefiles/include.mk
@@ -32,12 +32,17 @@
 ##--------------------##
 ##---]  INCLUDES  [---##
 ##--------------------##
-include $(MAKEDIR)/consts.mk
 include $(MAKEDIR)/help/include.mk
+
+include $(MAKEDIR)/consts.mk
+include $(MAKEDIR)/virtualenv.mk
+
 include $(MAKEDIR)/help/variables.mk
-include $(MAKEDIR)/lint/include.mk
 include $(MAKEDIR)/todo.mk
 
+include $(MAKEDIR)/docker/include.mk
+include $(MAKEDIR)/lint/include.mk
+
 $(if $(DEBUG),$(warning LEAVE))
 
 # [EOF]
diff --git a/makefiles/lint/json.mk b/makefiles/lint/json.mk
index c3d5447..96eb87a 100644
--- a/makefiles/lint/json.mk
+++ b/makefiles/lint/json.mk
@@ -32,6 +32,6 @@
 	done
 
 help::
-	@echo "  lint-json            Syntax check json sources"
+	@echo "  lint-json                    Syntax check json sources"
 
 # [EOF]
diff --git a/makefiles/lint/makefile.mk b/makefiles/lint/makefile.mk
index 61de008..3cf41d2 100644
--- a/makefiles/lint/makefile.mk
+++ b/makefiles/lint/makefile.mk
@@ -37,6 +37,6 @@
 ## -----------------------------------------------------------------------
 ## -----------------------------------------------------------------------
 help ::
-	@echo '  lint-make                     Syntax check [Mm]akefile and *.mk'
+	@echo '  lint-make                    Syntax check [Mm]akefile and *.mk'
 
 # [EOF]
diff --git a/makefiles/lint/python.mk b/makefiles/lint/python.mk
index 9252657..592ae98 100644
--- a/makefiles/lint/python.mk
+++ b/makefiles/lint/python.mk
@@ -34,6 +34,6 @@
 ## -----------------------------------------------------------------------
 ## -----------------------------------------------------------------------
 help ::
-	@echo '  lint-python                   Syntax check python sources'
+	@echo '  lint-python                  Syntax check python sources'
 
 # [EOF]
diff --git a/makefiles/lint/robot.mk b/makefiles/lint/robot.mk
index f33c4ba..dfbf034 100644
--- a/makefiles/lint/robot.mk
+++ b/makefiles/lint/robot.mk
@@ -38,6 +38,6 @@
 	    ; rflint $(LINT_ARGS) $(ROBOT_FILES)
 
 help::
-	@echo "  lint-robot           Syntax check robot sources using rflint"
+	@echo "  lint-robot                   Syntax check robot sources using rflint"
 
 # [EOF]
diff --git a/makefiles/lint/shell.mk b/makefiles/lint/shell.mk
index 0180e90..5ccc34f 100644
--- a/makefiles/lint/shell.mk
+++ b/makefiles/lint/shell.mk
@@ -34,6 +34,6 @@
 ## -----------------------------------------------------------------------
 ## -----------------------------------------------------------------------
 help ::
-	@echo '  lint-shell                    Syntax check shell sources'
+	@echo '  lint-shell                   Syntax check shell sources'
 
 # [EOF]
diff --git a/makefiles/lint/yaml/yamllint.mk b/makefiles/lint/yaml/yamllint.mk
index 0cf75de..b3ce6a5 100644
--- a/makefiles/lint/yaml/yamllint.mk
+++ b/makefiles/lint/yaml/yamllint.mk
@@ -42,7 +42,7 @@
 ## -----------------------------------------------------------------------
 ## -----------------------------------------------------------------------
 help::
-	@echo "  lint-yaml                     Syntax check yaml sources"
+	@echo "  lint-yaml                    Syntax check yaml sources"
 
 $(if $(DEBUG),$(warning ENTER))
 
diff --git a/makefiles/todo.mk b/makefiles/todo.mk
index e2e826f..e59423d 100644
--- a/makefiles/todo.mk
+++ b/makefiles/todo.mk
@@ -23,7 +23,7 @@
 ## -----------------------------------------------------------------------
 ## -----------------------------------------------------------------------
 help::
-	@echo "  todo                       Display future enhancement list"
+	@echo "  todo                         Display future enhancement list"
 
 todo ::
 	@echo
diff --git a/makefiles/virtualenv.mk b/makefiles/virtualenv.mk
new file mode 100644
index 0000000..93eb29d
--- /dev/null
+++ b/makefiles/virtualenv.mk
@@ -0,0 +1,82 @@
+# -*- makefile -*-
+## -----------------------------------------------------------------------
+# Copyright 2017-2023 Open Networking Foundation (ONF) and the ONF Contributors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+## -----------------------------------------------------------------------
+# https://gerrit.opencord.org/plugins/gitiles/onf-make
+# ONF.makefile.version = 1.0
+# -----------------------------------------------------------------------
+
+$(if $(DEBUG),$(warning ENTER))
+
+##-------------------##
+##---]  GLOBALS  [---##
+##-------------------##
+.PHONY: venv
+
+##------------------##
+##---]  LOCALS  [---##
+##------------------##
+venv-name            ?= .venv#                            # default install directory
+venv-abs-path        := $(PWD)/$(venv-name)
+
+venv-activate-script := $(venv-name)/bin/activate#        # dependency
+
+# Intent: activate= is a macro for accessing the virtualenv activation script#
+#  Usage: $(activate) && python
+activate             ?= set +u && source $(venv-activate-script) && set -u
+
+## -----------------------------------------------------------------------
+## Intent: Activate script path dependency
+## Usage:
+##    o place on the right side of colon as a target dependency
+##    o When the script does not exist install the virtual env and display.
+## -----------------------------------------------------------------------
+$(venv-activate-script):
+	@echo
+	@echo "============================="
+	@echo "Installing python virtual env"
+	@echo "============================="
+	virtualenv -p python3 $(venv-name)
+	$(activate) && python -m pip install --upgrade pip
+	$(activate) && pip install --upgrade setuptools
+	$(activate) && { [[ -r requirements.txt ]] && python -m pip install -r requirements.txt; }
+	$(activate) && python --version
+
+## -----------------------------------------------------------------------
+## Intent: Explicit named installer target w/o dependencies.
+##         Makefile targets should depend on venv-activate-script.
+## -----------------------------------------------------------------------
+venv: $(venv-activate-script)
+
+## -----------------------------------------------------------------------
+## Intent: Revert installation to a clean checkout
+## -----------------------------------------------------------------------
+sterile :: clean
+	$(RM) -r "$(venv-abs-path)"
+
+## -----------------------------------------------------------------------
+## -----------------------------------------------------------------------
+help ::
+	@echo
+	@echo '[VIRTUAL ENV]'
+	@echo '  venv                Create a python virtual environment'
+	@echo '    venv-name=        Subdir name for virtualenv install'
+	@echo '  venv-activate-script         make macro name'
+	@echo '      $$(target) dependency    install python virtualenv'
+	@echo '      source $$(macro) && cmd  configure env and run cmd'
+
+$(if $(DEBUG),$(warning LEAVE))
+
+# [EOF]