[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Re: outputType of tool is .c file

Hello Wieant,
 
   Thanks for the suggestion. I tried implementing it.
 
Steps I used:
1. Use a dummy extension (bc) for the 'psm' tool outputType element
2. In the shell script used for the tool command, rename/move the generated output to contain the correct extension (.c)
3. Added an extra inputType to the linker tool using the dummy extension and buildVariable="PSM_FILE"
4. Added an additionalInput (of kind: additionalDependency) to the compiler inputType (so that
   the PSM_FILE gets generated before the compiler is invoked.)
 
With this, the behaviour is 'almost' correct.
However, step 3. creates a problem - since the PSM_FILE is not meant to be linked.
Also, _only_ step 3. works to set PSM_FILE correctly, i.e.
 
/* From 'subdir.mk' */
# Add inputs and outputs from these tool invocations to the build variables
PSM_FILE += \
./psm_vidout.bc
 
Is there any other way to set PSM_FILE as above?
 
Thanks,
Delicia.
 
------------------------------
Message: 3
Date: Mon, 11 Sep 2006 10:38:36 +0200
From: wieant@xxxxxxxxx (Wieant Nielander)
Subject: Re: [cdt-dev] Re: outputType of tool is .c file
To: "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
Message-ID: <20060911083836.GB10624@xxxxxxxxx>
Content-Type: text/plain; charset=us-ascii

> 1. The generated output (.c) file is stored in the
>    <project_dir>/<config_dir> directory, which, in my case is:
>    "testbool/Debug"
> 2. The relevant tool settings are as follows:
>     (a) Tool that generates .c file as output
>     <outputType
>           buildVariable="PSM_FILE"
>           id="cradle.toolchain.boolgenerator.output"
>           name="Bool output"
>           outputNames="psm_%.c"/>
>
>     (b) Tool (C compiler) that accepts .c files as input
>     <inputType
>       buildVariable="C_SRCS"
>       dependencyCalculator="org.eclipse.cdt.managedbuilder.makegen.gnu.DefaultGCCDependencyCalculator"
>       dependencyContentType="org.eclipse.cdt.core.cHeader"
>       dependencyExtensions="h"
>       sources="c,C">
>     </inputType>
>    
> Still, the .c file gets compiled.
> Is there anything additional for the tool attributes?

Delicia,

I think the problem is the fact that the output extension of your 'psm'
tool is defined to be .c, which probably results in the 'psm_%' file ending
up in the objects list (you can check this in the subdir.mk files). You
could trick the makefile generator by using a different (dummy) extension
for your 'psm' tool. Then to get some dependency on your 'psm' file you
could add an extra inputType to the linker tool using the dummy extension
and buildVariable="PSM_FILE". Using some 'sed' magic to get the tool
commands right might do the trick.

Or you could go with the earlier suggestion to use your own makefile
generator, in which case you have full control over extension handling...

Regards,
  Wieant