2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-13 12:22:17 +00:00

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]
This commit is contained in:
Jurko Gospodnetić
2012-09-13 05:38:21 +00:00
parent cc67036dab
commit f4fad1a46f
4 changed files with 33 additions and 50 deletions

View File

@@ -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

View File

@@ -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 <build>no ] ;
self.generated.$(property-set) = [ property-set.create <build>no
] ;
}
}
else

View File

@@ -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 += <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) ;
}

View File

@@ -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 <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 @@ 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>$(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 ;