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,

Attached is the Debug directory, including all the generated make info for the tool definition snippet below. There were 2 .c files in the build.

Thanks for your help.

Tool definition
---
     <tool
      commandLinePattern='${COMMAND} ${FLAGS} ${INPUTS} ${OUTPUT}'
      id='com.crt.objcopy'
      isAbstract='true'
      name='%crt.objcopy.name'
      natureFilter='both'
    >
      <optionCategory
        id='com.crt.objcopy.optionCategory.options'
        name='%crt.objcopy.cat.options'
        owner='com.crt.objcopy'
      ></optionCategory>
        <option
               valueType="enumerated"
               category="com.crt.objcopy.optionCategory.options"
               browseType="none"
               name="%crt.objcopy.outputtype"
               id="com.crt.objcopy.outputtype">
            <enumeratedOptionValue
                  isDefault="true"
                  command="-O ihex"
                  name="%crt.objcopy.ihex"
                  id="com.crt.objcopy.outputtype.ihex"/>
            <enumeratedOptionValue
                  command="-O srec"
                  name="%crt.objcopy.srec"
                  id="com.crt.objcopy.outputtype.srec"/>
            <enumeratedOptionValue
                  command="-O symbolsrec"
                  name="%crt.objcopy.symbolsrec"
                  id="com.crt.objcopy.outputtype.symbolsrec"/>
            <enumeratedOptionValue
                  command="-O tekhex"
                  name="%crt.objcopy.tekhex"
                  id="com.crt.objcopy.outputtype.tekhex"/>
            <enumeratedOptionValue
                  command="-O binary"
                  name="%crt.objcopy.binary"
                  id="com.crt.objcopy.outputtype.binary"/>
         </option>
         <option
         	valueType="string"
               category="com.crt.objcopy.optionCategory.options"
               browseType="none"
               name="%crt.objcopy.other"
               id="com.crt.objcopy.other">
		</option>         	
        <inputType
            sourceContentType="com.crt.exe.type"
        	primaryInput='true'
        	multipleOfType='true'
            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>

    </tool>
---

Tool instantiation
---
          <tool
          command="%crt.objcopy.command"
          name="%crt.objcopy.name"
            id='com.crt.cdt.managedbuild.tool.gnu.cpp.objcopy.exe.debug'
            superClass='com.crt.objcopy'>
            </tool>
---
Targettool definition
--- targetTool='com.crt.cdt.managedbuild.tool.gnu.c.linker.exe.debug;com.crt.cdt.managedbuild.tool.gnu.cpp.linker.exe.debug'
---
--
Derek


Treggiari, Leo wrote:
Hi Derek,

What is the name of the output being generated by the Link step now?  If
it doesn't have an extension in the "com.crt.exe.type" list, then it
won't be used as input to your objcopy.

I suggest that you use the EXECUTABLES buildVariable and somehow get the
linker to set the output name that you want.
Here are the rules for determining the output name(s):

The precedence order for determining the output resource names is the
following:

1. If this is the "target" tool in the tool-chain, and this is the
primary OutputType, use the user-defined artifact name and extension. 2. If the option attribute is specified, use the value of the option. 3. If the nameProvider attribute is specified, call the nameProvider and use the returned name(s). 4. If the outputNames attribute is specified, use the value of the attribute. 5. Use the namePattern attribute value to construct the name from the
input file name.

If you are still having problems, snippets from the generated makefile
will help also.

Leo

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
On Behalf Of Derek Morris
Sent: Monday, December 04, 2006 10:30 AM
To: CDT General developers list.
Subject: 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.GnuLinkOutputNa
meProvider"
    id="com.crt.objcopy.output">
</outputType>

Attachment: Debug.zip
Description: Zip compressed data


Back to the top