help-make
[Top][All Lists]
Advanced

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

Re: multiple targets for a single command


From: Boris Kolpackov
Subject: Re: multiple targets for a single command
Date: Wed, 5 Oct 2005 07:06:12 +0000 (UTC)
User-agent: nn/6.6.5+RFC1522

Jonathan Baccash <address@hidden> writes:

> Some commands create more than one result, and make (3.81beta3)
> behaves funny when I try to account for this.  For example:
>
> #-------------
> a: b
>       touch a
>
> b: c
>
> c: d
>       touch c
>       touch b
> #-------------

There is nothing funny about this. The only way make can know what
you are updating in your command script is if you explicitly told
it so, e.g.:

c b: d
        touch $@

If you really need to update several targets at once (i.e., they cannot
be rewritten as separate rules) then you will need to use implicit rules
for this.


> Now, if file d exists, this works fine the first time.  But then I
> touch d and get weird results:
>
> $ touch d
> $ make
> touch c
> touch b
> $ make
> touch a
> $ make
> make: `a' is up to date.

As I said, there is nothing weird about this: you hid information from
make and as a result got an incomplete build.


hth,
-boris





reply via email to

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