Makefile edits to improve library lint target support.
Makefile
--------
o Replace inlined includes with single $(MAKEDIR)/include.mk
o virtualenv install w/dependencies handled by makefiles/virtualenv.mk
o Use '&&' for command separation to improve error handling.
o Added more target documentation.
o Re-home doc8/rst syntax checking into makefiles/lint/doc8.mk.
howto/code/linting.rst
----------------------
o Document supported lint targets on docs.voltha.org.
howto/release/index.rst
howto/release/post-release/
howto/release/vcs/
---------------------------
o Document more release related activity (bugfix branch creation)
makefiles/consts.mk
-------------------
o Define and use more library macros.
config.mk
---------
o Per-repository library makefile configuration, disable linting.
makefiles/virtualenv.mk
-----------------------
o Library virtualenv install with dependences.
o Begin using a consistent install directory.
o Ugh: repository (voltha-docs) submodules each install a full venv.
o Install dependency drive based on existence of activate script.
o Lint targets updated to use activate script as a dependency.
o Update activate macro to run: set -u && activate && set +u
makefiles/patches/include.mk
----------------------------
o Update to use virtualenv.mk defined macros.
makefiles/lint/doc8.mk
makefiles/lint/python/flake8.mk
makefiles/lint/json.mk
makefiles/lint/python/pylint.mk
makefiles/lint/robot.mk
makefiles/lint/shell.mk
makefiles/lint/yaml.mk
-------------------------------
o All library linting defines consistent targets and logic.
o Support two library targets: lint-all and lint-modified.
o Default to checking all available sources.
o Linting can be disabled per-repository via {project}/config.mk
Change-Id: I7b7b5e523c867183d44244a0da21cfa3584e9a50
diff --git a/makefiles/patches/include.mk b/makefiles/patches/include.mk
index 2bd1bfd..4accdf2 100644
--- a/makefiles/patches/include.mk
+++ b/makefiles/patches/include.mk
@@ -27,7 +27,9 @@
patch-gather-args += '-e' 'from collections import Mapping'
patch-gather-args += '-e' 'from collections import MutableMapping'
-VENV_NAME ?= $(error $(MAKE) VENV_NAME= is required)
+# Defined by [Mm]akefile or makefiles/virtualenv.mk
+venv-name ?= $(error $(MAKE) venv-name= is required)
+
PATCH_PATH ?= $(error $(MAKE) PATCH_PATH= is required)
## -----------------------------------------------------------------------
@@ -38,7 +40,7 @@
## -----------------------------------------------------------------------
## -----------------------------------------------------------------------
patch-diff:
- $(HIDE)diff -qr staging $(VENV_NAME) \
+ $(HIDE)diff -qr staging $(venv-name) \
| awk '{print "# diff -Naur "$$2" "$$4}' \
| tee $@.log
@@ -46,16 +48,16 @@
## -----------------------------------------------------------------------
patch-create:
mkdir -p patches/$(PATCH_PATH)
- diff -Naur staging/$(PATCH_PATH) $(VENV_NAME)/$(PATCH_PATH) | tee patches/$(PATCH_PATH)/patch
+ diff -Naur staging/$(PATCH_PATH) $(venv-name)/$(PATCH_PATH) | tee patches/$(PATCH_PATH)/patch
exit 1
## -----------------------------------------------------------------------
## -----------------------------------------------------------------------
patch-init:
- find "$(VENV_NAME)" -name '__pycache__' -type d -print0 \
+ find "$(venv-name)" -name '__pycache__' -type d -print0 \
| xargs -I'{}' --null --no-run-if-empty $(RM) -r {}
mkdir -p staging
- rsync -rv --checksum "$(VENV_NAME)/." "staging/."
+ rsync -rv --checksum "$(venv-name)/." "staging/."
@echo "Modify files beneath staging/ to create a patch source"
# [SEE ALSO]