[Top][All Lists]

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

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

From: Mark Galeck (CW)
Subject: how to use not "also" symbolic link time, but "only"
Date: Fri, 13 Apr 2012 09:07:21 -0700


If I have a target that is a soft symlink, the natural way to write the rule 
would be:

MAKEFILE := $(lastword $(MAKEFILE_LIST))

from: $(MAKEFILE)
        ln -sf to $@

Except it does not work, if Makefile changes and becomes newer than "to", 
"from" is rebuilt all the time.  I want to only consider the timestamp of the 
link file, not in addition to the timestamp of the linked file, but instead of. 

How to do this?  Clearly it has to depend on the Makefile, since if you change 
the rule to a different "to" file, the link must rebuild.  But that also causes 
it to always rebuild.

How to correctly write a rule for a symlink?  


reply via email to

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