On Wednesday, May 27th, 2026 at 12:46 AM, Eli Zaretskii <[email protected]> wrote:

> > 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]> 
> > 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=chapter, --split= section, and
> > > --split= node to do this.  How can I include this functionality
> > > for users of my makefile?
> > >
> > >
> > > opts = --force --enable-encoding -I ${srcdir}
> > > hmlopts = --split=chapter # section, node
> > >
> > >
> > > srcs = ${srcdir}/antares.texi
> > >
> > > .PHONY: html
> > > html: ${hmldir}/antares.html
> > >
> > > .SECONDEXPANSION:
> > > $(hmldir)/antares.html: $(srcs) | $$(@D)
> > >   makeinfo $(opts) --html -o $@ $<
> >
> >
> > I have included a split variable that the user can override.
> >
> > make -f antares.mk split=--split=chapter html
> >
> > But it introduces the cumbersome `split=--split=chapter'.
> > 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=chapter as a valid option
> >
> > So I can use
> >
> > make -f antares.mk --split=chapter html
> >
> > How can I do such a thing?
> 
> You can do this:
> 
>   make -f antares.mk SPLIT=chapter html
> 
> and in the Makefile say
> 
>   makeinfo $(opts) --html --split=$(SPLIT) -o $@ $<

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

   makeinfo $(opts) --html --split= -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.


Reply via email to