mirror of
https://github.com/boostorg/build.git
synced 2026-02-16 13:22:11 +00:00
* new/stage.jam: (stage-target-class): Strip directory names when determining the name of the target file. * test/stage.py: Update the test. [SVN r16892]
61 lines
2.0 KiB
Plaintext
61 lines
2.0 KiB
Plaintext
# Copyright (C) Vladimir Prus 2002. Permission to copy, use, modify, sell and
|
|
# distribute this software is granted provided this copyright notice appears in
|
|
# all copies. This software is provided "as is" without express or implied
|
|
# warranty, and with no claim as to its suitability for any purpose.
|
|
|
|
# This module defines the 'stage' rule, used to copy a set of targets to
|
|
# a single location
|
|
|
|
import targets ;
|
|
import class : class new ;
|
|
import property ;
|
|
import errors : error ;
|
|
import type : type ;
|
|
import regex ;
|
|
|
|
rule stage-target-class ( name-and-dir : project : sources * : requirements * : default-build * )
|
|
{
|
|
basic-target.__init__ $(name-and-dir) : $(project) : $(sources) : $(requirements)
|
|
: $(default-build) ;
|
|
|
|
rule construct ( source-targets * : properties * )
|
|
{
|
|
local result ;
|
|
for local i in $(source-targets)
|
|
{
|
|
local n = [ $(i).name ] ;
|
|
local i2 = [ new file-target $(n:D=) : [ $(i).type ]
|
|
: $(self.project) ] ;
|
|
local a = [ new action $(i2) : $(i) : common.copy ] ;
|
|
$(i2).action $(a) ;
|
|
|
|
$(i2).set-path [ project.path-relative-to-project-location
|
|
$(self.name) $(self.project) ] ;
|
|
$(i2).extra-grist stage-$(self.name) ;
|
|
result += $(i2) ;
|
|
}
|
|
return $(result) ;
|
|
}
|
|
}
|
|
|
|
class stage-target-class : basic-target ;
|
|
|
|
rule stage ( directory : sources * : requirements * : default-build * )
|
|
{
|
|
# FIXME: for now, just use directory as target name. We really
|
|
# need to implement unnamed main targets.
|
|
|
|
local project = [ CALLER_MODULE ] ;
|
|
|
|
targets.main-target-alternative
|
|
[ new stage-target-class $(directory) : $(project) : $(sources)
|
|
: [ targets.main-target-requirements $(requirements) : $(project) ]
|
|
: [ targets.main-target-default-build $(default-build) : $(project) ]
|
|
] ;
|
|
}
|
|
|
|
IMPORT $(__name__) : stage : : stage ;
|
|
|
|
|
|
|