summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2016-10-17 06:15:34 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2016-10-18 17:11:21 +0200
commitb156e764698e560101af25a28eee461fad33f64a (patch)
tree399fc7b848e230a7e57c46f359a42cfee3aa4ea7 /build
parent4dba500ed50bdfd58b78653b3679d21bf344d70f (diff)
add 'make check' target
Generate *.check files from asciidoc output and grep for WARNINGs. Add *.check files to gitignore and to 'make clean'. Change-Id: Ibccc83a3415930a528f2e8e4e4dda3b81c6d0b64
Diffstat (limited to 'build')
-rw-r--r--build/Makefile.asciidoc.inc11
1 files changed, 11 insertions, 0 deletions
diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc
index 7def592..f95cd0b 100644
--- a/build/Makefile.asciidoc.inc
+++ b/build/Makefile.asciidoc.inc
@@ -9,6 +9,7 @@ GIT_DATE := $(shell $(TOPDIR)/build/unix-time-to-fmt.py `git log -n 1 "--pretty=
# generate list of PDFs that we're supposed to render
ASCIIDOCPDFS = $(ASCIIDOCS:%=%.pdf)
+ASCIIDOC_CHECKS = $(ASCIIDOCS:%=%.check)
ASCIIDOCSTYLE ?= $(BUILDDIR)/custom-dblatex.sty
@@ -30,3 +31,13 @@ all: $(ASCIIDOCPDFS)
$(ASCIIDOCPDFS): %.pdf: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(TOPDIR)/common/chapters/*.adoc
a2x $(A2X_OPTS) $< || asciidoc -f $(BUILDDIR)/mscgen-filter.conf -f $(BUILDDIR)/diag-filter.conf $<
+
+check: $(ASCIIDOC_CHECKS)
+
+$(ASCIIDOC_CHECKS): %.check: %.adoc %-docinfo.xml $(ASCIIDOCSTYLE) $(TOPDIR)/common/chapters/*.adoc chapters/*.adoc
+ asciidoc -v $(ASCIIDOC_OPTS) $< > $@ 2>&1
+ # Make absolutely sure that the %.check target is updated.
+ touch $@
+ # Do print the WARNING output but return error if any was found
+ # (grep -v would omit the WARNING output from the log).
+ @grep WARNING $@ && exit 1 || exit 0