amsantosr
amsantosr

Reputation: 11

What's wrong with this Makefile and LaTeX?

I am trying to use the following Makefile in order to compile a LaTeX project.

# LaTeX Makefile
FILE=Tesis
all: $(FILE).pdf
.PHONY: clean
clean:
        rm *.aux *.blg *.out *.bbl *.log *.dvi *.idx *.lof *.toc *.pdf
$(FILE).pdf: $(FILE).tex
$(FILE).tex: Generalidades.tex Analisis.tex Diseno.tex Construccion.tex Conclusiones.tex Tesis.bib
        latex $(FILE).tex
        bibtex $(FILE)
        latex $(FILE)
        dvipdfm $(FILE).dvi

The file Tesis.pdf doesn't exist. However after running make I get:

make: Nothing to be done for `all'

What is wrong? Thanks.

Upvotes: 0

Views: 62

Answers (1)

Norman Gray
Norman Gray

Reputation: 12514

Your dependency

$(FILE).pdf: $(FILE).tex

has no rule associated with it – it's missing a sequence of indented lines which tell make how to make the PDF from the .tex file. That means it'll always be up to date.

Your second dependency, on the other hand:

$(FILE).tex: Generalidades.tex Analisis.tex ...
    latex $(FILE).tex

says ‘$(FILE).tex depends on Generalidades.tex Analisis.tex ..., and to make it [ie, the .tex file] up to date, run latex’. That's not what you mean.

Try

$(FILE).pdf: $(FILE).tex Generalidades.tex Analisis.tex ...
    latex $(FILE).tex
    ...

(By the way, if you use pdflatex then you can generate a PDF file directly from the .tex source. You'll have to use .pdf figures rather than .eps ones, but it's easy to convert .eps figures to .pdf).

Upvotes: 1

Related Questions