recompile every file even without any change
hi c++ gurus,
My old Makefile works fine.
Recently, I added link to a library into my Makefile. The problem now is that the code always recompile every file even if nothing changed. Something must be wrong in my Makefile.
The dependency looks fine to me.
Is there any quick thought on what would be the problem?
Thanks a lot for your inputs!
Jia
Re: recompile every file even without any change
Is there any quick code snippet to get an idea?
Re: recompile every file even without any change
Quote:
Originally Posted by tangjia24
Is there any quick thought on what would be the problem?]
Check your computer's clock. The make utilities go by time stamp.
Regards,
Paul McKenzie
Re: recompile every file even without any change
Quote:
Check your computer's clock. The make utilities go by time stamp.
What this mean ?
Re: recompile every file even without any change
Checks the timestamp of files against the timestamp of the output file. If a source has newer timestamp, it's rebuild. If the timestamp is from the future, that is always rebuild, until that date is reached.
Re: recompile every file even without any change
Timestamps are usually the problem. Many times this is caused by a circular dependency.
1) B depends on A
2) C depends on B - AND Modifies A!
Thie will rebuild A,B,C EVERY time it is run.
Many Make programs have a switch (option) to display the dependency calculations as they are performed. If your tool has this feature it can help diagnose the problem, by explicitly telling you which dependency is triggering each build.