Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Change intermediate files extension(CDT internal builder uses .o as extension for output files, I need to change it to another)
Change intermediate files extension [message #1778297] Tue, 12 December 2017 17:34
ee ll is currently offline ee llFriend
Messages: 3
Registered: April 2015
Junior Member
I need to modify the intermediate file extensions generated by the builder.
For a simple example:
When Eclipse generates the makefile (either GNU or the internal builder) 2 command lines are created, one for the compiler and one for the linker. In a very basic example they look like this:

gcc.exe -o myfile.o myfile.c // for the compiler, generates myfile.o
gcc.exe -o myfile.exe myfile.o // for the linker, uses as input myfile.o

They work ok for most compilers and linkers since the ".o" extension is recognized by most of them.

My problem is that I'm using the SDCC compiler which does not recognize .o files. So, it can't use them as inputs for linking. SDCC uses ".rel" extension.

I found a workaround for the first line, by modifying the "Command line pattern" in the 'settings' tab to use ${OUTPUT}.rel the generated file becomes myfile.o.rel. It's an awful workaround but does the job.

But for the 2nd line, the linker, Eclipse uses the ${INPUTS} variable which expands to all the input files at once, so if I have more than one input file only the last one can be corrected.

The right solution is, somehow, to tell the builder to use the .rel extension instead of the .o.

I can't find any option or setting to allow me do this. I hope there is one hidden option.
in sum, I need to tell the builder to construct a makefile which uses the .rel extension instead of a .o.

Seems like a trivial matter, yet I can't find any option in the IDE
There's a setting for the final artifact suffix, but my problem is not with the final artifact but with the intermediate files.

Again, I like to use the CDT internal builder, I know this could be resolved using my own makefiles but I need to use the internal builder instead.

Thanks

[Updated on: Tue, 12 December 2017 23:03]

Report message to a moderator

Previous Topic:How to create class from shared library project?
Next Topic:testing the waters
Goto Forum:
  


Current Time: Thu Jul 19 09:17:26 GMT 2018

Powered by FUDForum. Page generated in 0.01607 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top