|
-
October 2nd, 2008, 07:38 PM
#1
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
-
October 2nd, 2008, 07:44 PM
#2
Re: recompile every file even without any change
Is there any quick code snippet to get an idea?
ariell
programming is understanding
-
October 2nd, 2008, 11:50 PM
#3
Re: recompile every file even without any change
 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
-
October 3rd, 2008, 04:17 AM
#4
Re: recompile every file even without any change
Check your computer's clock. The make utilities go by time stamp.
What this mean ?
-
October 3rd, 2008, 07:14 AM
#5
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.
-
October 3rd, 2008, 09:28 AM
#6
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.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions 
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|