Skip to main content

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

  Thanks for the suggestions. I tried them, but didn't get the expected results.
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
          name="Bool output"
    (b) Tool (C compiler) that accepts .c files as input
Still, the .c file gets compiled.
Is there anything additional for the tool attributes?
As for the suggestion of renaming the .c to .h, I'm afraid that would cause
problems for users.

Message: 2
Date: Thu, 7 Sep 2006 11:14:51 +0200
From: wieant@xxxxxxxxx (Wieant Nielander)
Subject: Re: [cdt-dev] outputType of tool is .c file
To: "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
Message-ID: <20060907091451.GA5160@xxxxxxxxx>
Content-Type: text/plain; charset=us-ascii

> One of the tools in my toolchain generates a .c file as output.
> This .c file is then used in sources (using #include...)
> Since the file has a .c extension, the 'C compiler' tool goes ahead &
> compiles this to a .o This step should not happen in my case.  I end up
> getting link time errors due to this.
> Is there any way I can stop the C compiler from building this output .c file?


You could try to use/change the 'outputType' sub element of your tool
definition. Changing the 'buildVariable' attribute of the 'outputType'
element might result in the generated .c files not ending up in the objects
macro list, hence not being compiled/linked. You then have to ensure that
your tool is still being executed, so the .c files including your generated
sources should somehow get a dependency on your new buildVariable.

When the generated .c files are however generated within the project
directory you still have a problem, as the updated makefile will probably
include them in the standard .c sources list.

All in all Dereks suggestion might be easier...



Message: 3
Date: Thu, 7 Sep 2006 13:16:40 +0400
From: "Sennikovsky, Mikhail" <mikhail.sennikovsky@xxxxxxxxx>
Subject: RE: [cdt-dev] outputType of tool is .c file
To: "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
Content-Type: text/plain; charset="us-ascii"

Hi Delicia,
To avoid building the generated .c files with your compiler you should
do the following:

1. The generated .c files should be stored within the build output directory
2. In your definition of the tool that generates the .c files the
outputType that represents .c files should contain the buildVariable
that differs from the buildVariable attribute of the inputType of your
compiler that accepts .c files. This should prevent the generated .c
files from being used by your compiler tool.


Back to the top