Re: Dependency on object files

Bram Moolenaar <[email protected]> Thu, 26 Feb 2004 12:21:11 +0100
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
Lars Ivar Igesund wrote:

> Bram Moolenaar wrote:
> 
> > 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.
> 
> Ok, now I've tried this. I added
> foo : bar
> after
> :program foo : foo.d
> and this leads to aap trying to relink foo.exe when bar.lib has changed.
> The problem is that aap don't know that foo.exe is the result of some
> d files and thus needs to be linked with d_build -> build_dmd, and
> instead build_msvc is used. I suppose it is possible to specify the
> build action to use somehow, but stuff like
> :attr {buildaction = $D_BUILD_ACTION } foo
> don't work.

You should add the buildaction attribute the to the object file, not the
executable.  But that is only a workaround for the real problem.

This is similar to a problem I noticed with C++: The buildaction
attribute is added to an object file when it is compiled.  When the
building is to be done, the buildaction of all object files is checked
and used.  But if the object was not compiled then there is no
buildaction attribute.

This is a problem if building is done for another reason than the object
file having changed.  For example, when you delete the executable.

The solution should be that the buildaction attribute is added when the
dependency is setup, not when the action is invoked.  But that means we
need a new mechanism.  Does someone have an idea how this should be done?

-- 
GALAHAD:   Camelot ...
LAUNCELOT: Camelot ...
GAWAIN:    It's only a model.
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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