summaryrefslogtreecommitdiff
path: root/doc/doc.am
diff options
context:
space:
mode:
authorG. Branden Robinson <g.branden.robinson@gmail.com>2022-03-23 19:08:10 +1100
committerG. Branden Robinson <g.branden.robinson@gmail.com>2022-04-06 08:51:19 +1000
commitb8efdbbd82f813b57fd4c6dedeb7b5aa19053a21 (patch)
tree9376217431e7ec2272bbe3df036402954a8e5f61 /doc/doc.am
parent57a58e99ff833cf2c8f182eb0e96f4293e44e5ec (diff)
downloadgroff-git-b8efdbbd82f813b57fd4c6dedeb7b5aa19053a21.tar.gz
doc/doc.am: Refactor to drop unused `DOC_GROFF`.
* doc/doc.am: Refactor. Drop ghastly hack used to get file names into troff diagnostics when reading from standard input. We've refactored so that it no longer does, making the hack unnecessary. For the same reason, no users of the `DOC_GROFF` macro remain, so delete it. Add comments to explain what `DOC_SED` and `DOC_GROFF_ONLY` are for. Thanks to Ingo Schwarze for the discussion.
Diffstat (limited to 'doc/doc.am')
-rw-r--r--doc/doc.am23
1 files changed, 8 insertions, 15 deletions
diff --git a/doc/doc.am b/doc/doc.am
index 0998d8c91..90415aa7e 100644
--- a/doc/doc.am
+++ b/doc/doc.am
@@ -21,10 +21,18 @@
doc_srcdir = $(abs_top_srcdir)/doc
doc_builddir = $(abs_top_builddir)/doc
+# Some document sources are parameterized in configuration options like
+# the groff version number and the command prefix. Use this in target
+# rules to prepare formattable versions of them from .in files.
DOC_SED = $(SED) \
-e "s;[@]VERSION[@];$(VERSION);" \
-e "s;[@]g[@];$(g);g;"
+# Use this in target rules to run the build tree's groff.
+#
+# It includes flags to locate its tmac and device/font description
+# directories and to produce verbose diagnostics in the event of syntax
+# or formatting problems.
DOC_GROFF_ONLY=\
GROFF_COMMAND_PREFIX= \
GROFF_BIN_PATH="$(GROFF_BIN_PATH)" \
@@ -34,21 +42,6 @@ DOC_GROFF_ONLY=\
# This image file is used by several documents in the groff source tree.
DOC_GNU_EPS=doc/gnu.eps
-# A dance is required to embed a literal newline inside a sed expression
-# inside a shell command executed as part of a Make target rule.
-#
-# Use the POSIX shell $'\n' feature when all platforms of interest
-# support it.
-#
-#DOC_GROFF = $(DOC_SED) -e 1i\$$'\n'".lf 1 $<"$$'\n' $< \
-# | $(DOC_GROFF_ONLY)
-#
-# In the meantime, a shell variable must be prepared in each target rule
-# shell command using $(DOC_SED). This solution is adapted from the GNU
-# Autoconf manual, "Newlines in Make Rules".
-DOC_GROFF = nlinit=`echo 'nl="'; echo '"'`; eval "$$nlinit"; \
- $(DOC_SED) -e "1i\\$$nl.lf 1 $<$$nl" $< | $(DOC_GROFF_ONLY)
-
# Other doc, installed in $(docdir)
if BUILD_OTHERDOC
# Files located in the source tree