2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-16 13:22:11 +00:00
Files
build/new/stage.jam
Vladimir Prus b12a902687 Clean ups.
* new/builtin.jam: Made 'toolset' and 'variant'
    features symmentic. Document and fix the 'variant' rule.

* new/virtual-target.jam: Refactoring attempts. Split
   virtual-target into virtual-target and derived from it
   file-target. Eliminate some duplication in setting target
   locations.


[SVN r16437]
2002-11-27 08:37:07 +00:00

62 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 i2 = [ new file-target [ $(i).name ] : [ $(i).type ]
: $(self.project) ] ;
local a = [ new action $(i2) : $(i) : common.copy ] ;
$(i2).action $(a) ;
local pl = [ project.attribute $(self.project) location ] ;
local path = [ path.root [ path.native $(self.name) ] $(pl) ] ;
$(i2).set-path $(path) ;
$(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 ;