Re: Creating/using precompiled headers and static libraries

Bram Moolenaar <[email protected]> Thu, 06 May 2004 20:37:00 +0200
Newsgroups gmane.comp.tools.aap.user
Message-ID <[email protected]>
Thore Karlsen wrote:

> [printing message before a build]
> 
> >If it is just a matter of giving a message we could support an attribute
> >"buildmessage" that is printed when the target is being build.
> >
> >A more flexible approach would be to have "pre" and "post" build
> >commands.  But that might get complicated.  Aap already offers so many
> >mechanisms, adding more will make it even more complex.
> 
> Again, less complications is better, but I must admit these would be
> nice. They could be used for things like build timing as well, which I
> would love to have. Probably not something to spend a lot of time on at
> this point, but perhaps it could be considered down the road if it's not
> too complex.
> 
> I ended up faking a pre-build command like this:
> 
> DSBaseClasses_start {virtual} :
>    :print *** $target
> $BDIR/DSBaseClasses.lib : DSBaseClasses_start

Ah, that is a good way to do it now.

I think SCons does allow defining post- and pre- actions.  Can't find it
in their documentation right now...  They must have had a reason to
support that.

We could use fake dependencies, for example on "update-start" and
"update-end".

	$BDIR/DSBaseClasses.lib : update-start
		:print *** $target

I'm not sure if this is a good way to do it.  Should at least handle the
situation that you actually have a file by that name.  Perhaps an
explicit command would be better:

	:before update $BDIR/DSBaseClasses.lib
		:print *** building $target
	:after update $BDIR/DSBaseClasses.lib
		:print *** $target has been build

We could also have ":before use" and ":after use" to execute commands
before/after a file is used as a source.

Or use attributes that specify an action:

	:attr $BDIR/DSBaseClasses.lib {before-update-action = startbuild}

	:action startbuild
		:print *** building $source

Yet another solution would be to allow multiple dependencies with build
commands for a target, and indicating in what order they should be
executed.  However, this doesn't take care of the list of files the
target depends on, may lead to duplication.

-- 
hundred-and-one symptoms of being an internet addict:
139. You down your lunch in five minutes, at your desk, so you can
     spend the rest of the hour surfing the Net.

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


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3