help-make
[Top][All Lists]
Advanced

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

Re: intermediate files


From: ali hagigat
Subject: Re: intermediate files
Date: Sun, 24 Oct 2010 02:19:50 -0800

There are some ambiguities in the explanation of, 10.4 Chains of Implicit Rules:
------------------------------------------------------------------------------------------------------
The first difference is what happens if the intermediate file does not
exist. If an ordinary
file b does not exist, and make considers a target that depends on b,
it invariably creates b
and then updates the target from b. But if b is an intermediate file,
then make can leave well
enough alone. It won’t bother updating b, or the ultimate target,
unless some prerequisite
of b is newer than that target or there is some other reason to update
that target.
------------------------------------------------------------------------------------------------------
"...can leave well enough alone..", Who is alone?

Nice and short explanation came from Oleksandr Gavenko, when he added:
In "Chains of Implicit Rules" all intermediate files by default removed.

Here I repeat his example again:

> %.c: %.c.in
>         cp $<  $@
>
> %.o: %.c
>         cp $<  $@
>
>    $ echo hello>my.c.in
>    $ make my.o
> cp my.c.in my.c
> cp my.c my.o
> rm my.c     #   THAT IS?

So 'my.c' does not exist and it is an intermediate file. But its
prerequisite is not newer than my.c because we created it by: "echo
hello>my.c.in"
So the manual says: "It won’t bother updating b...", (by the way it
won't bother updating b or it won't update b!!, because understanding
the word 'bother' is another barrier I think in this critical moment
of understanding the logic!)
But why in the result of our example, we have: "cp my.c.in my.c" or
my.c has been updated!!

> Date: Thu, 21 Oct 2010 08:59:56 -0400
> From: Paul Smith <address@hidden>
> Oleksandr's explanation and example look fine to me; I have nothing to add.

> From: Oleksandr Gavenko<address@hidden>
> Subject: Re: intermediate files
> Content-Type: text/plain; charset=UTF-8; format=flowed
>Please don't put email address in message body (this cause growing spam).

Dear Oleksandr Gavenko, thank you so much for your clear explanations
but when you send an email to a mailing list, as far as I know every
member will receive your email address, besides all messages are
archived, so if any one wants to spam he can do it easily. Though i
have never received any spam so far. I wish you all the best any way.

Date: Thu, 21 Oct 2010 10:36:42 +0100
From: Noel David Torres Ta?o <address@hidden>
Subject: Re: intermediate files
> Can't you read the simplest Makefile?
Are you sure you understand the details of the manual make?



reply via email to

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