Boost logo

Boost-Build :

Subject: Re: [Boost-build] [Build] Extender Manual, Generators, Actions
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-04-20 23:23:07


AMDG

Lee Winter wrote:
> The Build Extender Manual gives examples and describes creating new
> file types. It gives examples and describes derived generators for
> new file types. And it gives examples of actions for new file types,
> but does not decribe them. Is there a written description for such
> actions?
>
> If there is no written description, can anyone provide information on
> the example in the manual? It is as follows:
>
> import type ;
> import generators ;
> type.register VERBATIM : verbatim ;
> generators.register-standard verbatim.inline-file : VERBATIM : CPP ;
> actions inline-file
> {
> "./inline-file.py" $(<) $(>)
> }
>
> The areas I'm seeking clarification of are as follow:
>
> 1. The manual states that "...the name of the action block should be
> specifed when creating targets."
>
> What targets are created in the above example?
>

The code that you've pasted in does not create any targets.
The verbatim.inline-file generator will be invoked when
Boost.Build needs to convert a verbatim file to a cpp file
as is shown at the bottom of
http://www.boost.org/boost-build2/doc/html/bbv2/extender.html

> 2. The manual states that "By convention, generators use the same
> name of the action block as their own id."
>
> In the example above, is the name of the generator
> "verbatim.inline-file" or "inline-file"? If the former what magic
> connects the generator name to the action named with a substring of
> the generator's name? Is the file type ("verbatim") automatically
> suppressed?
>

The name of the generator is verbatim.inline-file.
verbatim is the name of the module. (i.e. this code
goes in a file called verbatim.jam)

> 3. The construct "./inline-file.py" is not described in the manual.
> It appears to be the invocation of a python script named
> "inline-file". Is it? If so, what is the role of the leading "./"?
>

The contents of the action block are passed to the shell
after variable substitution.

> 4. If the shell command needs to invoke a filter program handling
> stdin and stdout pipes rather than a typical command-line program that
> takes file names as arguments, how should such a filter action be
> defined?
>

In Christ,
Steven Watanabe


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