diff options
| author | Robin Haberkorn <rhaberkorn@fmsbw.de> | 2025-11-18 20:16:25 +0100 |
|---|---|---|
| committer | Robin Haberkorn <rhaberkorn@fmsbw.de> | 2025-11-18 20:30:29 +0100 |
| commit | 03496e976dbb492c4f58db1a82ca6351ea937fc4 (patch) | |
| tree | 947fb4898fc17126fe8769d7d6e74e5975a5053b | |
| parent | b6e364efeedd6466bba2f995c7a7976f7b54363e (diff) | |
avoid GNU Make grouped targets and templates to build womanpages
* grosciteco.tes generates two output files.
First this was modeled with `%.woman %.woman.tec : ...`, but it creates independant rules
which could result in superfluous builds and broke parallel builds.
Then I tried grouped targets (`%.woman %.woman.tec &: ...`) which were supposed to solve the
problem cleanly. However they turned out to be buggy with pattern rules,
so I used templates instead.
Unfortunately grouped targets turned out to be unreliable in general and that broke
some older platforms, resulting in broken .woman.tec files.
* The same can be achieved by declaring .woman files the main artifact and
having an empty rule like `%.woman.tec : %.woman;`.
If anything draws in .woman.tec, it will still execute the rule only once.
| -rw-r--r-- | doc/Makefile.am | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am index 9929099..8ac9fad 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -80,20 +80,15 @@ EXTRA_DIST += tutorial.ms.in CLEANFILES += $(women_DATA) -# Using pattern rules is bugged in some versions of GNU make in -# combination with grouped targets (&:). -define woman_man_rule -$(1).woman $(1).woman.tec &: $(1) sciteco.tmac grosciteco.tes - @GROFF@ @GROFF_FLAGS@ -wall -Z -Tutf8 -t -man -M@srcdir@ -msciteco $$< | \ - $(SCITECO_FULL) -im -- @srcdir@/grosciteco.tes $$@ -endef - -$(eval $(call woman_man_rule,grosciteco.tes.1)) -$(eval $(call woman_man_rule,tedoc.tes.1)) -$(eval $(call woman_man_rule,sciteco.1)) -$(eval $(call woman_man_rule,sciteco.7)) - -tutorial.woman tutorial.woman.tec &: tutorial.ms sciteco.tmac grosciteco.tes +# NOTE: grosciteco.tes generates two artifacts, but two targets in one rule would be independent. +# Grouped targets (&:) on the other hand are unreliable/buggy. +%.woman.tec : %.woman; + +%.woman : % sciteco.tmac grosciteco.tes + @GROFF@ @GROFF_FLAGS@ -wall -Z -Tutf8 -t -man -M@srcdir@ -msciteco $< | \ + $(SCITECO_FULL) -im -- @srcdir@/grosciteco.tes $@ + +tutorial.woman : tutorial.ms sciteco.tmac grosciteco.tes @GROFF@ @GROFF_FLAGS@ -wall -Z -Tutf8 -t -ms -M@srcdir@ -msciteco $< | \ $(SCITECO_FULL) -im -- @srcdir@/grosciteco.tes $@ |
