help-make
[Top][All Lists]
Advanced

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

Re: Getting the relative pathname of an included makefile


From: David Boyce
Subject: Re: Getting the relative pathname of an included makefile
Date: Wed, 8 Feb 2012 10:42:58 -0800

On Wed, Feb 8, 2012 at 6:02 AM, Mason <address@hidden> wrote:
> Is there a simple, easy, natural, etc way to do that?

Unfortunately, no.

> Perhaps some internal MAKE variable, like CURDIR?
> (but CURDIR gives the directory of the main Makefile)
> Or some shell magic?

You might get some useful ideas from https://github.com/boyski/RMCH1
(look for the zip link if not familiar with git). Also,
coincidentally, I just filed an enhancement request
(https://savannah.gnu.org/bugs/index.php?35485) which describes how to
determine the directory of the "current makefile". If you can assume
that these will all be contained underneath a base directory and that
unix path style will be followed, it becomes easy to relativise paths
with subst or patsubst.

You might also want to make use of GMSL (http://gmsl.sourceforge.net/)
which provides a lot of useful macros.

-David Boyce



reply via email to

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