Re: intermediate files

From:

Eli Zaretskii

Subject:

Re: intermediate files

Date:

Sun, 24 Oct 2010 07:03:35 -0400

> Date: Sun, 24 Oct 2010 02:19:50 -0800
> From: ali hagigat <address@hidden>
>
> 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?
This is a frequently used English idiom. "Leave something alone"
means not to touch it in any way. In this case, it means Make will
not try to create B if it is an intermediate file that does not exist.
> 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!
It won't update it. Again, "won't bother doing something" means
"won't do it".
> But why in the result of our example, we have: "cp my.c.in my.c" or
> my.c has been updated!!
Because in this case Make needs my.c to create my.o. my.o is _not_ an
intermediate file. This is explained in the following part of the
manual which you cited:
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.
Note the last part: "or there is some other reason". In this case,
the reason is that my.c is needed to get to my.o.