[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: May I use a _directory_ as a prerequisite?

From: Paul D. Smith
Subject: Re: May I use a _directory_ as a prerequisite?
Date: Fri, 30 Apr 2004 01:13:03 -0400

%% Eric Hanchrow <address@hidden> writes:

  eh> The question is: can I depend upon this behavior?  That is, can I
  eh> depend upon `make' reading the last-mod time of a directory?  The
  eh> documentation doesn't say anything about this; it only refers to
  eh> prerequisites as files.

Make treats all targets and prerequisites the same way: it uses their
time-last-modified stamp.

So, assuming your directories do have one, the behavior you'll get if
you use a directory as a prerequisite depends on how your filesystem
handles the TLM stamp on directories.

On all UNIX filesystems I'm aware of, the TLM of the directory changes
whenever the directory itself changes; that is, whenever a
file/directory is added, removed, or renamed the TLM of its parent
directory will change.

If that is the behavior you want, then you win! :).

I don't know the behavior of Microsoft filesystems like DOS and NTFS in
this area.

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

reply via email to

[Prev in Thread] Current Thread [Next in Thread]