aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/Makefile4
-rw-r--r--Makefile3
-rwxr-xr-xscripts/documentation-file-ref-check15
3 files changed, 21 insertions, 1 deletions
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 5e65fa5c6ab7..2ca77ad0f238 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -97,6 +97,9 @@ endif # HAVE_SPHINX
97# The following targets are independent of HAVE_SPHINX, and the rules should 97# The following targets are independent of HAVE_SPHINX, and the rules should
98# work or silently pass without Sphinx. 98# work or silently pass without Sphinx.
99 99
100refcheckdocs:
101 $(Q)cd $(srctree);scripts/documentation-file-ref-check
102
100cleandocs: 103cleandocs:
101 $(Q)rm -rf $(BUILDDIR) 104 $(Q)rm -rf $(BUILDDIR)
102 $(Q)$(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/media clean 105 $(Q)$(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/media clean
@@ -109,6 +112,7 @@ dochelp:
109 @echo ' epubdocs - EPUB' 112 @echo ' epubdocs - EPUB'
110 @echo ' xmldocs - XML' 113 @echo ' xmldocs - XML'
111 @echo ' linkcheckdocs - check for broken external links (will connect to external hosts)' 114 @echo ' linkcheckdocs - check for broken external links (will connect to external hosts)'
115 @echo ' refcheckdocs - check for references to non-existing files under Documentation'
112 @echo ' cleandocs - clean all generated files' 116 @echo ' cleandocs - clean all generated files'
113 @echo 117 @echo
114 @echo ' make SPHINXDIRS="s1 s2" [target] Generate only docs of folder s1, s2' 118 @echo ' make SPHINXDIRS="s1 s2" [target] Generate only docs of folder s1, s2'
diff --git a/Makefile b/Makefile
index bcb20d2c1eac..11df924e160a 100644
--- a/Makefile
+++ b/Makefile
@@ -1454,7 +1454,8 @@ $(help-board-dirs): help-%:
1454 1454
1455# Documentation targets 1455# Documentation targets
1456# --------------------------------------------------------------------------- 1456# ---------------------------------------------------------------------------
1457DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs linkcheckdocs dochelp 1457DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs \
1458 linkcheckdocs dochelp refcheckdocs
1458PHONY += $(DOC_TARGETS) 1459PHONY += $(DOC_TARGETS)
1459$(DOC_TARGETS): scripts_basic FORCE 1460$(DOC_TARGETS): scripts_basic FORCE
1460 $(Q)$(MAKE) $(build)=Documentation $@ 1461 $(Q)$(MAKE) $(build)=Documentation $@
diff --git a/scripts/documentation-file-ref-check b/scripts/documentation-file-ref-check
new file mode 100755
index 000000000000..bc1659900e89
--- /dev/null
+++ b/scripts/documentation-file-ref-check
@@ -0,0 +1,15 @@
1#!/bin/sh
2# Treewide grep for references to files under Documentation, and report
3# non-existing files in stderr.
4
5for f in $(git ls-files); do
6 for ref in $(grep -ho "Documentation/[A-Za-z0-9_.,~/*+-]*" "$f"); do
7 # presume trailing . and , are not part of the name
8 ref=${ref%%[.,]}
9
10 # use ls to handle wildcards
11 if ! ls $ref >/dev/null 2>&1; then
12 echo "$f: $ref" >&2
13 fi
14 done
15done