On Fri, 12 May 2006, Paul D. Smith wrote:
> %% "Robert P. J. Day" <[EMAIL PROTECTED]> 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
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make