Regenerating .o files

cancel
Showing results for 
Search instead for 
Did you mean: 

Regenerating .o files

112 Views
tomcarney
Contributor I

I have a project which has a large number of precompiled .o files.  I also have the source code to generate these files but they are not currently a part of the project. I want to change the project so that every time I rebuild, the .o files are generated from scratch from the .c and .h files so that I can debug the code, but I can't figure out how to do this.

If I clean the project, the .o files remain, and if I just drop the source files into the project I get compile errors from multiple definition of the functions in the source files. If I just delete the .o files and try to rebuild I immediately get a dialog-box error message to the tune that :

"  'build project' has encountered a problem. Errors occurred during the build. "

I am assuming that there is some project setting which stipulates that the .o files are all there, precompiled and ready to use, but I cannot find it. Could anyone point me in the right direction?

Thanks

Tom

0 Kudos
2 Replies

48 Views
bobpaddock
Senior Contributor III

https://www.nostarch.com/gnumake/  is worth reading.  The free sample chapter on 'pitfalls' of Make may help with your problem.

What is needed is two different Makefiles for the two projects (two different sets of .o's make it two projects) with one parent Makefile.  

0 Kudos

48 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Tom,

What about your project ? Could you please share it or show the steps and errors when you clean

and build .

I made a simple test on my side , build->clean->build. when clean the project, the .o files can

disappear , please have a look at my attachment .

Hope it helps


Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos