List Info

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




how to get a directory's "full" name?
user name
2006-05-12 18:16:24
On Fri, 12 May 2006, Paul D. Smith wrote:

> %% "Robert P. J. Day" <rpjdaymindspring.com> 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 $ ; echo $$)
>
> 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 $ ; 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


_______________________________________________
Help-make mailing list
Help-makegnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make
how to get a directory's "full" name?
user name
2006-05-12 18:27:32
%% "Robert P. J. Day" <rpjdaymindspring.com> writes:

  >> If you're willing to limit your makefiles to
newer versions of make
  >> you can use the $(abspath ...) or $(abspath ...)
functions.

  rpjd> you said "abspath" twice.  did you
really mean that?

Sorry: realpath and abspath.

-- 
------------------------------------------------------------
-------------------
 Paul D. Smith <psmithgnu.org>          Find
some GNU make tips at:
 http://www.gnu.org        
             http://make.paulandlesl
ey.org
 "Please remain calm...I may be mad, but I am a
professional." --Mad Scientist


_______________________________________________
Help-make mailing list
Help-makegnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )