[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: multiple/hidden targets again
From: |
Alexander Frink |
Subject: |
Re: multiple/hidden targets again |
Date: |
Wed, 22 Feb 2006 18:25:51 +0100 (CET) |
On Wed, 22 Feb 2006, John Graham-Cumming wrote:
> It's a feature/bug. Basically if you don't add the ; then Make thinks
> there are no commands associated with building foo.h and bar.h and so it
> doesn't check to see if they've been updated (which the were by the
> foobar rule). This means that the time stamps that GNU Make is keeping
> internally will not match what's on the disk.
Thanks for the detailed explanation.
IMHO, Make could be somewhat smarter.
In the debug output, it says:
Must remake target `foo.h'.
Successfully remade target file `foo.h'.
Here Make notices that foo.h is out of date, but has no rules to run.
In this case Make could have a look at the file's timestamp to see
if someone else has updated the file meanwhile.
I see no good reason to have a dependency chain like this otherwise.
I hope nobody ever adds the optimization to Make that an empty
command does nothing and therefore there is no need to stat the
file again. Given this, I am happy with adding a ; to the dependency.
As a wish, I would like to see a small section in the Make manual
explaining what to do in case of a rule that creates multiple targets
and cannot be written using patterns. I think this is not so uncommon.
And none of the solutions posted so far has mentioned the necessary ;.
Thanks,
Alex
--
Alexander Frink E-Mail: address@hidden
Institut fuer Physik Phone: +49-6131-3923391
Johannes-Gutenberg-Universitaet
D-55099 Mainz, Germany