diff --git a/v2/example/generate/Jamroot b/v2/example/generate/Jamroot new file mode 100644 index 000000000..b179e7d19 --- /dev/null +++ b/v2/example/generate/Jamroot @@ -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 : @generate-example ; \ No newline at end of file diff --git a/v2/example/generate/REAME.txt b/v2/example/generate/REAME.txt new file mode 100644 index 000000000..e4e9e9781 --- /dev/null +++ b/v2/example/generate/REAME.txt @@ -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. + diff --git a/v2/example/generate/a.cpp b/v2/example/generate/a.cpp new file mode 100644 index 000000000..42187a0de --- /dev/null +++ b/v2/example/generate/a.cpp @@ -0,0 +1,4 @@ + +int main() +{ +}