> Date: Sat, 19 May 2007 10:34:08 +0300
> From: "Yakov Lerner" <[EMAIL PROTECTED]>
> 
> How can I reference the directory where the currently executed Makefile
> resides (like what $(dirname $0) is in bash ) ?

Does ${CURDIR} do what you want?

> Here is what I am trying to do:
> 
> 1. In the same dir of Makefile, there is a "submakefile" that I need to
> include ("include submakefile").
> 
> 2. When my cwd is same where Makefile resides, then no problem:
> 'include submakefile' works.
> 
> 3. But when I am in different dir, then make does not find the
> submakefile. Is there any builtin variable for the directory of
> the current Makefile (like `dirname $0` in shell) ?, so I can write
> something line
>            include $(DIR_OF_MAKEFILE)/submakefile
> ?

If CURDIR is not what you want, perhaps this will:

  DIR_OF_MAKEFILE := $(shell pwd)


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

Reply via email to