aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 16 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index aa4bce6..d9377df 100644
--- a/Makefile
+++ b/Makefile
@@ -64,9 +64,22 @@ check-templates: build ## typeset every shipped template (needs pdflatex/groff;
else echo "SKIPPED: pdflatex not installed -- LaTeX templates render but are NOT typeset"; fi; \
if command -v groff >/dev/null 2>&1; then \
for t in ordo grid; do \
- opam exec -- dune exec colitur -- table --year 2027 --template templates/ef/$$t.ms > /tmp/$$t.ms && \
- groff -ms -t -Tpdf /tmp/$$t.ms > /tmp/$$t-ms.pdf && \
- echo "groff: $$t.ms OK" || { echo "groff: $$t.ms FAILED"; ok=0; }; \
+ gflags=""; \
+ [ "$$t" = grid ] && gflags="-P-pa4l"; \
+ if opam exec -- dune exec colitur -- table --year 2027 --template templates/ef/$$t.ms \
+ > /tmp/$$t.ms 2>/tmp/$$t-render.err; then \
+ groff -ms -t -Tpdf $$gflags /tmp/$$t.ms > /tmp/$$t-ms.pdf 2>/tmp/$$t-ms.warnings; \
+ if [ -s /tmp/$$t-ms.warnings ]; then \
+ echo "groff: $$t.ms FAILED (groff exits 0 on a tbl/troff warning -- this target"; \
+ echo " treats ANY stderr output as a failure, since a warning here has meant"; \
+ echo " silently lost table columns before):"; \
+ cat /tmp/$$t-ms.warnings; ok=0; \
+ else \
+ echo "groff: $$t.ms OK"; \
+ fi; \
+ else \
+ echo "groff: $$t.ms FAILED (colitur table render):"; cat /tmp/$$t-render.err; ok=0; \
+ fi; \
done; \
else echo "SKIPPED: groff not installed -- groff templates render but are NOT typeset"; fi; \
test $$ok -eq 1