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:
32
v2/example/generate/Jamroot
Normal file
32
v2/example/generate/Jamroot
Normal 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 ;
|
||||
12
v2/example/generate/REAME.txt
Normal file
12
v2/example/generate/REAME.txt
Normal 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.
|
||||
|
||||
4
v2/example/generate/a.cpp
Normal file
4
v2/example/generate/a.cpp
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user