[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug or correct behavior?
From: |
Paul Smith |
Subject: |
Re: Bug or correct behavior? |
Date: |
Tue, 05 Feb 2008 16:31:56 -0500 |
On Tue, 2008-02-05 at 13:22 -0800, Derek Clegg wrote:
> I responded to Mike Shal in a similar vein. If you're correct,
> changing the order of the "dir/%.c:" lines would change the behavior,
> but it doesn't appear to.
Mike's comment is right on the money: this:
dir/%.c : foo.h
does NOT declare a pattern rule. It _deletes_ a pattern rule; check the
GNU make manual: pattern rules with no commands delete that rule.
If you wrote it like this:
dir/%.c : foo.h ; @echo do something
and put it before the other rule (and if foo.h existed or could be
created... remember the manual says "first _applicable_ rule" and a rule
with a prerequisite that make doesn't know how to build is not
applicable) then you'd get "do something" as output.
If you don't, then THAT'S a bug.
Cheers!
--
-----------------------------------------------------------------------------
Paul D. Smith <address@hidden> http://make.mad-scientist.us
"Please remain calm--I may be mad, but I am a professional."--Mad Scientist