]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
share/mk/: lint-man-so: Check that .so link pages point to an existing file
authorAlejandro Colomar <alx@kernel.org>
Sat, 15 Jun 2024 16:22:46 +0000 (18:22 +0200)
committerAlejandro Colomar <alx@kernel.org>
Sat, 15 Jun 2024 16:33:06 +0000 (18:33 +0200)
Cc: Adam Sampson <ats@offog.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
share/mk/lint/man/_.mk
share/mk/lint/man/so.mk [new file with mode: 0644]

index 67ff4b86f09bc51f4134290aad537e084a3a24bf..88038261bbf4b59873e0813c648ad437318808ca 100644 (file)
@@ -7,7 +7,7 @@ MAKEFILE_LINT_MAN_INCLUDED := 1
 
 
 .PHONY: lint-man
-lint-man: lint-man-mandoc lint-man-tbl;
+lint-man: lint-man-mandoc lint-man-tbl lint-man-so;
 
 
 endif  # include guard
diff --git a/share/mk/lint/man/so.mk b/share/mk/lint/man/so.mk
new file mode 100644 (file)
index 0000000..9aa6021
--- /dev/null
@@ -0,0 +1,31 @@
+# Copyright 2024, Alejandro Colomar <alx@kernel.org>
+# SPDX-License-Identifier: LGPL-3.0-only WITH LGPL-3.0-linking-exception
+
+
+ifndef MAKEFILE_LINT_MAN_SO_INCLUDED
+MAKEFILE_LINT_MAN_SO_INCLUDED := 1
+
+
+include $(MAKEFILEDIR)/build/man/man.mk
+include $(MAKEFILEDIR)/configure/build-depends/coreutils/cut.mk
+include $(MAKEFILEDIR)/configure/build-depends/findutils/find.mk
+include $(MAKEFILEDIR)/configure/build-depends/findutils/xargs.mk
+include $(MAKEFILEDIR)/configure/build-depends/grep/grep.mk
+
+
+_LINT_man_so := $(patsubst %, %.lint-man.so.touch, $(_SO_MAN))
+
+
+$(_LINT_man_so): %.lint-man.so.touch: % $(MK) | $$(@D)/
+       $(info  $(INFO_)FIND            $@)
+       $(GREP) '^\.so ' <$< \
+       | $(CUT) -f2 -d' ' \
+       | $(XARGS) -I {} $(FIND) '$(MANDIR)/{}' \
+       >$@
+
+
+.PHONY: lint-man-so
+lint-man-so: $(_LINT_man_so);
+
+
+endif  # include guard