I use texi2pdf to generate pdf files from texinfo files using the command

texi2pdf myfile.texi

Am working on using a makefile for this and have written




all: ${pdf}

${pdf}: ${texi}
    texi2pdf $<

    rm -f ${pdf}

I could do with some help on the correct way to write the makefile and how to run it.

1 Answer 1


I would use a pattern rule:

PDFS := 06a-amcoh.pdf

all: $(PDFS)

%.pdf: %.texi
        texi2pdf $< -o $@

        rm -f $(PDFS)

This will work for any PDF you want to generate from a Texinfo file.

To run this:


will do (the first target is the default).

  • Thank you so very much. I have many directories with texi files. Does one usually have a makefile in each directory?
    – Pietru
    Commented Jun 27, 2021 at 16:12
  • There’s no general rule, it really depends on how you manage your project (or collections of files). Commented Jun 27, 2021 at 18:36
  • Would also like to have a rule for making html files with "texi2any -c HTML_MATH=mathjax --html myfile.texi"
    – Pietru
    Commented Jun 27, 2021 at 19:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .