diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2016-10-17 06:15:34 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2016-10-18 17:11:21 +0200 |
commit | b156e764698e560101af25a28eee461fad33f64a (patch) | |
tree | 399fc7b848e230a7e57c46f359a42cfee3aa4ea7 | |
parent | 4dba500ed50bdfd58b78653b3679d21bf344d70f (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
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 10 | ||||
-rw-r--r-- | OsmoBSC/Makefile | 2 | ||||
-rw-r--r-- | OsmoBTS/Makefile | 4 | ||||
-rw-r--r-- | OsmoNITB/Makefile | 2 | ||||
-rw-r--r-- | OsmoPCU/Makefile | 2 | ||||
-rw-r--r-- | OsmoSGSN/Makefile | 2 | ||||
-rw-r--r-- | build/Makefile.asciidoc.inc | 11 |
8 files changed, 28 insertions, 6 deletions
@@ -8,4 +8,5 @@ *.html *__*.png *__*.svg +*.check generated/ @@ -24,3 +24,13 @@ upload: cd OsmoSGSN; $(MAKE) upload cd OsmoNAT; $(MAKE) upload cd OsmoPCU; $(MAKE) upload + +check: + cd OsmoBTS; $(MAKE) check + cd OsmoNITB; $(MAKE) check + cd OsmoBSC; $(MAKE) check + cd OsmoSGSN; $(MAKE) check + cd OsmoPCU; $(MAKE) check + # These don't use asciidoc, so they have no 'make check' target: + #cd OsmoMGCP; $(MAKE) check + #cd OsmoNAT; $(MAKE) check diff --git a/OsmoBSC/Makefile b/OsmoBSC/Makefile index fb5e269..9fc6f26 100644 --- a/OsmoBSC/Makefile +++ b/OsmoBSC/Makefile @@ -24,7 +24,7 @@ osmobsc-usermanual.pdf: chapters/*.adoc clean: rm -rf $(cleanfiles) - rm -rf osmobsc-usermanual__*.{svg,png} + rm -rf osmobsc-usermanual__*.{svg,png,check} gen-bsc-vty-docbook: FORCE $(call command,xsltproc -o generated/combined1.xml \ diff --git a/OsmoBTS/Makefile b/OsmoBTS/Makefile index 729704e..f2c873a 100644 --- a/OsmoBTS/Makefile +++ b/OsmoBTS/Makefile @@ -23,8 +23,8 @@ osmobts-usermanual.pdf: chapters/*.adoc clean: rm -rf $(cleanfiles) - rm -rf osmobts-abis__*.{svg,png} - rm -rf osmobts-usermanual__*.{svg,png} + rm -rf osmobts-abis__*.{svg,png,check} + rm -rf osmobts-usermanual__*.{svg,png,check} gen-bts-vty-docbook: FORCE $(call command,xsltproc -o generated/combined1.xml \ diff --git a/OsmoNITB/Makefile b/OsmoNITB/Makefile index d3bf5c8..e68b9b0 100644 --- a/OsmoNITB/Makefile +++ b/OsmoNITB/Makefile @@ -23,7 +23,7 @@ osmonitb-usermanual.pdf: chapters/*.adoc clean: rm -rf $(cleanfiles) - rm -rf osmonitb-usermanual__*.{svg,png} + rm -rf osmonitb-usermanual__*.{svg,png,check} gen-nitb-vty-docbook: FORCE $(call command,xsltproc -o generated/combined1.xml \ diff --git a/OsmoPCU/Makefile b/OsmoPCU/Makefile index 6b4ecb8..1f06183 100644 --- a/OsmoPCU/Makefile +++ b/OsmoPCU/Makefile @@ -25,7 +25,7 @@ osmopcu-usermanual.pdf: chapters/*.adoc clean: rm -rf $(cleanfiles) rm -rf gen-vty-docbook - rm -rf osmopcu-usermanual__*.{svg,png} + rm -rf osmopcu-usermanual__*.{svg,png,check} gen-vty-docbook: FORCE $(call command,xsltproc -o generated/combined1.xml \ diff --git a/OsmoSGSN/Makefile b/OsmoSGSN/Makefile index 612c10f..7df5168 100644 --- a/OsmoSGSN/Makefile +++ b/OsmoSGSN/Makefile @@ -22,7 +22,7 @@ include $(TOPDIR)/build/Makefile.inc osmosgsn-usermanual.pdf: chapters/*.adoc clean: - rm -rf osmosgsn-usermanual__*.{svg,png} + rm -rf osmosgsn-usermanual__*.{svg,png,check} rm -rf $(cleanfiles) gen-sgsn-vty-docbook: FORCE 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 |