tech-toolchain archive

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

Re: question

On Mon, 6 Jun 2011, David Laight wrote:

> On Mon, Jun 06, 2011 at 04:41:49PM -0400, der Mouse wrote:
> >
> > a.c b.c:
> >     echo 'int foo;' > a.c
> >     echo 'int foo;' > b.c
> >
> > You'll find - well, I find, at least - that it runs the command set
> > only once.
> Only because make does a second scan of the file timestamps just before
> running the commands to double-check that no other rules have
> recreated the target already.

yes, but does the rule say that it makes 'a.c AND b.c' or 'a.c OR b.c'?
The only way to know is to look at the instructions, which make does not
do (quite rightly, it is complex shell script and the result is not always
simply expressed) and I believe that this syntax means OR, consider

a.c b.c:
        echo 'int foo;' > $@

which would do as expected to make 'a.c OR b.c'..

> Quite possibly this 'optimisation' needs to be disabled...

it is not a problem with our make alone, it is a problem with the syntax
which does not have any way to indicate that more than one file is created
by the instructions.


Home | Main Index | Thread Index | Old Index