2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-17 01:32:12 +00:00
Files
build/v2/tools/stage.jam
Vladimir Prus ad8d438af3 Cleanups.
* new/virtual-target.jam
     (abstract-file-target.extra-grist): Remove
     (null-action): New class.

* new/prebuilt.jam
     (prebuilt-file-generator): Don't use 'extra-grist', use
     'null-action' instread to distinguish different prebuilt targets.


[SVN r17482]
2003-02-17 09:51:06 +00:00

60 lines
1.9 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) ] ;
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 ;