paulsm4 |
11-22-2010 12:20 AM |
Hi -
Just to clarify what's already been said:
Quote:
I am using makefile to complile all C Programming files. But certain files are not getting compiled and hence its object file is not getting generated. This is happening due to files haven't been modified for a long time. It seems that compiler knows that its object file is there hence no need to complie it actually it is not.
|
Yes. Exactly. That's one of the main BENEFITS of using "make", is that it DOESN'T recompile the world - it only does what's necessary. And, in this case, it looks like "make" believed (probably correctly!) that it didn't NEED to recompile most of your object files. That's a Good Thing :)
Quote:
Did you try "make clean"?
|
Quote:
Q: But I want to know the reason why it happens
|
Simple: if your source file is NEWER than the object (or, more precisely, if the "target" is older than its "dependency") then no action is needed.
It's a standard convention to have a "clean" target in any makefile, so you can FORCE recompilation if you wish to.
Quote:
Also, you can try running "rm *.o" in all subdirectories where .o files are
|
This is what "make clean" typically does.
|