help-make
[Top][All Lists]
Advanced

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

Pattern and explicit prerequisites in one rule not mixable?


From: Frank Winter
Subject: Pattern and explicit prerequisites in one rule not mixable?
Date: Wed, 17 Feb 2010 09:46:42 +0100 (CET)
User-agent: Alpine 2.00 (LRH 1167 2008-08-23)

Hi!

I issued this some days ago. Now I boiled the problem down to a very simple makefile example. It seems to me that to a pattern rule one can not add an explicit prerequiste. Take a look at this:


%.eps:
        touch $@

%.dvi: %.tex e.eps
        latex $<

%.pdf: %.dvi
        dvipdf $<


and say we have a file "some.tex" in the current directory:


% ls
Makefile some.tex


Then "make some.pdf" will not see the implicit rule for making the target some.pdf:


% make -n some.pdf
tex some.tex
dvipdf some.dvi
rm some.dvi


As you can see, "tex" was invoked, instead of "latex". A built-in rule was applied.

Now, lets make forget all the built-in rules, with putting an .SUFFIXES: in front:



.SUFFIXES:

%.eps:
        touch $@

%.dvi: %.tex e.eps
        latex $<

%.pdf: %.dvi
        dvipdf $<



And repeat:



% make -n some.pdf
touch e.eps
latex some.tex
dvipdf some.dvi
rm some.dvi e.eps


We see, it works. "latex" gets called - as supposed.

For some reason, make prefers to apply a built-in rule rather than the "mixed" implicit-explicit rule.

Is this a bug or a feature?

Frank





reply via email to

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