Improve target coverage for the reuse license checker.
misc
----
o Copyright notice update from onf v1 to onf v1.1
makefiles/etc/utils.mk
----------------------
o Function path-by-makefilepath-by-makefile():
- Replace $(subst include.mk) with $(dir) so path construction becomes generic.
- Added wrapper function genpath-makefiles() to improve call usability.
makefiles/lint/license/include.mk
makefiles/lint/license/reuse.mk
makefiles/lint/license/install.mk
---------------------------------
o Added requirements.txt for reuse tool install (ability to vesion and freeze for release).
o Define command var REUSE= so local devs can override.
o Added banner-{enter,leave} for logfile visibility.
makefiles/lint/license/include.mk
makefiles/lint/license/help.mk
------------------------------
o Document a few missing targets for 'make help' and 'make lint-reuse-help'.
[HOWTO: test]
-------------
% make sterile
% make venv # install virtualenv
% make lint-reuse-install
% make sterile
% make lint-reuse-version
% make sterile
% make lint-reuse
Change-Id: I91f4789981f3d3c5bc744d2db99374f9790e3b98
diff --git a/makefiles/utils/include.mk b/makefiles/utils/include.mk
index 6090a17..e3e9ae0 100644
--- a/makefiles/utils/include.mk
+++ b/makefiles/utils/include.mk
@@ -39,15 +39,39 @@
## groovy-check-conf := $(call path-by-makefile,.groovylintrc.json)
## groovy-cmd = npm-groovy-lint --config "$(groovy-check-conf)"
## -----------------------------------------------------------------------
-path-by-makefile = $(strip \
+path-by-makefilepath-by-makefile = $(strip \
$(foreach filename,$(1),\
$(foreach makefile,$(lastword $(MAKEFILE_LIST)),\
- $(foreach makedir,$(subst /include.mk,$(null),$(makefile)),\
- $(makedir)/$(filename)\
+ $(foreach makedir,$(dir $(makefile)),\
+ $(makedir)$(filename)\
)\
))\
)
+## -----------------------------------------------------------------------
+## Intent: Improve function usability for path-by-makefilepath-by-makefile
+## -----------------------------------------------------------------------
+## Given:
+## scalar A makefile variable name to define
+## scalar Path within a makefile subdirectory to construct
+## Return:
+## scalar Constructed path for the given filename
+## -----------------------------------------------------------------------
+## Usage:
+## $(call genpath-makefiles,tox-ini,tox.ini)
+## $(info tox-ini = $(tox-ini))
+## -----------------------------------------------------------------------
+genpath-makefiles = $(strip \
+\
+ $(foreach var,$(1),\
+ $(foreach fyl,$(2),\
+ $(if true$(DEBUG),\
+ $(info $$(eval $(var) := $$(call path-by-makefilepath-by-makefile,$(fyl)))))\
+ $(eval $(var) := $(call path-by-makefilepath-by-makefile,$(fyl)))\
+ ))\
+ $(var)\
+)
+
$(if $(DEBUG),$(warning LEAVE))
# [EOF]