Re: Dependency on object files

Bram Moolenaar <[email protected]> Wed, 25 Feb 2004 19:49:51 +0100
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
Lars Ivar Igesund wrote:

> It seems to me that if I have
> 
> :program foo : foo.d,
> 
> then foo.exe only depends on foo.d and not foo.obj. Is this
> the case? I have a situation where foo.d is recompiled because
> one of it's dependencies (in bar.lib) changed. But because
> foo.d didn't change, foo.exe isn't rebuilt from the new
> foo.obj and thus the executable don't reflect the changes.
> 
> I'd like to fix this myself but I'm not really sure where this
> fits.

In this situation foo.d is compiled to foo.obj and then linked to
foo.exe.  That means there are two dependencies: foo.obj depends on
foo.d and foo.exe depends on foo.obj.

When foo.d is compiled and the resulting foo.obj is equal to the
previous version, there does not appear to be a reason to link foo.obj
to foo.exe, thus this doesn't happen.  This is most useful if you only
change a comment in foo.d.

I don't see where the depencency on bar.lib comes in.  If foo.obj
doesn't change when bar.lib changes, that probably means foo.obj doesn't
depend on it.

Aap doesn't automatically add a dependency for items in $LIBS.  If you
do want to rebuild foo.exe when a library changes, you need to add that
dependency in the recipe.

I don't see a way to do this automatically, without the result that
installing a new library always forces linking, even when you don't want
this.  Although we could do it that way, if nobody cares about
recompiling when a (system) library changed.

-- 
hundred-and-one symptoms of being an internet addict:
266. You hear most of your jokes via e-mail instead of in person.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click