mirror of
https://github.com/boostorg/build.git
synced 2026-02-16 13:22:11 +00:00
virtual-target.jam.
- Added the missing explicit imports, now that we don't dump
everything into the global module with qualification
- stopped using the feature-space hack for temporary testing states of
the feature module. Instead we move its global variable definitions
to a temporary module.
- the way feature.action was invoking the rule it was being passed was
evil. Now you pass (even local) rules without qualification and
they are invoked in the source module context.
- module __test__ rules are always executed in a separate module, so
that their import dependencies can be separated from those of the
module being tested.
- better reporting of circular module-loading dependencies
implemented.
- minor changes:
property-set.jam: moved .empty initialization to avert circular
load dependency .
symlink.jam: fixed global variable naming.
[SVN r18407]
66 lines
2.1 KiB
Plaintext
66 lines
2.1 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 'make' rule and associated class, derived from
|
|
# 'basic-target'.
|
|
|
|
import targets ;
|
|
import class : class new ;
|
|
import property ;
|
|
import errors : error ;
|
|
import type : type ;
|
|
import regex ;
|
|
import property-set ;
|
|
|
|
rule make-target-class ( name : project : sources * : requirements *
|
|
: make-rule + : default-build * )
|
|
{
|
|
import type regex virtual-target ;
|
|
|
|
basic-target.__init__ $(name) : $(project) : $(sources) : $(requirements)
|
|
: $(default-build) ;
|
|
|
|
self.make-rule = $(make-rule) ;
|
|
|
|
rule construct ( source-targets * : property-set )
|
|
{
|
|
local t = [ new file-target $(self.name:S=) : [ type.type $(self.name:S) ]
|
|
: $(self.project) ] ;
|
|
$(t).suffix [ regex.match .(.*) : $(self.name:S) ] ;
|
|
local a = [ new action $(t) : $(source-targets) : $(self.make-rule)
|
|
: $(property-set) ] ;
|
|
$(t).action $(a) ;
|
|
return [ virtual-target.register $(t) ] ;
|
|
}
|
|
}
|
|
class make-target-class : basic-target ;
|
|
|
|
rule make ( target-name : sources * : generating-rule + : requirements *
|
|
: caller ? )
|
|
{
|
|
caller ?= [ CALLER_MODULE ] ;
|
|
local rules = [ RULENAMES $(caller) ] ;
|
|
if $(generating-rule[1]) in $(rules)
|
|
{
|
|
# This is local rule, make it global
|
|
local n = $(caller).$(generating-rule[1]) ;
|
|
IMPORT $(caller) : $(generating-rule[1]) : : $(n) ;
|
|
generating-rule = $(n) $(generating-rule[2-]) ;
|
|
}
|
|
|
|
targets.main-target-alternative
|
|
[ new make-target-class $(target-name) : $(caller) : $(sources) :
|
|
[ targets.main-target-requirements $(requirements) : $(caller) ] :
|
|
$(generating-rule) :
|
|
:
|
|
[ targets.main-target-default-build : $(caller) ]
|
|
] ;
|
|
|
|
}
|
|
|
|
IMPORT $(__name__) : make : : make ;
|
|
|
|
|