[Top][All Lists]

[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: Tue, 9 May 2006 20:51:52 -0700 (PDT)

Thank you Paul!

Sorry for any confusions. Maybe I have not made myself
fully understood. I think I mean the same as your

>    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

I think in this sample, you mean when bar.o is
removed, the command "cc -o prog foo.o bar.o" will not
work to generate prog, since bar.o will not be remade
after deletion. Is it your points?

If it is, my question is that, according to the rule
in GNU make, intermediate file will be remade if they
are needed, so why in this case (it seems that prog's
dependency bar.o is needed) bar.o is not remade? I
think make treats bar.o in this case as a file not


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

> %% Lin George <address@hidden> writes:
>   lg> Why in the sample you made, when bar.o is
> deleted,
>   lg> then it will not be remade when we make prog
> again? I
>   lg> think the target prog needs bar.o and bar.o
> does not
>   lg> exist -- so it should be remade. Any rules
> mentioned
>   lg> in GNU make manual prevents it from being
> remade?
> ???!?!
> It's not remade because I declared it to be
> intermediate:
>   > prog: foo.o bar.o
>   > .INTERMEDIATE: foo.o bar.o
> And I did this because you asked why make didn't
> treat all targets in
> the way it treats intermediate targets, to avoid
> extra compilation:
>   lg> Another comment is that, I think the way how
> make deals with
>   lg> intermediate files is smarter than the way
> dealing with ordinary
>   lg> files -- by saving time of remaking
> unnecessary files. So, why
>   lg> make does not change the way dealing with
> ordinary file to the
>   lg> (smarter) way dealing with the intermediate
> file?
> I'm showing you how this wouldn't work.
> -- 
>  Paul D. Smith <address@hidden>          Find some
> GNU make tips at:
>  "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 

reply via email to

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