diff --git a/new/virtual-target.jam b/new/virtual-target.jam index 5c5d4d51c..9811185de 100644 --- a/new/virtual-target.jam +++ b/new/virtual-target.jam @@ -294,20 +294,35 @@ rule abstract-file-target ( name } } - # Returns the name of main target this virtual target is specific too. - # Ordinary, it's assumed that grist of the actual Jam target and target path - # is determined by project, base properties, target name and type. - # Derived classes may return non-empty string to indicate that the target is - # specific to the given main target. + # Returns the name of main target this virtual target is specific + # to. + # + # Ordinarily, it's assumed that any grist on the actual Jam target + # and target path is determined by project, base properties, + # target name and type. Derived classes may return a non-empty + # string to indicate that the target is specific to the given main + # target. rule specific-main-target ( ) { return "" ; } + # Return a human-readable representation of this target + # + # If this target has an action, that's: + # + # { -. ... } + # + # otherwise, it's: + # + # { . } + # rule str ( ) { local action = [ action ] ; - local filename = [ sequence.join $(self.name) "." $(self.type) ] ; + + local name-dot-type = [ sequence.join $(self.name) "." $(self.type) ] ; + if $(action) { local sources = [ $(action).sources ] ; @@ -318,12 +333,13 @@ rule abstract-file-target ( name ss += [ $(s).str ] ; } - local name = [ $(action).action-name ] ; - return "{" $(name)-$(filename) $(ss) "}" ; + local action-name = [ $(action).action-name ] ; + + return "{" $(action-name)-$(name-dot-type) $(ss) "}" ; } else { - return "{" $(filename) "}" ; + return "{" $(name-dot-type) "}" ; } } diff --git a/v2/build/virtual-target.jam b/v2/build/virtual-target.jam index 5c5d4d51c..9811185de 100644 --- a/v2/build/virtual-target.jam +++ b/v2/build/virtual-target.jam @@ -294,20 +294,35 @@ rule abstract-file-target ( name } } - # Returns the name of main target this virtual target is specific too. - # Ordinary, it's assumed that grist of the actual Jam target and target path - # is determined by project, base properties, target name and type. - # Derived classes may return non-empty string to indicate that the target is - # specific to the given main target. + # Returns the name of main target this virtual target is specific + # to. + # + # Ordinarily, it's assumed that any grist on the actual Jam target + # and target path is determined by project, base properties, + # target name and type. Derived classes may return a non-empty + # string to indicate that the target is specific to the given main + # target. rule specific-main-target ( ) { return "" ; } + # Return a human-readable representation of this target + # + # If this target has an action, that's: + # + # { -. ... } + # + # otherwise, it's: + # + # { . } + # rule str ( ) { local action = [ action ] ; - local filename = [ sequence.join $(self.name) "." $(self.type) ] ; + + local name-dot-type = [ sequence.join $(self.name) "." $(self.type) ] ; + if $(action) { local sources = [ $(action).sources ] ; @@ -318,12 +333,13 @@ rule abstract-file-target ( name ss += [ $(s).str ] ; } - local name = [ $(action).action-name ] ; - return "{" $(name)-$(filename) $(ss) "}" ; + local action-name = [ $(action).action-name ] ; + + return "{" $(action-name)-$(name-dot-type) $(ss) "}" ; } else { - return "{" $(filename) "}" ; + return "{" $(name-dot-type) "}" ; } }