From f4fad1a46f94ed0d2c8f6ae2d506ea4402bdc077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jurko=20Gospodneti=C4=87?= Date: Thu, 13 Sep 2012 05:38:21 +0000 Subject: [PATCH] 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). [SVN r80510] --- src/build/property-set.jam | 6 +++--- src/build/targets.jam | 11 +++++----- src/tools/make.jam | 25 ++++++++--------------- src/tools/notfile.jam | 41 +++++++++++++++----------------------- 4 files changed, 33 insertions(+), 50 deletions(-) diff --git a/src/build/property-set.jam b/src/build/property-set.jam index 29e5c5a7f..58d53c4fd 100644 --- a/src/build/property-set.jam +++ b/src/build/property-set.jam @@ -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 @@ class property-set } 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 diff --git a/src/build/targets.jam b/src/build/targets.jam index d9be4c7e6..5afcd73e7 100644 --- a/src/build/targets.jam +++ b/src/build/targets.jam @@ -1109,8 +1109,8 @@ class basic-target : abstract-target 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 @@ class basic-target : abstract-target # 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 @@ class basic-target : abstract-target # - 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 no ] ; + self.generated.$(property-set) = [ property-set.create no + ] ; } } else diff --git a/src/tools/make.jam b/src/tools/make.jam index 085672857..40b59faf3 100644 --- a/src/tools/make.jam +++ b/src/tools/make.jam @@ -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 @@ class make-target-class : basic-target 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 @@ rule make ( target-name : sources * : generating-rule + : requirements * : { generating-rule = @$(generating-rule) ; } - requirements += $(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) $(generating-rule) + : : $(usage-requirements) ; } diff --git a/src/tools/notfile.jam b/src/tools/notfile.jam index 97a5b0e87..7d0985b45 100644 --- a/src/tools/notfile.jam +++ b/src/tools/notfile.jam @@ -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 @@ class notfile-generator : generator { 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 ] ; - 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 @@ actions run } -rule notfile ( target-name : action + : sources * : requirements * : default-build * ) +rule notfile ( target-name : action + : sources * : requirements * : + default-build * ) { - local project = [ project.current ] ; - - requirements += $(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) : + $(default-build) ; } IMPORT $(__name__) : notfile : : notfile ;