Change intermediate files extension [message #1778297] |
Tue, 12 December 2017 12:34 |
Eclipse User |
|
|
|
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 18:03] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04648 seconds