bugmake - Bugs: bug #19975, Add function: $(mtime foo.c) ->...

 
 

bug #19975: Add function: $(mtime foo.c) -> 1180203683

Submitted by:  Matt McCutchen <hashproduct>
Submitted on:  Sat 26 May 2007 06:39:58 PM UTC  
Votes:  1  
 
Severity: 3 - NormalItem Group: Enhancement
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
Component Version: 3.81Operating System: None
Fixed Release: NoneTriage Status: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 29 May 2007 03:54:27 PM UTC, comment #3:

That's wonderful news. I'll work on the other parts of the tool for now and revisit the out-of-date criterion once I see the results of the Summer of Code project.

Matt McCutchen <hashproduct>
Tue 29 May 2007 02:31:04 PM UTC, comment #2:

Note that GNU make has received a Google Summer of Code project, to implement the ability for users to customize the "out of date" algorithm used by make. You might consider waiting a couple of months and see what comes of that by the end of the summer. I have high hopes that it will be flexible and powerful enough to provide all the functionality people need to implement various algorithms including things like comparing stored stat(2) info as well as .KEEP_STATE capabilities.

Paul D. Smith <psmith>
Project Administrator
Mon 28 May 2007 04:42:56 PM UTC, comment #1:

Now that the AT&T nmake tool is opensource, you might be better off seeing if that will serve your needs rather than writing something on top of GNU make.

http://www.research.att.com/sw/download/

nmake already remembers the mtime for files and considers the file is out of date if the prerequsites mtime has changed.

It also remembers the values of flags, so if you change say "CFLAGS" (it calls it CCFLAGS for consistency with other languages) then it knows it should recompile everything.

Anonymous
Sat 26 May 2007 06:39:58 PM UTC, original submission:

Please add a function $(mtime) that returns the modification time of a given file as the number of seconds since the Epoch. This would be easy to do because make already caches mtimes.

I am writing a build tool on top of make, and I want it to have a better rule for whether a prerequisite makes a target out of date than make's. Specifically, the tool will remember the prerequisite's mtime when the target was last built and consider the target out of date if the prerequisite's mtime has changed, forward or backward. I want to implement this using a function in the target's prerequisite list that is called during second-expansion, checks the prerequisite's mtime, and expands to FORCE or nothing as appropriate.

The tool doesn't know which files' mtimes it is going to need until make actually gets to those files, so the tool can't easily do any better than getting the mtimes one at a time. Getting each mtime currently requires running a stat(1) process, and doing this for every file checked (not just built) is intolerably slow. The $(mtime) function would make it practical.

Matt McCutchen <hashproduct>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #12873:  make-func-mtime.diff added by hashproduct (1kB - text/x-patch - Attempt at implementing $(mtime) function)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by hashproduct (Voted in favor of this item)
  • -unavailable- added by psmith (Posted a comment)
  • -unavailable- added by hashproduct (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 1 encouragement so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 28 Nov 2009 03:49:50 AM UTChashproductCarbon-Copy-=>Added hashproduct
    Sun 27 May 2007 03:02:06 AM UTChashproductAttached File-=>Added make-func-mtime.diff, #12873

    Back to the top


    Powered by Savane 3.1-cleanup