Boost logo

Boost-Build :

From: K. Noel Belcourt (kbelco_at_[hidden])
Date: 2006-09-20 17:53:18


On Sep 20, 2006, at 6:48 AM, Phillip Seaver wrote:

> K. Noel Belcourt wrote:
>> I'd like to invoke a bjam built executable in an actions.
> Here's something that I use. It may not be the best way to do things,
> but it works for me. :-)
>
> exe bin2c : bin2c.c ;
> make Splash.h : bin2c Splash.png : bin2c_run ;
> actions bin2c_run
> {
> $(>[1]) $(>[2-]) $(<)
> }
>
>
> The "make" command here creates Splash.h using bin2c and Splash.png as
> source files with bin2c_run as the commands to run. Since it's using
> the target "bin2c" as a source file, it has to build it first, so it
> compiles bin2c before trying to run it. :-)
>
> "actions bin2c_run" gets the full path of the bin2c executable as the
> first item in the source argument "$(>[1])" and uses the rest of the
> source arguments "$(>[2-])" and the output argument "$(<)" as the
> arguments to bin2c, so on Windows you get a command like:
>
> bin\msvc-7.1\debug\link-static\threading-multi\bin2c.exe
> Splash.png
> msvc-7.1\debug\link-static\threading-multi\Splash.h

It does help. The only thing I can't figure out is how to call an
actions from a rule. If I define a rule like your 'make' rule above,
how do I call the action from within the rule?

This is probably easy to do but I don't see how.

-- Noel


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk