2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-15 13:02:11 +00:00

New example.

[SVN r36614]
This commit is contained in:
Vladimir Prus
2007-01-06 14:37:52 +00:00
parent 30a325c70a
commit 00f62a1fee
3 changed files with 48 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
import common ;
import "class" : new ;
rule generate-example ( project name ? : property-set : sources * )
{
local result ;
for local s in $(sources)
{
#local ea = [ $(s).action ] ;
#local ep = [ $(ea).properties ] ;
# Create a new action, that takes the source target
# and runs 'common.copy' comamnd on it.
local a = [
new non-scanning-action $(s) : common.copy : $(property-set) ] ;
local source-name = [ $(s).name ] ;
# Create the target to represent the result of the action.
# The target has the name that was specified in Jamfile
# and passed here via the 'name' parameter,
# and the same type and project as the source.
result += [ new file-target $(name)
: [ $(s).type ]
: $(project)
: $(a) ] ;
}
return $(result) ;
}
generate a2 : a.cpp : <generating-rule>@generate-example ;

View File

@@ -0,0 +1,12 @@
This example shows the 'generate' rule, that
allows you to construct target using any arbitrary
set of transformation and commands.
The rule is similar to 'make' and 'notfile', but
unlike those, you can operate in terms of
Boost.Build 'virtual targets', which is more
flexible.
Please consult the docs for more explanations.

View File

@@ -0,0 +1,4 @@
int main()
{
}