0

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

name=06a-amcoh

texi=${name}.texi

pdf=${name}.pdf

all: ${pdf}

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

clear:
    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

3

I would use a pattern rule:

PDFS := 06a-amcoh.pdf

all: $(PDFS)

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

clean:
        rm -f $(PDFS)

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

To run this:

make

will do (the first target is the default).

3
  • Thank you so very much. I have many directories with texi files. Does one usually have a makefile in each directory? 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" Commented Jun 27, 2021 at 19:02

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.