help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Overriding implicit rules


From: Joel J. Adamson
Subject: Overriding implicit rules
Date: Fri, 07 May 2010 10:35:26 -0400

<#secure method=pgpmime mode=sign>
Dear help-make,

I have a Makefile for building a LaTeX project (see attached) and I
would like to run LaTeX as many times as necessary to get all citations
and cross-references correct.  When I pass -r to make on the
command-line, I get the desired behavior.  However, when I just run

# make -k pdf

or

# make -k dvi

I get only one run of LaTeX.  I have specified my own pattern rules, and
tried renaming the implicit command $(TEX), but all that does is one run
my desired LaTeX with flags.  Without renaming $(TEX), I get the "tex"
command, which is not what I want.

Is there any way to specify *in the Makefile* that I want make to run
*my* commands?  Just specifying the commands is not working.

GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
[...]
This program built for x86_64-redhat-linux-gnu

pdfTeX 3.1415926-1.40.10-2.2 (TeX Live 2009)
kpathsea version 5.0.0
Copyright 2009 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
[...]

Thanks!

Joel

-- 
Joel J. Adamson
Servedio Lab
University of North Carolina at Chapel Hill

FSF Member #8164
http://www.unc.edu/~adamsonj
# Variables
BASE = foo
TEXINPUTS = .:..:
TEXMFHOME = ../texmf
TEXPICTS = $(TEXMFHOME)/tex/generic/images
TEXENV = TEXMFHOME=$(TEXMFHOME) TEXINPUTS=$(TEXINPUTS)  \
        TEXPICTS=$(TEXPICTS)
STYLE = tex/latex/local
LATEXMLPATH = --path=$(TEXMFHOME)/$(STYLE)

# Commands
LATEXFLAGS = -interaction=nonstopmode "\input"
TEX = $(TEXENV) /usr/bin/latex $(LATEXFLAGS)
LATEX = $(TEX)
BIBTEX = $(TEXENV) /usr/bin/bibtex
BIBPATH = $(TEXMFHOME)/bibtex/bib/
DVIPS = $(TEXENV) /usr/bin/dvips
DVIPSFLAGS = -f
RM = /bin/rm
RMFLAGS = -f -v

# files to clean out
TOCLEAN = *.dvi *.pdf *.ps *.out *.log *.nav *.snm \
        *.html *.xml *.blg *.aux *.bbl
all: dvi pdf html
pdf: foo.pdf
dvi: foo.dvi
html: foo.html

%.aux: %.tex
        $(LATEX) $<

%.bbl: %.aux
        $(BIBTEX) $*

%.dvi: %.tex %.bbl %.aux 
        $(LATEX) $<
        $(LATEX) $<

%.ps: %.dvi 
        $(DVIPS) $(DVIPSFLAGS) $< > $@

%.pdf: %.ps
        ps2pdf $^

%.xml: %.tex 
        latexml $(LATEXMLPATH) \
                --destination=$(BASE).xml $<
        latexml  $(LATEXMLPATH) --bibtex \
                --destination=$(BASE).bib.xml $(BIBPATH)/foo.bib

%.html: %.xml 
        latexmlpost --bibliography=$(BASE).bib.xml \
                --destination=$(BASE).xhtml $(BASE).xml

.PHONY: clean
clean:
        $(RM) $(RMFLAGS) $(TOCLEAN)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]