From 8e3979e7b98b12330f7696dbb367b01e4c2ce0ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Sat, 5 Jan 2008 17:11:50 +0000 Subject: [PATCH] Corrected the used file suffix for the VERBATIM file type. Now the documentation is in sync with the 'customization' example. This also closes the Trac ticket 134. Minor stylistic changes. [SVN r42484] --- v2/doc/src/extending.xml | 54 +++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/v2/doc/src/extending.xml b/v2/doc/src/extending.xml index ff69e13a9..14460189b 100644 --- a/v2/doc/src/extending.xml +++ b/v2/doc/src/extending.xml @@ -37,30 +37,28 @@ - It's quite easy to achieve. You write special verbatim files - that are just C++, except that the very first line of the file - contains the name of a variable that should be generated. A simple tool - is created that takes a verbatim file and creates a cpp file with - a single char* variable whose name is taken from the first line - of the verbatim file and whose value is the file's properly quoted content. + It's quite easy to achieve. You write special verbatim files that are + just C++, except that the very first line of the file contains the name of a + variable that should be generated. A simple tool is created that takes a + verbatim file and creates a cpp file with a single char* variable + whose name is taken from the first line of the verbatim file and whose value + is the file's properly quoted content. Let's see what Boost.Build can do. - First off, Boost.Build has no idea about "verbatim files". So, - you must register a new target type. The following code does - it: + First off, Boost.Build has no idea about "verbatim files". So, you must + register a new target type. The following code does it: import type ; -type.register VERBATIM : vrb ; +type.register VERBATIM : verbatim ; - The first parameter to - type.register gives the name of the - declared type. By convention, it's uppercase. The second parameter - is the suffix for files of this type. So, if Boost.Build sees - code.vrb in a list of sources, it knows that it's of type - VERBATIM. + The first parameter to type.register gives + the name of the declared type. By convention, it's uppercase. The second + parameter is the suffix for files of this type. So, if Boost.Build sees + code.verbatim in a list of sources, it knows that it's of + type VERBATIM. Next, you tell Boost.Build that the verbatim files can be transformed into C++ files in one build step. A @@ -96,26 +94,26 @@ actions inline-file --> - Now, we're ready to tie it all together. Put all the code - above in file verbatim.jam, add import verbatim ; - to project-root.jam, and it's possible to write - the following in Jamfile: + Now, we're ready to tie it all together. Put all the code above in file + verbatim.jam, add import verbatim ; to + project-root.jam, and it's possible to write the + following in Jamfile: + exe codegen : codegen.cpp class_template.verbatim usage.verbatim ; - -The verbatim files will be automatically converted into C++ -and linked it. + The listed verbatim files will be automatically converted into C++, + compiled and then linked to the codegen executable. - In the subsequent sections, we will extend this example, and review - all the mechanisms in detail. The complete code is available in example/customization - directory. - - + In subsequent sections, we will extend this example, and review all the + mechanisms in detail. The complete code is available in the + example/customization directory. + +
Target types The first thing we did in the