Pádraig Brady <[email protected]> writes:

> On 08/12/2025 05:41, Collin Funk wrote:
>> Pádraig Brady <[email protected]> writes:
>> 
>>> I pushed the attached version which defines a more general @optItem macro.
>>>
>>> Then I pushed a further (large/boring so not attached), to use that macro
>>> to add an anchor/index to each command option description,
>>> while also reducing the texinfo source file by over 1000 lines.
>>> https://github.com/coreutils/coreutils/commit/796b8d1a6
>> It is a nice cleanup, but unfortunately I am unable to build the PDF
>> documentation after them (or DVI, since that is required to generate the
>> PDF).
>> The TeX errors are not exactly helpful:
>
> Ah the dvi parsing is more strict than for info/html,
> and needs empty arguments to be specified explicitly.
> I made that change, added a syntax check and pushed.

Thanks, that fixes it.

Also, I just noticed that the html docs will likely fail if you use
parallel make:

    $ make -j 16 pdf dvi ps html info
    [...]
      MAKEINFO doc/coreutils.html
      GEN      html-local
    sed: can't read doc/coreutils.html: No such file or directory
    make[1]: *** [Makefile:30153: html-local] Error 2

Since html-local does not have any dependencies.

Is the attached patch okay? I'm not sure if the substitution syntax will
cause portability issues.

Collin

>From ecc3b6a714a89231d06496c3855b5eebcebeacd5 Mon Sep 17 00:00:00 2001
Message-ID: <ecc3b6a714a89231d06496c3855b5eebcebeacd5.1765250212.git.collin.fu...@gmail.com>
From: Collin Funk <[email protected]>
Date: Mon, 8 Dec 2025 19:08:56 -0800
Subject: [PATCH] doc: html: fix build with parallel make

* doc/local.mk (html-local): Add html files to prerequisites so they are
generated before 'sed' is invoked.
---
 doc/local.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/local.mk b/doc/local.mk
index da5d21240..04cafef6f 100644
--- a/doc/local.mk
+++ b/doc/local.mk
@@ -135,7 +135,7 @@ check-local: check-texinfo
 # Post-process generated HTML to clean up anchor IDs
 _sed_anchor_cleanup = \
   -e '/id=.*_002doption/ { s/id="\([^"]*\)_002doption/id="\1/g; s/_002d/-/g; }'
-html-local:
+html-local: $(info_TEXINFOS:.texi=.html)
 	$(AM_V_GEN)htmlfile=$(info_TEXINFOS:.texi=.html); \
 	sed $(_sed_anchor_cleanup) $$htmlfile > $$htmlfile-t \
 	  && mv $$htmlfile-t $$htmlfile
-- 
2.52.0

Reply via email to