From e48313580a9b11813700ebcd4560c8f7a5daa33e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Tue, 1 Jul 2008 07:16:31 +0000 Subject: [PATCH] Minor stylistic Boost Build quickbook.jam script changes. [SVN r46941] --- v2/tools/quickbook.jam | 50 ++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/v2/tools/quickbook.jam b/v2/tools/quickbook.jam index c1f1f2660..396cede75 100644 --- a/v2/tools/quickbook.jam +++ b/v2/tools/quickbook.jam @@ -113,6 +113,7 @@ import scanner ; import project ; import targets ; + # The one and only QUICKBOOK type! type.register QUICKBOOK : qbk ; @@ -121,15 +122,17 @@ type.register QUICKBOOK : qbk ; feature.feature : : free ; feature.feature : : free dependency ; + # quickbook-binary-generator handles generation of the QuickBook executable, by # marking it as a dependency for QuickBook docs. # # If the user supplied the QuickBook command that will be used. # -# Otherwise we search some sensible places for the QuickBook sources and -# compile from scratch using the default toolset. +# Otherwise we search some sensible places for the QuickBook sources and compile +# from scratch using the default toolset. # # As a last resort we rely on the shell to find 'quickbook'. +# class quickbook-binary-generator : generator { import common modules path targets build-system ; @@ -181,8 +184,8 @@ class quickbook-binary-generator : generator local quickbook-main-target = [ targets.resolve-reference $(quickbook-dir) : $(project) ] ; # The first element are actual targets, the second are - # properties found in target-id. We don't care about these since - # we've passed the id ourselves. + # properties found in target-id. We do not care about these + # since we have passed the id ourselves. quickbook-main-target = [ $(quickbook-main-target[1]).main-target quickbook ] ; @@ -192,10 +195,9 @@ class quickbook-binary-generator : generator # Ignore usage-requirements returned as first element. quickbook-binary-dependencies = $(quickbook-binary-dependencies[2-]) ; - # Some toolsets generate extra targets (e.g. RSP). - # We must mark all targets as dependencies for the project, but - # we'll only use the EXE target for quickbook-to-boostbook - # translation. + # Some toolsets generate extra targets (e.g. RSP). We must mark + # all targets as dependencies for the project, but we will only + # use the EXE target for quickbook-to-boostbook translation. for local target in $(quickbook-binary-dependencies) { if [ $(target).type ] = EXE @@ -225,8 +227,8 @@ class quickbook-binary-generator : generator ECHO " or site-config.jam with the call" ; ECHO " using quickbook : /path/to/quickbook ;" ; - # As a last resort, search for 'quickbook' command in path. - # Note that even if the 'quickbook' command is not found, + # As a last resort, search for 'quickbook' command in path. Note + # that even if the 'quickbook' command is not found, # get-invocation-command will still return 'quickbook' and might # generate an error while generating the virtual-target. @@ -234,8 +236,8 @@ class quickbook-binary-generator : generator } } - # Add $(quickbook-binary-dependencies) as a dependency of the current project - # and set it as the feature for the + # Add $(quickbook-binary-dependencies) as a dependency of the current + # project and set it as the feature for the # quickbook-to-boostbook rule, below. property-set = [ $(property-set).add-raw $(quickbook-binary-dependencies) @@ -247,7 +249,9 @@ class quickbook-binary-generator : generator } } -# Define a scanner for tracking QBK include dependencies + +# Define a scanner for tracking QBK include dependencies. +# class qbk-scanner : common-scanner { rule pattern ( ) @@ -258,10 +262,12 @@ class qbk-scanner : common-scanner } } + scanner.register qbk-scanner : include ; type.set-scanner QUICKBOOK : qbk-scanner ; + # Initialization of toolset. # # Parameters: @@ -270,8 +276,9 @@ type.set-scanner QUICKBOOK : qbk-scanner ; # When command is not supplied toolset will search for QuickBook directory and # compile the executable from source. If that fails we still search the path for # 'quickbook'. +# rule init ( - command ? # path to QuickBook executable. + command ? # path to the QuickBook executable. ) { if ! $(.initialized) @@ -281,13 +288,16 @@ rule init ( } } + generators.register [ new quickbook-binary-generator quickbook.quickbook-to-boostbook : QUICKBOOK : XML ] ; + # shell command to run QuickBook # targets to build QuickBook from sources. -toolset.flags quickbook.quickbook-to-boostbook QB-COMMAND ; -toolset.flags quickbook.quickbook-to-boostbook QB-DEPENDENCIES ; -toolset.flags quickbook.quickbook-to-boostbook INCLUDES ; +toolset.flags quickbook.quickbook-to-boostbook QB-COMMAND ; +toolset.flags quickbook.quickbook-to-boostbook QB-DEPENDENCIES ; +toolset.flags quickbook.quickbook-to-boostbook INCLUDES ; + rule quickbook-to-boostbook ( target : source : properties * ) { @@ -296,13 +306,15 @@ rule quickbook-to-boostbook ( target : source : properties * ) DEPENDS $(target) : [ on $(target) return $(QB-DEPENDENCIES) ] ; } + actions quickbook-to-boostbook { "$(QB-COMMAND)" -I"$(INCLUDES)" --output-file=$(1) $(2) } -# Declare a main target to convert a quickbook source into a boostbook -# XML file. + +# Declare a main target to convert a quickbook source into a boostbook XML file. +# rule to-boostbook ( target-name : sources * : requirements * : default-build * ) { local project = [ project.current ] ;