<?xml?>

<GwenBuilder name="StaticLib">

  <inputFiles>
    <acceptedInputTypes>object</acceptedInputTypes>
    <acceptedInputFiles>*.o</acceptedInputFiles>
  </inputFiles>

  <outputFiles>
    <file type="tmplib">
      lib$(target_name).a
    </file>
  </outputFiles>
  
  <targetLinkSpecs>
    -l$(target_name)
  </targetLinkSpecs>
  
  <buildCommands deleteOutFileFirst="TRUE" checkDates="FALSE" >
    <cmd tool="$(GWBUILD_TOOL_AR)" >
      <args>
        <fixed>Trc</fixed>
        <blank/>
        <outputFiles index="0" />
        <blank/>
        <inputFiles match="*.o" />
        <inputFiles match="*.a" />
      </args>
      <mainOutputFile index="0" />
      <buildMessage>Linking 'lib$(target_name).a'</buildMessage>
    </cmd>

    <cmd tool="$(topbuilddir)/staticlibhelper.sh" >
      <args>
        <fixed>$(GWBUILD_TOOL_AR)</fixed>
        <blank/>
        <outputFiles index="0" />
      </args>
      <buildMessage>Finally linking 'lib$(target_name).a'</buildMessage>
    </cmd>

    <cmd tool="$(GWBUILD_TOOL_RANLIB)">
      <args>
        <outputFiles index="0" />
      </args>
      <mainOutputFile index="0" />
      <buildMessage>Indexing 'lib$(target_name).a'</buildMessage>
    </cmd>

  </buildCommands>

</GwenBuilder>


