diff options
Diffstat (limited to 'doc/Makefile.am')
| -rw-r--r-- | doc/Makefile.am | 75 |
1 files changed, 39 insertions, 36 deletions
diff --git a/doc/Makefile.am b/doc/Makefile.am index f69d95f..f5b3d03 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -7,16 +7,20 @@ include $(top_srcdir)/bootstrap.am # code. # It generates Troff manpage markup and acts as a Troff # preprocessor to manpage templates. -dist_bin_SCRIPTS = tedoc.tes +bin_SCRIPTS = tedoc.tes +CLEANFILES = tedoc.tes +dist_noinst_SCRIPTS = tedoc.tes.in %.in : %.template tedoc.tes @top_srcdir@/src/*.c - $(SCITECO_FULL) -m -- @srcdir@/tedoc.tes \ + $(SCITECO_FULL) -m -- tedoc.tes \ -C $@ $< @top_srcdir@/src/*.c # grosciteco is a troff postprocessor similar to grotty # which can be used to produce SciTECO-friendly output # (woman pages). -dist_bin_SCRIPTS += grosciteco.tes +bin_SCRIPTS += grosciteco.tes +CLEANFILES += grosciteco.tes +dist_noinst_SCRIPTS += grosciteco.tes.in # grosciteco, like many other postprocessors, works # best with its own macro package. # Unfortunately, there is no way to query the built-in @@ -27,56 +31,59 @@ dist_bin_SCRIPTS += grosciteco.tes # the directory via `groff -M`. dist_scitecodata_DATA = sciteco.tmac -# Fix up the hash-bang line of installed SciTECO scripts upon -# installation to refer to the installed sciteco binary. -# This takes --program-prefix into account. -# -# FIXME: This will patch the hash-bang line repeatedly. -install-exec-hook: - $(SCITECO_FULL) -e "@EB'$(DESTDIR)$(bindir)/*.tes' 1U* \ - EJ-1<%*^[ 0,^Q::@FR'#!^EM^Xsciteco'#!$(SCITECO_INSTALLED)'> \ - :EX" +# Fix up the hash-bang line of installed SciTECO scripts. +# This takes --prefix and --program-prefix into account. +# On the other hand, since this is run at build time, +# it breaks bindir-overwriting at `make install` time, +# which could only be made to work with an install-exec-hook. +# Patching installed scripts however broke the FreeBSD port +# builds with Poudriere where BINMODE=555 is set. +# It was therefore decided to sacrifice the rarely used +# `make install bindir=...` and appease the FreeBSD port +# committers instead. +%.tes : %.tes.in + $(SCITECO_FULL) -qioe '0,^Q::@FR/#!^EM^Xsciteco/#!^EQ[^A1]/^[' \ + $(SCITECO_INSTALLED) <$< >$@ womendir = $(scitecolibdir)/women women_DATA = grosciteco.tes.1.woman grosciteco.tes.1.woman.tec -CLEANFILES = grosciteco.tes.1 grosciteco.tes.1.intermediate +CLEANFILES += grosciteco.tes.1 EXTRA_DIST = grosciteco.tes.1.in women_DATA += tedoc.tes.1.woman tedoc.tes.1.woman.tec -CLEANFILES += tedoc.tes.1 tedoc.tes.1.intermediate +CLEANFILES += tedoc.tes.1 EXTRA_DIST += tedoc.tes.1.in women_DATA += sciteco.1.woman sciteco.1.woman.tec -CLEANFILES += sciteco.1 sciteco.1.intermediate +CLEANFILES += sciteco.1 EXTRA_DIST += sciteco.1.in women_DATA += sciteco.7.woman sciteco.7.woman.tec -CLEANFILES += sciteco.7 sciteco.7.intermediate sciteco.7.in sciteco.7.htbl +CLEANFILES += sciteco.7 sciteco.7.in EXTRA_DIST += sciteco.7.template women_DATA += tutorial.woman tutorial.woman.tec -CLEANFILES += tutorial.ms tutorial.intermediate +CLEANFILES += tutorial.ms EXTRA_DIST += tutorial.ms.in CLEANFILES += $(women_DATA) -# NOTE: *.intermediate files are only generated since SciTECO scripts -# cannot currently read stdin, so the grosciteco postprocessor -# has to be run on a separate file. -%.woman %.woman.tec : %.intermediate grosciteco.tes - $(SCITECO_FULL) -m -- @srcdir@/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; -%.intermediate : % sciteco.tmac - @GROFF@ -wall -Z -Kutf-8 -Tutf8 -t -man -M@srcdir@ -msciteco $< >$@ +%.woman : % sciteco.tmac grosciteco.tes + @GROFF@ @GROFF_FLAGS@ -wall -Z -Tutf8 -t -man -M@srcdir@ -msciteco $< | \ + $(SCITECO_FULL) -im -- grosciteco.tes $@ -tutorial.intermediate : tutorial.ms sciteco.tmac - @GROFF@ -wall -Z -Kutf-8 -Tutf8 -t -ms -M@srcdir@ -msciteco $< >$@ +tutorial.woman : tutorial.ms sciteco.tmac grosciteco.tes + @GROFF@ @GROFF_FLAGS@ -wall -Z -Tutf8 -t -ms -M@srcdir@ -msciteco $< | \ + $(SCITECO_FULL) -im -- grosciteco.tes $@ man_MANS = grosciteco.tes.1 tedoc.tes.1 sciteco.1 sciteco.7 -dist_noinst_SCRIPTS = htbl.tes +dist_noinst_SCRIPTS += htbl.tes if BUILD_HTMLDOCS html_DATA = grosciteco.tes.1.html tedoc.tes.1.html \ @@ -84,16 +91,12 @@ html_DATA = grosciteco.tes.1.html tedoc.tes.1.html \ CLEANFILES += $(html_DATA) endif -# NOTE: The *.htbl files are only generated since SciTECO -# scripts cannot be integrated into pipelines easily yet. -%.htbl : % htbl.tes - $(SCITECO_FULL) -m -- @srcdir@/htbl.tes $< $@ - -%.html : %.htbl - @GROFF@ -wall -Thtml -man $< >$@ +%.html : % htbl.tes + $(SCITECO_FULL) -qiom -- @srcdir@/htbl.tes <$< | \ + @GROFF@ @GROFF_FLAGS@ -wall -Thtml -man >$@ %.html : %.ms - @GROFF@ -wall -Thtml -ms $< >$@ + @GROFF@ @GROFF_FLAGS@ -wall -Thtml -ms $< >$@ # FIXME: We may want to build the cheat sheet automatically. # This would require a full Groff installation, though. |
