From b156e764698e560101af25a28eee461fad33f64a Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 17 Oct 2016 06:15:34 +0200 Subject: 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 --- build/Makefile.asciidoc.inc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'build') 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 -- cgit v1.2.3