Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Adding a new tool to MBS

Leo,

Thanks that helps - I am getting there, but not quite....

objcopy is now being invoked after the linker. But:
1. I have to specify multipleOfInput=true to get anything objcopy to invoke
2. it has no inputfile on the command line
3. the outputfile is called "default.xxx" (xxx is my extension). I guess it is using "default" for the basename as there is no inputfile.

Any more thoughts? Do I need a dependencyCalculator?

Here's my latest snippet.
<inputType
   sourceContentType="com.crt.exe.type"
   primaryInput='true'
   multipleOfType='true'	# if this is false, my tool is not invoked
   id="com.crt.objcopy.input">
</inputType>
<outputType
   outputContentType='com.crt.xxx.type'
   primaryInputType="com.crt.objcopy.input"
   primaryOutput='true'
nameProvider="org.eclipse.cdt.managedbuilder.makegen.gnu.GnuLinkOutputNameProvider"
   id="com.crt.objcopy.output">
</outputType>

--
Derek


Treggiari, Leo wrote:
Hi Derek,

It's been a while since I worked with this stuff on a daily basis.  Yes,
secondaryOutputs sounds like it should help.  Regarding the
buildVariable for your 'objcopy' inputType, I don't think you should
need to specify one and just rely on the inputType contentType.
The name that you specify in the UI for the "target" will only be used
by the tool that you specify for the target tool.  There was a problem
with the linker definitions in that there was no property for specifying
the output file name - it was assumed that the linker was always the
last tool so that there was no need for that.  I added a:

nameProvider="org.eclipse.cdt.managedbuilder.makegen.gnu.GnuLinkOutputNa
meProvider"

attribute to the GNU linker definitions.  This provides a default output
name that is based upon the first input file.

Regards,
Leo

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of Derek Morris
Sent: Monday, December 04, 2006 6:42 AM
To: CDT General developers list.
Subject: Re: [cdt-dev] Adding a new tool to MBS

Chris,

Thanks for the advice, but that doesn't do anything. If I give the
inputType a buildVariable, it makes no difference to the generated makefile. However, if I give the outputType a buildVariable, than that is added to the makefile as a secondary_output. Note that what I am trying to do is run objcopy on a generated executable to create and SRECord file.

Here is a snippet from the plugin.xml:
      <tool
       commandLinePattern='${COMMAND} ${FLAGS} ${INPUTS} ${OUTPUT}'
       id='com.crt.objcopy'
       isAbstract='true'
       name='%crt.objcopy.name'
       natureFilter='both'
     >
          <inputType
             sources="%crt.exe.extension"
sourceContentType="org.eclipse.cdt.managedbuilder.core.executableFile" dependencyCalculator="org.eclipse.cdt.managedbuilder.makegen.internal.De
faultNoDependencyCalculator"
         	multipleOfType="false"
         	primaryInput='true'
         	buildVariable="OBJCOPY"
             id="com.crt.objcopy.input">
          </inputType>
          <outputType
         	outputs="%crt.objcopy.output.ext"
         	primaryInputType="com.crt.objcopy.input"
         	primaryOutput='true'
             id="com.crt.objcopy.output">
          </outputType>

       <optionCategory... etc
     </tool>

and in the toolChain definition, I have

           secondaryOutputs='com.crt.objcopy.output'

the generated makefile contains:
(in makefile)

all: four.exe secondary-outputs
<snip>
secondary-outputs: $(COM_CRT_OBJCOPY_OUTPUT_OUTPUTS)

(in sources.mk)
COM_CRT_OBJCOPY_OUTPUT_OUTPUTS :=


Again, TIA


Back to the top