2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-15 00:52:16 +00:00
Files
build/src/tools/make.jam
Steven Watanabe ee613a6a28 Implement feature relevance.
* New feature <relevant> which is automatically deduced in most cases.
* Features which are not relevant do not affect target paths and
  do not prevent merging of virtual targets.
* generators.jam: generator.run always returns usage-requirements
  to allow usage-requirements in non-top-level generators.  This
  is necessary because we're using usage-requirements to track
  relevance from flags.
* New rule toolset.uses-features to specify features that the rule
  checks manually, instead of using toolset.flags.  In the future,
  we should consider restricting the properties actually passed,
  to detect errors.
* Adjust tests to handle the new paths (verified by inspection).
* Add temporary option --ignore-relevance to consider all features relevant
  to aid migration.
* New rule property.evaluate-conditional-relevance which helps tracking
  relevance in <conditional>.
* Widely scattered changes to use the new interfaces.
2018-01-13 09:13:49 -07:00

67 lines
2.1 KiB
Plaintext

# Copyright 2003 Dave Abrahams
# Copyright 2003 Douglas Gregor
# 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 copy at
# http://www.boost.org/LICENSE_1_0.txt)
# This module defines the 'make' main target rule.
import "class" : new ;
import project ;
import property-set ;
import targets ;
class make-target-class : basic-target
{
import "class" : new ;
import indirect ;
import toolset ;
import type ;
import virtual-target ;
rule __init__ ( name : project : sources * : requirements *
: default-build * : usage-requirements * )
{
basic-target.__init__ $(name) : $(project) : $(sources) :
$(requirements) : $(default-build) : $(usage-requirements) ;
}
rule construct ( name : source-targets * : property-set )
{
local action-name = [ $(property-set).get <action> ] ;
# 'm' will always be set -- we add '@' ourselves in the 'make' rule
# below.
local m = [ MATCH ^@(.*) : $(action-name) ] ;
local relevant = [ toolset.relevant [ indirect.get-rule $(m[1]) ] ] ;
local a = [ new action $(source-targets) : $(m[1]) : [ $(property-set).add $(relevant) ] ] ;
local t = [ new file-target $(self.name) exact : [ type.type
$(self.name) ] : $(self.project) : $(a) ] ;
return $(relevant) [ virtual-target.register $(t) ] ;
}
}
# Declares the 'make' main target.
#
rule make ( target-name : sources * : generating-rule + : requirements * :
usage-requirements * )
{
# 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) ] ;
if ! $(m)
{
generating-rule = @$(generating-rule) ;
}
targets.create-metatarget make-target-class : [ project.current ] :
$(target-name) : $(sources) : $(requirements) <action>$(generating-rule)
: : $(usage-requirements) ;
}
IMPORT $(__name__) : make : : make ;