Thanks Paul!
> You're right, it does not make much sense to have > intermediate files > without any prerequisites. The only time the > intermediate file will be > rebuilt then is if the upper target doesn't exist; > in that case all the > intermediate files are considered out of date and > rebuilt. > > However, that's not how intermediate files are > generally used; they are > used to avoid rebuilding files "in between" the > ultimate target and the > source files. I think the complete rule when intermediate file will be remade should be, 1. dependent file is newer than ultimate target file; 2. upper file does not exist. Is that correct? About the incremental build, I do not think it will utilize intermediate files to achieve the function of incremental build, since I am using ar to generate static libraries, but I am not using intermediate files. :-) It seems that you mean if I use intermediate file together with ar, it will be more efficient or something? regards, George --- "Paul D. Smith" <[EMAIL PROTECTED]> wrote: > %% Lin George <[EMAIL PROTECTED]> writes: > > >> An ordinary target is updated if EITHER its > prerequisites are > >> newer, OR the target doesn't exist. > >> > >> An intermediate target is updated ONLY if its > prerequisites are > >> newer. > > lg> This is exactly what I am looking for. I > remembered > lg> that you have mentioned before intermediate > file is > lg> useful for increasement build or something. Is > that > lg> correct? > > Incremental builds; yes. Consider static libraries, > or archives > (libfoo.a). The ar program, that builds these > libraries, can add, > remove, and replace individual .o's inside an > already-existing archive. > > That means that if you have a libfoo.a that contains > foo.o, bar.o, and > baz.o you can replace just baz.o in the archive even > if foo.o and bar.o > don't exist. This makes it different from (most) > linkers, which require > ALL the objects to exist when the link is performed. > > There do exist "incremental linkers" but they are > rare these days: the > performance improvements have generally been > determined to not be worth > the added complexity in most cases. > > lg> I think if it is true, increasement build will > suffer from the > lg> issues of intermediate files -- they will not > be remade even if > lg> they are "needed", for example, the > intermediate files without any > lg> dependencies will suffer from this issue. I am > not sure why > lg> increasement build will choose intermediate > file. > > You're right, it does not make much sense to have > intermediate files > without any prerequisites. The only time the > intermediate file will be > rebuilt then is if the upper target doesn't exist; > in that case all the > intermediate files are considered out of date and > rebuilt. > > However, that's not how intermediate files are > generally used; they are > used to avoid rebuilding files "in between" the > ultimate target and the > source files. > > -- > ------------------------------------------------------------------------------- > 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
