diff --git a/v2/doc/src/extending.xml b/v2/doc/src/extending.xml index 7d3bf416c..05da0aad1 100644 --- a/v2/doc/src/extending.xml +++ b/v2/doc/src/extending.xml @@ -128,17 +128,39 @@ type.register VERBATIM : verbatim ; are the name of new type and the list of extensions associated with it. A file with an extension from the list will have the given target type. In the case where a target of the declared type is generated - from other sources, the first specified extension will be used. This - behaviour can be changed using the - type.set-generated-target-suffix rule. + from other sources, the first specified extension will be used. - - Something about 'main' types. - + Sometimes you want to change the suffix used for generated targets + depending on build properties, such as toolset. For example, some compiler + uses extension elf for executable files. You can use the + type.set-generated-target-suffix rule: + +type.set-generated-target-suffix EXE : <toolset>elf : elf ; + + - Something about base types. - + A new target type can be inherited from an existing one. + +type.register PLUGIN : : SHARED_LIB ; + + The above code defines a new type derived from + SHARED_LIB. Initially, the new type inherits all the + properties of the base type - in particular generators and suffix. + Typically, you'll change the new type in some way. For example, using + type.set-generated-target-suffix you can set the suffix for + the new type. Or you can write special generator for the new type. For + example, it can generate additional metainformation for plugin. + In either way, the PLUGIN type can be used whenever + SHARED_LIB can. For example, you can directly link plugins + to an application. + + + A type can be defined as "main", in which case Boost.Build will + automatically declare a main target rule for building targets of that + type. More details can be found later. +
Scanners @@ -185,7 +207,6 @@ type.set-scanner VERBATIM : verbatim-scanner ;
-
@@ -636,10 +657,11 @@ glib codegen ; - The second approach is suitable when your target rule should just - produce a target of specific type. Then, when declaring a type you - should tell Boost.Build that a main target rule should be created. - For example, if you create a module "obfuscate.jam" containing: + The second approach is suitable + when your target rule should just produce a target of specific + type. Then, when declaring a type you should tell Boost.Build that a + main target rule should be created. For example, if you create a module + "obfuscate.jam" containing: import type ;