CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2008
    Posts
    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

  2. #2
    Join Date
    Oct 2008
    Location
    Tel Aviv, Berlin, L.A.
    Posts
    23

    Re: recompile every file even without any change

    Is there any quick code snippet to get an idea?
    ariell
    programming is understanding

  3. #3
    Join Date
    Apr 1999
    Posts
    27,449

    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

  4. #4
    Join Date
    Apr 2007
    Location
    Mars NASA Station
    Posts
    1,436

    Re: recompile every file even without any change

    Check your computer's clock. The make utilities go by time stamp.
    What this mean ?

  5. #5
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    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.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  6. #6
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    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
  •  





Click Here to Expand Forum to Full Width

Featured