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.

_______________________________________________
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to