<?xml?>

<GwenBuilder name="Module">

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

  <outputFiles>
    <file type="module" install="target" >
      $(target_name).so
    </file>
  </outputFiles>
  
  <targetLinkSpecs>
    -L$(folder) -l$(target_name)
  </targetLinkSpecs>
  
  <buildCommands deleteOutFileFirst="TRUE" checkDates="TRUE" checkDepends="FALSE" >

    <cmd tool="$(GWBUILD_TOOL_CC)" >
      <args>
        <fixed>-shared -fPIC -Wl,-no-undefined</fixed>
        <blank/>
        <fixed>$(local/ldflags)</fixed>
        <blank/>
        <inputFiles match="*.o" />
        <blank/>
        <fixed>-o</fixed>
        <blank/>
        <outputFiles index="0" />
        <blank/>
        <ifHasSubTargetLibs>
          <fixed>-Wl,--whole-archive</fixed>
          <blank/>
          <subTargetLibs/>
          <blank/>
        </ifHasSubTargetLibs>
        <ifHasLibraries>
          <fixed>-Wl,--no-whole-archive</fixed>
          <blank/>
          <libraries/>
        </ifHasLibraries>
      </args>
      <mainOutputFile index="0" />
      <buildMessage>
        Linking '$(target_name).so'
      </buildMessage>
    </cmd>

  </buildCommands>


</GwenBuilder>
