[PATCH 6/6] Makefile, lint-man.mk: lint-man-groff-col, lint-man-groff-grep: Split targets from lint-man-groff

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Allow running col(1) and grep(1) separately, which allows more granular
testing, and also inspecting the output of col(1), which can be useful
for debugging the pages.

Signed-off-by: Alejandro Colomar <alx@xxxxxxxxxx>
---
 Makefile        |  4 +++-
 lib/lint-man.mk | 18 +++++++++++++++---
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 3788fb0f1..c370244d7 100644
--- a/Makefile
+++ b/Makefile
@@ -72,11 +72,13 @@ help:
 	$(info	lint-man		Wrapper for lint-man-* targets)
 	$(info	lint-man-mandoc		Lint man pages with mandoc(1))
 	$(info	lint-man-tbl		Lint man pages about '\" t' comment for tbl(1))
-	$(info	lint-man-groff		Lint man pages with groff(1))
+	$(info	lint-man-groff		Alias for "lint-man-groff-grep")
 	$(info	lint-man-groff-tbl	Lint man pages with tbl(1))
 	$(info	lint-man-groff-eqn	Lint man pages with eqn(1))
 	$(info	lint-man-groff-troff	Lint man pages with troff(1))
 	$(info	lint-man-groff-grotty	Lint man pages with grotty(1))
+	$(info	lint-man-groff-col	Lint man pages with col(1))
+	$(info	lint-man-groff-grep	Lint man pages with grep(1))
 	$(info	)
 	$(info	[un]install		Alias for "[un]install-man")
 	$(info	[un]install-man		Wrapper for [un]install-man* targets)
diff --git a/lib/lint-man.mk b/lib/lint-man.mk
index a342eb44d..e819d1a95 100644
--- a/lib/lint-man.mk
+++ b/lib/lint-man.mk
@@ -68,6 +68,7 @@ _LINT_man_groff_eqn    :=$(patsubst $(MANDIR)/%,$(_LINTDIR)/%.eqn,$(LINTMAN))
 _LINT_man_groff_troff  :=$(patsubst $(MANDIR)/%,$(_LINTDIR)/%.troff,$(LINTMAN))
 _LINT_man_groff_grotty :=$(patsubst $(MANDIR)/%,$(_LINTDIR)/%.grotty,$(LINTMAN))
 _LINT_man_groff_col    :=$(patsubst $(MANDIR)/%,$(_LINTDIR)/%.col,$(LINTMAN))
+_LINT_man_groff_grep   :=$(patsubst $(MANDIR)/%,$(_LINTDIR)/%.grep,$(LINTMAN))
 
 _LINT_man_groff :=$(patsubst $(MANDIR)/%,$(_LINTDIR)/%.lint-man.groff.touch,$(LINTMAN))
 _LINT_man_mandoc:=$(patsubst $(MANDIR)/%,$(_LINTDIR)/%.lint-man.mandoc.touch,$(LINTMAN))
@@ -94,10 +95,13 @@ $(_LINT_man_groff_col): %.col: %.grotty | $$(@D)/.
 	$(info LINT (grotty)	$@)
 	$(GROTTY) $(GROTTYFLAGS) <$< >$@
 
-$(_LINT_man_groff): %.lint-man.groff.touch: %.col | $$(@D)/.
+$(_LINT_man_groff_grep): %.grep: %.col | $$(@D)/.
 	$(info LINT (col)	$@)
-	$(COL) $(COLFLAGS) <$< \
-	| (! $(GREP) -n '.\{$(MANWIDTH)\}.' | $(SED) 's,^,$<:,' >&2)
+	$(COL) $(COLFLAGS) <$< >$@
+
+$(_LINT_man_groff): %.lint-man.groff.touch: %.grep | $$(@D)/.
+	$(info LINT (grep)	$@)
+	! $(GREP) -n '.\{$(MANWIDTH)\}.' $< /dev/null >&2
 	touch $@
 
 $(_LINT_man_mandoc): $(_LINTDIR)/%.lint-man.mandoc.touch: $(MANDIR)/% | $$(@D)/.
@@ -153,6 +157,14 @@ lint-man-groff-troff: $(_LINT_man_groff_grotty)
 lint-man-groff-grotty: $(_LINT_man_groff_col)
 	@:
 
+.PHONY: lint-man-groff-col
+lint-man-groff-col: $(_LINT_man_groff_grep)
+	@:
+
+.PHONY: lint-man-groff-grep
+lint-man-groff-grep: $(_LINT_man_groff)
+	@:
+
 .PHONY: $(lint_man)
 $(lint_man): lint-man-%: $$(_LINT_man_%)
 	@:
-- 
2.39.2




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux