Hello Dears,
Assume that we have the .O files(objects) after compiling. now I wanna linking the .O files with no compiling the sources again. just linking the .o files. apparently, I should do this if possible by modifying the content of makefiles. could anyone help??\
I am speaking about NXP's AUTOSAR sample projects in the site. e.g. MPC574XG_MCAL4_0_RTM_1_0_5_Sample_Application\ and the make files inside it...
Hello,
It will not be easy to archive that in Makefile, cause the OUT_FILES variable depends on the source files (.c, .C and .s files) which could be found by Make GNU. Without the knowledge of these files, there will be no object file acknowledged, hence the Makefile will not include the object files without a source file as reference.
You can use the command to link the object files, for example:
C:/ghs/comp_201914/ccppc.exe -cpu=ppc5748gz4204 -vle -nostartfiles --nocpp -Mn -delete -ignore_debug_references -keepmap ./toolchains/autosar_flash.ld ./bin/Adc.o [...] ./bin/sample_app_mcal_task_1.o ./bin/sample_app_mcal_task_2.o ./bin/sample_app_mcal_task_3.o ./bin/sample_app_mcal_uart_console.o -o bin/sample_app_mcal.elf
(list out all of the object files and paths in [...])
Best Regards,
Nam
Can anybody help with this topic???
Hello,
It's a makefile dependencies topic: basically, if there is no change within dependencies of a target, then that target will not be touched. For instance, in a make environment, if you didn't change any object files, which are dependencies of an elf file, then that elf file will not be re-created; or when you modify one source file, only the object for that source file is re-created (not all of the objects are re-created). Here you can find some useful information about it:
https://www.tutorialspoint.com/makefile/makefile_recompile.htm
The sample application in MPC574xG_MCAL4_0_RTM_1_0_5 has already supported this.
Best Regards,
Nam
Thank You, Dear Nam.
But my main question is:
Assume that I just had the .O files here. somebody did the compilation on another computer and gave me just the .O files. And now I wanna make a .elf file from this .O files. there's no .C/.CPP files are available to compile. ok?