2
0
mirror of https://github.com/boostorg/build.git synced 2026-02-15 00:52:16 +00:00

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]
This commit is contained in:
Vladimir Prus
2003-02-17 09:51:06 +00:00
parent 81b7961c6c
commit e9f7422b2b
3 changed files with 37 additions and 29 deletions

View File

@@ -104,13 +104,6 @@ rule virtual-target ( name # Name of this target -- specifies the name of
# If scanner is not specified, then actual target is returned.
rule actualize ( scanner ? )
{
# ### This comment is probably out-of-date. Ignore for now.
# When we have explicitly specified target, we need to create a
# target and associate scanner with it.
# There may be many different scanners, but there's only one
# generating action. Therefore, generating action actualizes this
# target without any scanner. Actual target with scanners will
# depend on actual target without scanner.
local actual-name = [ actualize-no-scanner ] ;
if ! $(scanner)
@@ -195,9 +188,8 @@ class virtual-target ;
# derived file (otherwise).
#
# The target's grist is concatenation of project's location,
# properties of action (for derived files), and the value
# passed to 'extra-grist'.
#
# properties of action (for derived files), and, optionally,
# value identifying the main target.
rule abstract-file-target ( name
: type ? # Optional type for this target
: project
@@ -277,12 +269,6 @@ rule abstract-file-target ( name
return $(self.dg) ;
}
# Specifies an extra grist to be added to the target name.
rule extra-grist ( g )
{
self.extra-grist = $(g) ;
}
rule actualize-action ( target )
{
if $(self.action)
@@ -369,14 +355,13 @@ rule abstract-file-target ( name
{
grist = $(location-grist) ;
}
# Adding this to grist looks ugly. It's still here for the
# same of 'symlink' rule -- got to consider what to do
# about it.
if $(self.path)
{
grist = $(grist)@$(self.path)@ ;
}
if $(self.extra-grist)
{
grist = $(grist)/$(self.extra-grist) ;
}
local smt = [ specific-main-target ] ;
if $(smt)
{
@@ -459,6 +444,9 @@ rule file-target (
}
}
# If free properties of this target's actions are equal to reference properties on
# project, returns empty string. Otherwise, returns the name of main target to
# which this target belong.
rule specific-main-target ( )
{
if $(self.action)
@@ -642,6 +630,32 @@ rule action ( targets + : sources * : action-name : property-set ? )
}
class action ;
# Action class which does nothing --- it produces the targets with
# specific properties out of nowhere. It's needed to distinguish virtual
# targets with different properties that are known to exist, and have no
# actions which create them.
rule null-action ( targets + : property-set ? )
{
action.__init__ $(targets) : : no-action : $(property-set) ;
rule actualize ( )
{
if ! $(self.actualized)
{
self.actualized = true ;
local actual-targets ;
for local i in [ targets ]
{
actual-targets += [ $(i).actualize ] ;
}
}
}
}
class null-action : action ;
# Creates a virtual target with approariate name and type from 'file'.
# If a target with that name in that project was already created, returns that already
# created target.

View File

@@ -36,14 +36,9 @@ rule prebuilt-file-generator
local t = [ new file-target $(name:S=:D=) : $(type) : $(project) ] ;
$(t).set-path $(path) ;
# TODO: have no idea how handle this. Specifically,
# we need to distinguish between virtual targets with different
# properties. In this case, there are no properties, because
# they are stored in action, and we don't have any action.
# Therefore, we encode properties via 'extra-grist', which is ugly.
# Maybe, we should just introduce 'do-nothing-action', which only
# keps properties.
$(t).extra-grist [ $(property-set).as-path ] ;
$(t).action [ new null-action $(t) : $(property-set) ] ;
$(t).suffix [ MATCH .(.*) : $(name:S) ] ;
return $(t) ;

View File

@@ -31,7 +31,6 @@ rule stage-target-class ( name-and-dir : project : sources * : requirements * :
$(i2).set-path [ project.path-relative-to-project-location
$(self.name) $(self.project) ] ;
$(i2).extra-grist stage-$(self.name) ;
result += $(i2) ;
}
return $(result) ;