diff options
author | 2016-02-05 15:45:38 -0800 | |
---|---|---|
committer | 2016-02-05 15:45:54 -0800 | |
commit | 13a31c7b34b8afe93bb38f751eb6b1e45c590dca (patch) | |
tree | d057c6346d6f683dd7a6c1cafbddcbb4e9c39d6c /Makefile | |
parent | doc: add --kernel-outputdir to documentation. (diff) | |
download | genkernel-13a31c7b34b8afe93bb38f751eb6b1e45c590dca.tar.gz genkernel-13a31c7b34b8afe93bb38f751eb6b1e45c590dca.tar.bz2 genkernel-13a31c7b34b8afe93bb38f751eb6b1e45c590dca.zip |
Makefile: add a check to ensure all output from --help is documented.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 31 |
1 files changed, 29 insertions, 2 deletions
@@ -30,7 +30,7 @@ check-git-repository: git diff --quiet || { echo 'STOP, you have uncommitted changes in the working directory' ; false ; } git diff --cached --quiet || { echo 'STOP, you have uncommitted changes in the index' ; false ; } -dist: check-git-repository distclean $(EXTRA_DIST) +dist: verify-doc check-git-repository distclean $(EXTRA_DIST) mkdir "$(distdir)" git ls-files -z | xargs -0 cp --no-dereference --parents --target-directory="$(distdir)" \ $(EXTRA_DIST) @@ -41,7 +41,7 @@ dist: check-git-repository distclean $(EXTRA_DIST) distclean: clean rm -Rf "$(distdir)" "$(distdir)".tar "$(distdir)".tar.xz -.PHONY: clean check-git-repository dist distclean kconfig +.PHONY: clean check-git-repository dist distclean kconfig verify-doc # Generic rules %/generated-config: %/arch-config $(BASE_KCONF) merge.pl Makefile @@ -54,3 +54,30 @@ distclean: clean %.8: doc/%.8.txt doc/asciidoc.conf Makefile genkernel a2x --conf-file=doc/asciidoc.conf --attribute="genkernelversion=$(PACKAGE_VERSION)" \ --format=manpage -D . "$<" + +verify-doc: doc/genkernel.8.txt + @rm -f faildoc ; \ + GK_SHARE=. ./genkernel --help | \ + sed 's,-->, ,g' | \ + fmt -1 | \ + grep -e '--' | \ + tr -s '[:space:].,' ' ' | \ + sed -r \ + -e 's,=<[^>]+>,,g' | \ + tr -s ' ' '\n' | \ + sed -r \ + -e 's,[[:space:]]*--(no-)?,,g' \ + -e '/bootloader/s,=grub,,g' | \ + while read opt ; do \ + regex="^*--(...no-...)?$$opt" ; \ + if ! egrep -e "$$regex" $< -sq ; then \ + touch faildoc ; \ + echo "Undocumented option: $$opt" ; \ + fi ; \ + done ; \ + if test -e faildoc ; then \ + echo "Refusing to build!" ; \ + rm -f faildoc ; \ + exit 1 ; \ + fi ; \ + rm -f faildoc |