Boost logo

Boost-Build :

From: David Abrahams (gclbb-jamboost_at_[hidden])
Date: 2003-06-17 10:29:13


Vladimir Prus <ghost_at_[hidden]> writes:

> Ali Azarbayejani wrote:
>> Vladimir Prus wrote:
>> > David Abrahams wrote:
>> >>>>In fact, I don't know the meaning of dependency on main target.
>> >>
>> >>It means that you depend indirectly on everything that main target
>> >>depends on, i.e. all of the subvariants which get built. Generally
>> >>that won't occur, but the main target can be requested from the
>> >>command-line, in which case you can view the whole build as depending
>> >>on it.
>> >
>> > Can you clarify: will build system ever create depency on main target
>> > during invocation of 'realize' rule. IOW, will 'realize' only exend
>> > dependency graph with instances of "file-target" from Ali's proposal.
>>
>> The 'realize' rule never creates dependencies on MainTargets. Realize
>> only creates FileTarget nodes in the graph.
>
> Oh... and that what made me wonder once again if we need a common Target
> class.
>
>> I realize now that "MainTarget" is not really a "target" itself; it is a
>> specification of a type of target, including information on how to
>> construct variations of that type of target. I'm not sure any more if
>> it even belongs in the Target heirarchy or as a node in the dependency
>> graph.
>
> So, we're almost back to separate hierarchies for abstract-target and
> virtual-target. However....
>
> 1. The word "specification" starts to resonate for me, and it's sounds better
> than 'abstract-target'. So, the 'abstract-target' can become 'target-spec',
> and the 'generate' rule will remain basically as is.

My only reservation about target-spec is that it doesn't resonate for
the user in some cases. What does it mean to include a target-spec
in your sources? Well, we could rephrasee as "include the id of a
target-spec in your sources", which makes more sense. Anyway, this
is why I was suggesting MetaTarget before, though please note I am
not at all convinced it would be an improvement.

> 2. As I've said before, I wanted to exploit the similiarity between
> main target reference and file --- when used in a source. Now I see
> how this can be done. Besides ProjectSpec and MainTargetSpec, we can
> have FileSpec class, which 'generate' method only returns target to
> the named file. We'll have
>
> for s in sources:
> source_targets = []
> TargetSpec t = targets.find(p.value())
> source_targets += t.generate(build_properties)
>
> and there's not need to distinguish between main target and file.

Cool.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com
 

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk