help-make
[Top][All Lists]
Advanced

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

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


From: Philip Couling
Subject: What is the logic behind make's handling of symbolic links?
Date: Tue, 21 Oct 2014 14:00:28 +0100

Hi
I was wondering why make treats dangling symbolic links as if they don't
exist?

I've been trying to create a set of links as targets.  The problem I have
is that make's handling of dangling pointers makes this unfortunately
complicated.

It seems that a decision has been taken to treat dangling links as if they
don't exist.  This means that if the referenced file does not exist at the
start of the build process then make will try to re-create the link even if
the build process will create the referenced file.  This results in errors
because ln will not overwrite the link.

Symlinks are a conceptually strange phenomenon and it's clear that handling
them is very application specific:

   - Programs which try to read a link's content will fail if the
   referenced file doesn't exist. (Try cat mylink)
   - Programs' which try to write to a link's content will succeed by
   creating the referenced file if possible.  (Try cp myfile mylink )
   - Programs which list a directory or check for existence will succeed
   and see them as existing. (ls mylink )

So the way that make interprets dangling links seems less standard and has
an identifiable problem.

I was if there was a reason why make has been written to interpret a
dangling link as not existing and for what scenario(s) this helps?

Kind Regards


reply via email to

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