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

> %% "Aditya Kher" <[EMAIL PROTECTED]> writes:
>
>   >> cd to arg, then echo full dir name.  is there a simpler or built-in
>   >> way that's better?
>
>   ak> the unix command dirname gives the directory name
>   ak> see also basename for getting file name in a similar manner
>
> dirname and basename are simply string munchers: they break up
> strings on "/" etc.  They do NOT evaluate their arguments to find
> fully-qualified pathnames.
>
> In addition, the make functions $(dir ...), $(notdir ...),
> $(basename ...), etc. are much better/faster for this kind of thing,
> as long as you don't need to work on a shell variable.

actually, i'm pretty sure that's *exactly* what i need to do.  in the
context of your multi-arch build, i want the user to be able to
specify the build directory, not based on that funky calculation of
yours, but with a directory name of any acceptable format:

  $ make BUILDDIR=/tmp
  $ make BUILDDIR=subdir       (relative to where i am now)
  $ make BUILDDIR=s1/../s2/../s3

and have all of those work.  i'll take a look at those make functions
but i know that at least i can do it with that hacky macro i posted
earlier.  speed is not a critical factor here.

rday


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to