[VOL-5194] - Refactor and use repo:onf-make as a git-submodule
Makefile
--------
o Added target view for interactive rendering of README.md
o Use printf VS echo in target help to normalize formatting
README.md
docs/todo.md
docs/VARIABLES.md
-----------------
o Begin documenting makefile variables and features for library makefiles.
Change-Id: If75417c45363ee5c6a514fe9ebd4414ba8cf0cf7
diff --git a/Makefile b/Makefile
index d830da6..96b8f26 100644
--- a/Makefile
+++ b/Makefile
@@ -32,4 +32,23 @@
## Display make help text late
include $(ONF_MAKEDIR)/help/trailer.mk
+## -----------------------------------------------------------------------
+## Intent: Helper target for interactive README.md viewing
+## Note: This target has limited use for repo:onf-make and this directory
+## Todo: Add makefiles/[lint/]md/include.mk and generalize logic
+## -----------------------------------------------------------------------
+view-docs-src := README.md $(wildcard docs/*.md)
+view-docs-dep := $(addprefix view-dep^,$(view-docs-src))
+
+.PHONY: view $(view-docs-dep)
+view :: $(view-docs-dep)
+
+$(view-docs-dep): # view-dep^README.md => README.md
+ -pandoc $(lastword $(subst ^,$(space),$@)) | lynx -stdin
+
+help ::
+ @echo
+ @printf ' %-25.25s %s\n' 'view'\
+ 'Rendering *.md docs for interactive viewing'
+
# [EOF]