summaryrefslogtreecommitdiffstats
path: root/share/mk/lint/man/mdoc.mk
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:40:15 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 19:40:15 +0000
commit399644e47874bff147afb19c89228901ac39340e (patch)
tree1c4c0b733f4c16b5783b41bebb19194a9ef62ad1 /share/mk/lint/man/mdoc.mk
parentInitial commit. (diff)
downloadmanpages-399644e47874bff147afb19c89228901ac39340e.tar.xz
manpages-399644e47874bff147afb19c89228901ac39340e.zip
Adding upstream version 6.05.01.upstream/6.05.01
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--share/mk/lint/man/mdoc.mk44
1 files changed, 44 insertions, 0 deletions
diff --git a/share/mk/lint/man/mdoc.mk b/share/mk/lint/man/mdoc.mk
new file mode 100644
index 0000000..9b5f5b4
--- /dev/null
+++ b/share/mk/lint/man/mdoc.mk
@@ -0,0 +1,44 @@
+########################################################################
+# Copyright 2023, Alejandro Colomar <alx@kernel.org>
+# SPDX-License-Identifier: GPL-3.0-or-later
+########################################################################
+
+
+ifndef MAKEFILE_LINT_MAN_MDOC_INCLUDED
+MAKEFILE_LINT_MAN_MDOC_INCLUDED := 1
+
+
+include $(MAKEFILEDIR)/cmd.mk
+include $(MAKEFILEDIR)/build/_.mk
+include $(MAKEFILEDIR)/lint/_.mk
+include $(MAKEFILEDIR)/lint/man/_.mk
+include $(MAKEFILEDIR)/src.mk
+
+
+mandoc_mdoc_ignore_grep := $(DATAROOTDIR)/lint/mandoc/mdoc.ignore.grep
+
+_LINT_mdoc_mandoc:=$(patsubst $(MANDIR)/%,$(_MANDIR)/%.lint-mdoc.mandoc.touch,$(NONSO_MDOC))
+
+
+linters_mdoc := mandoc
+lint_mdoc := $(foreach x,$(linters_mdoc),lint-mdoc-$(x))
+
+
+$(_LINT_mdoc_mandoc): $(_MANDIR)/%.lint-mdoc.mandoc.touch: $(MANDIR)/% $(mandoc_mdoc_ignore_grep) | $$(@D)/
+ $(info LINT (mandoc) $@)
+ ! ($(MANDOC) -mdoc $(MANDOCFLAGS) $< 2>&1 \
+ | $(GREP) -v -f '$(mandoc_mdoc_ignore_grep)' \
+ ||:; \
+ ) \
+ | $(GREP) ^ >&2
+ touch $@
+
+
+.PHONY: $(lint_mdoc)
+$(lint_mdoc): lint-mdoc-%: $$(_LINT_mdoc_%);
+
+.PHONY: lint-mdoc
+lint-mdoc: $(lint_mdoc);
+
+
+endif # include guard