Re: User-configurable HTML splitting

Heime <[email protected]> Tue, 26 May 2026 13:02:25 +0000
Newsgroups gmane.comp.gnu.make.general
Message-ID <wP1-5rTz7YJQV_tBNSCKWAPfj4X31lhRVA-6I1tvPvWNJsSH-85Xe_iT2OtVPXL9XLWSidN5NgT5Svb6di1hBjKUq8-9G1-UnJiRFVxWsJo=@protonmail.com>
On Wednesday, May 27th, 2026 at 12:46 AM, Eli Zaretskii <[email protected]> wrot=
e:

> > Date: Tue, 26 May 2026 08:24:15 +0000
> > From: Heime <[email protected]>
> > Cc: "[email protected]" <[email protected]>
> >
> > On Monday, May 25th, 2026 at 12:30 AM, Heime <[email protected]=
m> wrote:
> >
> > >
> > > I want to include the ability for users to split by chapter,
> > > section, or node when outputting the html documentation.
> > >
> > > Variable OPTS is used as a general options not specific to html.
> > > With other html specific options stored in a different variable.
> > >
> > > makeinfo has the --split=3Dchapter, --split=3D section, and
> > > --split=3D node to do this.  How can I include this functionality
> > > for users of my makefile?
> > >
> > >
> > > opts =3D --force --enable-encoding -I ${srcdir}
> > > hmlopts =3D --split=3Dchapter # section, node
> > >
> > >
> > > srcs =3D ${srcdir}/antares.texi
> > >
> > > .PHONY: html
> > > html: ${hmldir}/antares.html
> > >
> > > .SECONDEXPANSION:
> > > $(hmldir)/antares.html: $(srcs) | $$(@D)
> > > =09makeinfo $(opts) --html -o $@ $<
> >
> >
> > I have included a split variable that the user can override.
> >
> > make -f antares.mk split=3D--split=3Dchapter html
> >
> > But it introduces the cumbersome `split=3D--split=3Dchapter'.
> > Any ideas upon how to simplify this with just the split
> > specification?
> >
> > Have seen that people override variables when calling a makefile,
> > meaning that the variable option override does not include the
> > starting --.
> >
> > Would like to include --split=3Dchapter as a valid option
> >
> > So I can use
> >
> > make -f antares.mk --split=3Dchapter html
> >
> > How can I do such a thing?
>=20
> You can do this:
>=20
>   make -f antares.mk SPLIT=3Dchapter html
>=20
> and in the Makefile say
>=20
>   makeinfo $(opts) --html --split=3D$(SPLIT) -o $@ $<

For an unspecified split, the above would be --split=3D

   makeinfo $(opts) --html --split=3D -o $@ $<

I would like to use a variable DECAL for the --split option,
so it will be completely empty if the option is not used.