bug-make
[Top][All Lists]
Advanced

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

%/. Pattern request.


From: ab wilson
Subject: %/. Pattern request.
Date: Tue, 17 Feb 2009 10:50:33 -0000

Hi,

I'm sending this to the bug list because I can't seem to get into
Savannah at the moment. Anyway this is not a bug, and not a request for
a feature, but rather a request that an existing feature is retained.

There's a common technique that used to be required to get make to
create directories. In the days before order only dependencies you
couldn't add a target's parent directory as a prerequisite since that
would make the target always be out of date. The usual solution is to
use a dummy file and a pattern rule. Something like this:

$(path_to)/target: $$(@D)/.mkdir

%/.mkdir:
        mkdir -p $@

This works nicely apart from were to have to create the directories for
export - ie you want to create a distribution and tar it up - in which
case you don't really want all the .mkdir files hanging around. But now
since the addition of order only dependencies you don't need to do this.
The only problem is coming up with a pattern rule to use for
directories. %/ doesn't work since make seems to strip trailing path
separators. However %/. works just fine. Ie

$(path_to)/target: $$(@D)/.

%/.:
        mkdir -p $@

This is a request directed mainly to Paul D. Smith that this feature is
not optimised away in some future version of make.




The content of this e-mail is confidential and may be privileged. It may be 
read, copied and used only by the intended recipient and may not be disclosed, 
copied or distributed. If you received this email in error, please contact the 
sender immediately by return e-mail or by telephoning +44 20 7260 2000, delete 
it and do not disclose its contents to any person. You should take full 
responsibility for checking this email for viruses. Markit reserves the right 
to monitor all e-mail communications through its network.
Markit and its affiliated companies make no warranty as to the accuracy or 
completeness of any information contained in this message and hereby exclude 
any liability of any kind for the information contained herein. Any opinions 
expressed in this message are those of the author and do not necessarily 
reflect the opinions of Markit.
For full details about Markit, its offerings and legal terms and conditions, 
please see Markit's website at http://www.markit.com <http://www.markit.com/> .




reply via email to

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