Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80510 - in trunk/tools/build/v2: build tools
From: jurko.gospodnetic_at_[hidden]
Date: 2012-09-13 01:38:22


Author: jurko
Date: 2012-09-13 01:38:21 EDT (Thu, 13 Sep 2012)
New Revision: 80510
URL: http://svn.boost.org/trac/boost/changeset/80510

Log:
Boost Build cleanup - minor stylistic changes (copyright comment updates, removed redundant imports, split module imports to separate lines, used cleaner targets.jam module helper rules for constructing main target alternatives, allowed notfile generators to take more than 9 constructor parameters, lines wrapped to 80 characters).
Text files modified:
   trunk/tools/build/v2/build/property-set.jam | 6 ++--
   trunk/tools/build/v2/build/targets.jam | 11 +++++----
   trunk/tools/build/v2/tools/make.jam | 25 +++++++----------------
   trunk/tools/build/v2/tools/notfile.jam | 41 +++++++++++++++------------------------
   4 files changed, 33 insertions(+), 50 deletions(-)

Modified: trunk/tools/build/v2/build/property-set.jam
==============================================================================
--- trunk/tools/build/v2/build/property-set.jam (original)
+++ trunk/tools/build/v2/build/property-set.jam 2012-09-13 01:38:21 EDT (Thu, 13 Sep 2012)
@@ -1,7 +1,8 @@
 # Copyright 2003 Dave Abrahams
 # Copyright 2003, 2004, 2005, 2006 Vladimir Prus
 # Distributed under the Boost Software License, Version 1.0.
-# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
 
 import "class" : new ;
 import feature ;
@@ -237,8 +238,7 @@
             }
             else
             {
- local p = [ as-path ] ;
- p = [ property-set.hash-maybe $(p) ] ;
+ local p = [ property-set.hash-maybe [ as-path ] ] ;
 
                 # A real ugly hack. Boost regression test system requires
                 # specific target paths, and it seems that changing it to handle

Modified: trunk/tools/build/v2/build/targets.jam
==============================================================================
--- trunk/tools/build/v2/build/targets.jam (original)
+++ trunk/tools/build/v2/build/targets.jam 2012-09-13 01:38:21 EDT (Thu, 13 Sep 2012)
@@ -1109,8 +1109,8 @@
     import targets ;
     import virtual-target ;
 
- rule __init__ ( name : project : sources * : requirements *
- : default-build * : usage-requirements * )
+ rule __init__ ( name : project : sources * : requirements * :
+ default-build * : usage-requirements * )
     {
         abstract-target.__init__ $(name) : $(project) ;
 
@@ -1217,8 +1217,8 @@
     # The results are added to the variable called 'result-var'. Usage
     # requirements are added to the variable called 'usage-requirements-var'.
     #
- rule generate-dependencies ( dependencies * : property-set
- : result-var usage-requirements-var )
+ rule generate-dependencies ( dependencies * : property-set : result-var
+ usage-requirements-var )
     {
         for local dependency in $(dependencies)
         {
@@ -1376,7 +1376,8 @@
                 # - it is not clear if that is a good idea anyway. The alias
                 # target, for example, should not fail to build if a
                 # dependency fails.
- self.generated.$(property-set) = [ property-set.create <build>no ] ;
+ self.generated.$(property-set) = [ property-set.create <build>no
+ ] ;
             }
         }
         else

Modified: trunk/tools/build/v2/tools/make.jam
==============================================================================
--- trunk/tools/build/v2/tools/make.jam (original)
+++ trunk/tools/build/v2/tools/make.jam 2012-09-13 01:38:21 EDT (Thu, 13 Sep 2012)
@@ -3,23 +3,22 @@
 # Copyright 2006 Rene Rivera
 # Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus
 # Distributed under the Boost Software License, Version 1.0.
-# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
 
-# This module defines the 'make' main target rule.
+# This module defines the 'make' main target rule.
 
 import "class" : new ;
-import errors : error ;
 import project ;
-import property ;
 import property-set ;
-import regex ;
 import targets ;
 
 
 class make-target-class : basic-target
 {
- import type regex virtual-target ;
     import "class" : new ;
+ import type ;
+ import virtual-target ;
 
     rule __init__ ( name : project : sources * : requirements *
         : default-build * : usage-requirements * )
@@ -48,8 +47,6 @@
 rule make ( target-name : sources * : generating-rule + : requirements * :
     usage-requirements * )
 {
- local project = [ project.current ] ;
-
     # The '@' sign causes the feature.jam module to qualify rule name with the
     # module name of current project, if needed.
     local m = [ MATCH ^(@).* : $(generating-rule) ] ;
@@ -57,15 +54,9 @@
     {
         generating-rule = @$(generating-rule) ;
     }
- requirements += <action>$(generating-rule) ;
-
- targets.main-target-alternative
- [ new make-target-class $(target-name) : $(project)
- : [ targets.main-target-sources $(sources) : $(target-name) ]
- : [ targets.main-target-requirements $(requirements) : $(project) ]
- : [ targets.main-target-default-build : $(project) ]
- : [ targets.main-target-usage-requirements $(usage-requirements) :
- $(project) ] ] ;
+ targets.create-metatarget make-target-class : [ project.current ] :
+ $(target-name) : $(sources) : $(requirements) <action>$(generating-rule)
+ : : $(usage-requirements) ;
 }
 
 

Modified: trunk/tools/build/v2/tools/notfile.jam
==============================================================================
--- trunk/tools/build/v2/tools/notfile.jam (original)
+++ trunk/tools/build/v2/tools/notfile.jam 2012-09-13 01:38:21 EDT (Thu, 13 Sep 2012)
@@ -1,8 +1,7 @@
-# Copyright (c) 2005 Vladimir Prus.
-#
-# Use, modification and distribution is subject to the Boost Software
-# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
-# http://www.boost.org/LICENSE_1_0.txt)
+# Copyright (c) 2005 Vladimir Prus.
+# Distributed under the Boost Software License, Version 1.0.
+# (See accompanying file LICENSE_1_0.txt or copy at
+# http://www.boost.org/LICENSE_1_0.txt)
 
 import "class" : new ;
 import generators ;
@@ -19,28 +18,26 @@
 {
     rule __init__ ( * : * )
     {
- generator.__init__ $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8) : $(9) ;
+ generator.__init__ $(1) : $(2) : $(3) : $(4) : $(5) : $(6) : $(7) : $(8)
+ : $(9) : $(10) : $(11) : $(12) : $(13) : $(14) : $(15) : $(16) :
+ $(17) : $(18) : $(19) ;
     }
 
     rule run ( project name ? : property-set : sources * : multiple ? )
     {
         local action ;
         local action-name = [ $(property-set).get <action> ] ;
-
         local m = [ MATCH ^@(.*) : $(action-name) ] ;
-
         if $(m)
         {
- action = [ new action $(sources) : $(m[1])
- : $(property-set) ] ;
+ action = [ new action $(sources) : $(m[1]) : $(property-set) ] ;
         }
         else
         {
- action = [ new action $(sources) : notfile.run
- : $(property-set) ] ;
+ action = [ new action $(sources) : notfile.run : $(property-set) ] ;
         }
- return [ virtual-target.register
- [ new notfile-target $(name) : $(project) : $(action) ] ] ;
+ local t = [ new notfile-target $(name) : $(project) : $(action) ] ;
+ return [ virtual-target.register $(t) ] ;
     }
 }
 
@@ -57,18 +54,12 @@
 }
 
 
-rule notfile ( target-name : action + : sources * : requirements * : default-build * )
+rule notfile ( target-name : action + : sources * : requirements * :
+ default-build * )
 {
- local project = [ project.current ] ;
-
- requirements += <action>$(action) ;
-
- targets.main-target-alternative
- [ new typed-target $(target-name) : $(project) : NOTFILE_MAIN
- : [ targets.main-target-sources $(sources) : $(target-name) ]
- : [ targets.main-target-requirements $(requirements) : $(project) ]
- : [ targets.main-target-default-build $(default-build) : $(project) ]
- ] ;
+ targets.create-typed-target NOTFILE_MAIN : [ project.current ] :
+ $(target-name) : $(sources) : $(requirements) <action>$(action) :
+ $(default-build) ;
 }
 
 IMPORT $(__name__) : notfile : : notfile ;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk