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: Mason
Subject: Re: Getting the relative pathname of an included makefile
Date: Thu, 09 Feb 2012 17:13:33 +0100
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0) Gecko/20120129 Firefox/10.0 SeaMonkey/2.7

David Boyce wrote:

> Mason wrote:
> 
>> Is there a simple, easy, natural, etc way to get the
>> relative pathname of an included makefile?
> 
> Unfortunately, no.

In my opinion, the solution you gave below qualifies ;-)

>> Perhaps some internal MAKE variable, like CURDIR?
> 
> 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.

MODULE := $(dir $(lastword $(MAKEFILE_LIST)))
is just what I was looking for, thanks!

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

-- 
Regards.



reply via email to

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