help-make
[Top][All Lists]
Advanced

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

Re: how to get a directory's "full" name?


From: Robert P. J. Day
Subject: Re: how to get a directory's "full" name?
Date: Fri, 12 May 2006 14:16:24 -0400 (EDT)

On Fri, 12 May 2006, Paul D. Smith wrote:

> %% "Robert P. J. Day" <address@hidden> writes:
>
>   rpjd> as part of my multi-arch build, i need to convert a (probably)
>   rpjd> relative directory name to its full name.  that is, if someone
>   rpjd> refers to "..", i need to get the full directory name of ".."
>
>   rpjd> this "function" seems to work:
>
>   rpjd> real-dir = $(shell cd ${1} ; echo $${PWD})
>
> This is not portable; not all shells set or track the PWD
> environment variable.

ah, yes.  well, i could probably get away with:

real-dir = $(shell cd ${1} ; echo $$(pwd))

*that* seems to work, tacky as it is. :-)

>   rpjd> cd to arg, then echo full dir name.  is there a simpler or built-in
>   rpjd> way that's better?
>
> If you're willing to limit your makefiles to newer versions of make
> you can use the $(abspath ...) or $(abspath ...) functions.

you said "abspath" twice.  did you really mean that?  that would seem
to be the obvious solution but i don't think i can enforce the usage
of recent versions of make.  i'll have to check.  thanks.  in any
event, it looks like i have a solution.

rday




reply via email to

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