[Top][All Lists]

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

Re: how to use not "also" symbolic link time, but "only"

From: Bryan Ischo
Subject: Re: how to use not "also" symbolic link time, but "only"
Date: Fri, 13 Apr 2012 10:05:27 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120314 Thunderbird/11.0

On 04/13/12 09:47, Mark Galeck (CW) wrote:
It seems to me this is a natural thing to do, and it seems to me there is no way to do it?

I think many people, myself included, avoid using symlinks for reasons like this. As unusual file system constructs with unusual usage semantics, they tend to cause problems when they are used in any but the most simple ways. Not only that, they're highly non-portable.

I realize that doesn't help you if you absolutely need to create symlinks using make for some reason, but I hope you might at least consider whether or not managing symlinks is really a job you want to leave to make, or even be doing at all as part of your build process.

I personally use commands like this sometimes:

from: $(MAKEFILE)
          ln -sf to $@ >/dev/null 2>&1

All this does is prevent me from seeing the unnecessary 'ln' command executions, which has the disadvantage of hiding errors that could legitimately occur, but at least I can forget about this little wart rule and never be bothered by it again.

In my particular case, I have rules for creating directories on-demand, and those rules were difficult to work in a way that didn't sometimes 'mkdir' a directory that already existed. It was easier to just send the mkdir output to null and never worry about it. I am sure that occasionally I am wasting some CPU by running a mkdir command, but it would be impossible for me to perceive it since these commands run so fast.


reply via email to

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