Re: Setting makeinfo options

Gavin Smith <[email protected]> Fri, 26 Jun 2026 16:59:53 +0100
Newsgroups gmane.comp.tex.texinfo.general
Message-ID <aj6h-cHoRUORsyPq@orangestar>
On Tue, Jun 23, 2026 at 12:52:45AM +0000, Heime wrote:
> ----------------------------------------------------------------
> 
> I have been making a makefile to generate my package documentation,
> with ideas from the emacs documentation makefile.
> 
> How would one allow users to decide what options to use - for html
> for example?  Using variable hopc by appending makeinfo options 
> seems difficult, possibly wrong.

One way is to have a makefile variable, like MAKEINFO_HTML_OPTIONS,
which you use in the rule:

> $(hmldir)/antares.html: $(srcs) | $$(@D)
> 	makeinfo $(opts) --html $(MAKEFILE_HTML_OPTIONS) $(hopc) -o $@ $<

The user of the Makefile can then set this on the command line:

make anteres.html MAKEFILE_HTML_OPTIONS=whatever



> 
> 
> .PHONY: all-doc info html pdf dvi ps
> --all-doc: info html pdf dvi ps
> 
> ## [Syntax] targets: prerequisites
> info: ${infdir}/antares.info
> html: ${hmldir}/antares.html
> pdf: ${docdir}/antares.pdf
> dvi: ${docdir}/antares.dvi
> ps: ${docdir}/antares.ps
> 
> 
> hopc :=
> 
> ifneq ($(strip $(css)),)
> 	hopc += --css-include=$(css)
> endif
> 
> ifneq ($(strip $(css-ref)),)
> 	hopc += --css-ref=$(css-ref)
> endif
> 
> ifneq ($(strip $(links)),)
> 	hopc += --internal-links=$(links)
> endif
> 
> ifneq ($(strip $(split)),)
> 	hopc += --split=$(split)
> endif
> 
> ifneq ($(trlfn),)
> 	hopc += --transliterate-file-names
> endif
> 
> ifneq ($(ndf),)
> 	hopc += --node-files
> endif
> 
> .PHONY: trlfn ndf
> 
> trlfn:
> 	hopc += --transliterate-file-names
> 
> ndf:
> 	hopc += --node-files
> 
> .PHONY: split-chapter split-section split-node
> 
> split-chapter:
> 	split=--split=chapter
> 
> split-section:
> 	split=--split=section
> 
> split-node:
> 	split=--split=node
> 
> split-chapter split-section split-node: $(hmldir)/antares.html
> 
> $(hmldir)/antares.html: $(srcs) | $$(@D)
> 	makeinfo $(opts) --html $(hopc) -o $@ $<
> 
>