Thanks Paul,
Why in the sample you made, when bar.o is deleted, then it will not be remade when we make prog again? I think the target prog needs bar.o and bar.o does not exist -- so it should be remade. Any rules mentioned in GNU make manual prevents it from being remade? regards, George --- "Paul D. Smith" <[EMAIL PROTECTED]> wrote: > %% Lin George <[EMAIL PROTECTED]> writes: > > 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? > > Very simple: it often is not at all what you want. > > Consider what happens: > > 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 > > Since there's no "prog" everything is out of date. > So far so good. > Now, we delete bar.o... uh oh! > > cc -o prog foo.o bar.o > cc: no such file or directory: bar.o > > > Intermediate files ONLY work with targets that can > be _incrementally > built_, or which are built from only one source. > Things like libraries, > where the "ar" program can add new objects to an > archive without > recreating it from scratch, are good examples of > this. Or, copying > files from a staging area into a production area, > where each file is > managed individually. > > > If the target needs all the prerequisites to exist > at once, like a > linker, then intermediate files don't work. > > -- > ------------------------------------------------------------------------------- > Paul D. Smith <[EMAIL PROTECTED]> 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 _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
