Allow running tbl(1) separately, which has several benefits: - More granular testing. - Allows inspecting the output of tbl(1), which can be useful for debugging the pages. Signed-off-by: Alejandro Colomar <alx@xxxxxxxxxx> --- Makefile | 3 ++- lib/lint-man.mk | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 54b492d40..46e71faab 100644 --- a/Makefile +++ b/Makefile @@ -70,9 +70,10 @@ help: $(info lint-c-cpplint Lint C programs from EXAMPLES with cpplint(1)) $(info lint-c-iwyu Lint C programs from EXAMPLES with iwyu(1)) $(info lint-man Wrapper for lint-man-* targets) - $(info lint-man-groff Lint man pages with groff(1)) $(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-tbl Lint man pages with tbl(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 c4a4c57b0..8207860d8 100644 --- a/lib/lint-man.mk +++ b/lib/lint-man.mk @@ -64,6 +64,8 @@ MANDOCFLAGS := $(DEFAULT_MANDOCFLAGS) $(EXTRA_MANDOCFLAGS) MANDOC := mandoc +_LINT_man_groff_eqn :=$(patsubst $(MANDIR)/%,$(_LINTDIR)/%.eqn,$(LINTMAN)) + _LINT_man_groff :=$(patsubst $(MANDIR)/%,$(_LINTDIR)/%.lint-man.groff.touch,$(LINTMAN)) _LINT_man_mandoc:=$(patsubst $(MANDIR)/%,$(_LINTDIR)/%.lint-man.mandoc.touch,$(LINTMAN)) _LINT_man_tbl :=$(patsubst $(MANDIR)/%,$(_LINTDIR)/%.lint-man.tbl.touch,$(LINTMAN)) @@ -73,10 +75,13 @@ linters_man := groff mandoc tbl lint_man := $(foreach x,$(linters_man),lint-man-$(x)) -$(_LINT_man_groff): $(_LINTDIR)/%.lint-man.groff.touch: $(MANDIR)/% | $$(@D)/. +$(_LINT_man_groff_eqn): $(_LINTDIR)/%.eqn: $(MANDIR)/% | $$(@D)/. + $(info LINT (tbl) $@) + $(TBL) $< >$@ + +$(_LINT_man_groff): %.lint-man.groff.touch: %.eqn | $$(@D)/. $(info LINT (groff) $@) - $(TBL) $< \ - | $(EQN) $(EQNFLAGS) \ + $(EQN) $(EQNFLAGS) <$< \ | $(TROFF) $(TROFFFLAGS) \ | $(GROTTY) $(GROTTYFLAGS) \ | $(COL) $(COLFLAGS) \ @@ -120,6 +125,10 @@ $(_LINT_man_tbl): $(_LINTDIR)/%.lint-man.tbl.touch: $(MANDIR)/% | $$(@D)/. touch $@ +.PHONY: lint-man-groff-tbl +lint-man-groff-tbl: $(_LINT_man_groff_eqn) + @: + .PHONY: $(lint_man) $(lint_man): lint-man-%: $$(_LINT_man_%) @: -- 2.39.2