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

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>

-- 
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
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top