help-make
[Top][All Lists]
Advanced

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

Re: Fwd: What is the logic behind make's handling of symbolic links?


From: Paul Smith
Subject: Re: Fwd: What is the logic behind make's handling of symbolic links?
Date: Wed, 22 Oct 2014 10:07:15 -0400

On Wed, 2014-10-22 at 13:03 +0100, Philip Couling wrote:
> I disagree with the idea that a dangling symlink "does not exist".  This is
> an oversimplification and glosses over the distinction between a file's
> name and a file's content.  I've not see an operating system which doesn't
> recognize this distinction since DOS .  More accurately then; a dangling
> symlink can be thought of as a file name which does exist but who's content
> is missing.

You're correct that make doesn't care about the contents of files, but
you're incorrect when you say that make is only concerned with the NAMES
of files.  Make is primarily concerned with the _MODIFICATION TIMES_ of
files.  Make decides when a file is newer or older by checking its
modification time.  The name of the file is only useful to make insofar
as it allows make to find the target's modification time.

A file that doesn't exist does not have a modification time, and so make
always considers that file to be out of date and rebuilds it.

That's the short and simple answer, which I think explains all of make's
behaviors related to symlinks.

However, if you would prefer to have make consider symbolic links (and
your version of GNU make is new enough) you can try this option, from
the GNU make manual:

`-L'
`--check-symlink-times'
     On systems that support symbolic links, this option causes `make'
     to consider the timestamps on any symbolic links in addition to the
     timestamp on the file referenced by those links.  When this option
     is provided, the most recent timestamp among the file and the
     symbolic links is taken as the modification time for this target
     file.





reply via email to

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