help-make
[Top][All Lists]
Advanced

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

Re: question about Generating Prerequisites Automatically


From: Lin George
Subject: Re: question about Generating Prerequisites Automatically
Date: Thu, 11 May 2006 00:15:25 -0700 (PDT)

Thank you Paul!


> So, make uses one set of rules to determine when to
> rebuild normal
> targets (that are not "intermediate"), and it uses a
> different set of
> rules to determine when to rebuild targets that ARE
> "intermediate".

That is exactly what I mean. :-)

Could you quote the rule which make will use to
evaluate whether an intermediate file is "needed"
please? I understand your sample, but it still seems
mysterious to me about a general rule about how make
will evaluate whether or not it is "needed". :-)


have a nice day,
George

--- "Paul D. Smith" <address@hidden> wrote:

> %% Lin George <address@hidden> writes:
> 
>   >> prog: foo.o bar.o
>   >> 
>   >> .INTERMEDIATE: foo.o bar.o
>   >> 
>   >> Now, we run make:
>   >> 
>   >> cc -o foo.o -c foo.c
>   >> cc -o bar.o -c bar.c
>   >> cc -o prog foo.o bar.o
>   >> 
>   >> cc -o prog foo.o bar.o
>   >> cc: no such file or directory: bar.o
> 
>   lg> I think in this sample, you mean when bar.o is
> removed, the
>   lg> command "cc -o prog foo.o bar.o" will not work
> to generate prog,
>   lg> since bar.o will not be remade after deletion.
> Is it your points?
> 
> Yes.
> 
>   lg> If it is, my question is that, according to
> the rule in GNU make,
>   lg> intermediate file will be remade if they are
> needed, so why in
>   lg> this case (it seems that prog's dependency
> bar.o is needed) bar.o
>   lg> is not remade? I think make treats bar.o in
> this case as a file
>   lg> not needed?
> 
> No, not at all.  As I explained in a previous
> message, by declaring a
> file to be intermediate you are CHANGING make's
> definition of "needed"
> for that target.  That's what the "intermediate"
> flag DOES.
> 
> So, make uses one set of rules to determine when to
> rebuild normal
> targets (that are not "intermediate"), and it uses a
> different set of
> rules to determine when to rebuild targets that ARE
> "intermediate".
> 
> 
> You suggested that make should treat all targets as
> "intermediate", but
> it can't do that because the rules for rebuilding
> intermediate targets
> aren't appropriate for all situations: I gave you an
> example of such a
> situation.
> 
> 
> Maybe it would help your understanding if you tried
> to write down, in
> simple, detailed terms, exactly how make should
> determine whether a
> target is "needed" or not.
> 
> -- 
>
-------------------------------------------------------------------------------
>  Paul D. Smith <address@hidden>          Find some
> GNU make tips at:
>  http://www.gnu.org                     
> http://make.paulandlesley.org
>  "Please remain calm...I may be mad, but I am a
> professional." --Mad Scientist
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




reply via email to

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