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,

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
-- 
Derek


Chris Recoskie wrote:
> You have to specify in the inputType in question to use a variable.
This
> can be whatever name you wish, MBS will generate the makefile such
that all
> files of that type are assigned to that variable name in the makefile.
> 
> ===========================
> 
> Chris Recoskie
> Team Lead, IBM CDT Team
> IBM Toronto
> http://www.eclipse.org/cdt
> 
> 
> 
>

>   From:   Derek Morris <dmsubs@xxxxxxxxxxxxx>

>

>   To:     "CDT General developers list." <cdt-dev@xxxxxxxxxxx>

>

>   Date:   04/12/2006 08:00 AM

>

>   Subject Re: [cdt-dev] Adding a new tool to MBS

>   :

>

> 
> 
> 
> 
> Further to this, I found the 'secondaryOutputs' attribute of a
toolchain,
> which
> looks like what I want.
> 
> Unfortunately, I can't get it to work for me.
> 
> Looking at the generated makefile, it adds a secondary_outputs target
which
> 
> references a (generated) buildVariable. Unfortunately the
buildVariable is
> never
> assigned, so it doesn't build my secondaryOutput.
> 
> I tried using the EXECUTABLES variable but that cause it to build
something
> 
> called USER_OBJS instead of my target name...
> 
> TIA,
> --
> Derek
> 
> 
> Derek Morris wrote:
>> Could it be done with a fake tool? For example, from a .exe, I want
to
>> create 3 additional files .a, .b and .c, could I define those three
>> tools and then a fourth (which is the subject of the TargetTool)
which
>> does nothing, but is dependent on .a, .b and .c?
>>
>> Thanks
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 
> 
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top