[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to get dir without the trailing '/'?
From: |
Paul Smith |
Subject: |
Re: How to get dir without the trailing '/'? |
Date: |
Thu, 29 Jul 2010 12:49:11 -0400 |
On Thu, 2010-07-29 at 11:20 -0500, Peng Yu wrote:
> $(dir somevariable) gives the directory but with a trailing '/'. I
> could use $(patsubst ) to remove the trailing '/'. But I'm wondering
> what is the best way to get the dir without the trailing character in
> GNU Make?
This was asked just a few days ago. The standard way is:
$(patsubst %/,%,$(dir $(sompath)))
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find some GNU make tips at:
http://www.gnu.org http://make.mad-scientist.net
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist