parameters: (project, name, target_type, prop_set, sources, top_level=False)
return_statement: return result
docstring: Attempts to create target of 'target-type' with 'properties'
          from 'sources'. The 'sources' are treated as a collection of
          *possible* ingridients -- i.e. it is not required to consume
          them all. If 'multiple' is true, the rule is allowed to return
          several targets of 'target-type'.          
          
          Returns a list of target. When this invocation is first instance of
          'construct' in stack, returns only targets of requested 'target-type',
          otherwise, returns also unused sources and additionally generated
          targets.
          
          If 'top-level' is set, does not suppress generators that are already
          used in the stack. This may be useful in cases where a generator
          has to build a metatarget -- for example a target corresponding to
          built tool.
docstring_summary: Attempts to create target of 'target-type' with 'properties'
          from 'sources'. The 'sources' are treated as a collection of
          *possible* ingridients -- i.e. it is not required to consume
          them all. If 'multiple' is true, the rule is allowed to return
          several targets of 'target-type'.          
          
          Returns a list of target. When this invocation is first instance of
          'construct' in stack, returns only targets of requested 'target-type',
          otherwise, returns also unused sources and additionally generated
          targets.
          
          If 'top-level' is set, does not suppress generators that are already
          used in the stack. This may be useful in cases where a generator
          has to build a metatarget -- for example a target corresponding to
          built tool.
docstring_tokens: Attempts to create target of target - type with properties from sources . The sources are treated as a collection of * possible * ingridients -- i . e . it is not required to consume them all . If multiple is true the rule is allowed to return several targets of target - type . Returns a list of target . When this invocation is first instance of construct in stack returns only targets of requested target - type otherwise returns also unused sources and additionally generated targets . If top - level is set does not suppress generators that are already used in the stack . This may be useful in cases where a generator has to build a metatarget -- for example a target corresponding to built tool .
function: def construct (project, name, target_type, prop_set, sources, top_level=False):
      """ Attempts to create target of 'target-type' with 'properties'
          from 'sources'. The 'sources' are treated as a collection of
          *possible* ingridients -- i.e. it is not required to consume
          them all. If 'multiple' is true, the rule is allowed to return
          several targets of 'target-type'.          
          
          Returns a list of target. When this invocation is first instance of
          'construct' in stack, returns only targets of requested 'target-type',
          otherwise, returns also unused sources and additionally generated
          targets.
          
          If 'top-level' is set, does not suppress generators that are already
          used in the stack. This may be useful in cases where a generator
          has to build a metatarget -- for example a target corresponding to
          built tool.        
      """
  
      global __active_generators
      if top_level:
          saved_active = __active_generators
          __active_generators = []
  
      global __construct_stack
      if not __construct_stack:
          __ensure_type (sources)
          
      __construct_stack.append (1)
  
      if project.manager().logger().on():
          increase_indent ()
          
          dout( "*** construct " + target_type)
          
          for s in sources:
              dout("    from " + str(s))
  
          project.manager().logger().log (__name__, "    properties: ", prop_set.raw ())
               
      result = __construct_really(project, name, target_type, prop_set, sources)
  
      project.manager().logger().decrease_indent()
          
      __construct_stack = __construct_stack [1:]
  
      if top_level:
          __active_generators = saved_active
  
      return result
function_tokens: def construct ( project , name , target_type , prop_set , sources , top_level = False ) : global __active_generators if top_level : saved_active = __active_generators __active_generators = [ ] global __construct_stack if not __construct_stack : __ensure_type ( sources ) __construct_stack . append ( 1 ) if project . manager ( ) . logger ( ) . on ( ) : increase_indent ( ) dout ( "*** construct " + target_type ) for s in sources : dout ( "    from " + str ( s ) ) project . manager ( ) . logger ( ) . log ( __name__ , "    properties: " , prop_set . raw ( ) ) result = __construct_really ( project , name , target_type , prop_set , sources ) project . manager ( ) . logger ( ) . decrease_indent ( ) __construct_stack = __construct_stack [ 1 : ] if top_level : __active_generators = saved_active return result