lists wrote:
/prog/Makefile
/prog/apples/Makefile.mk

The /prog/Makefile uses "include apples/Makefile.mk" to call another makefile. I need the apples/Makefile.mk to know where it is. If I use $(shell pwd) I get the location of the root Makefile instead. I'm using Make 3.79.1 (and am stuck with it) so I can't use the MAKEFILE_LIST variable.

Is there a nice way of doing this?

You could always do this:

/prog/Makefile

    INCLUDED = apples/Makefile.mk
    include $(INCLUDED)

/prog/apples/Makefile.mk

    Use $(INCLUDED) to determine what Makefile this is.  Since you
    probably need it to not change do something like:

    I_AM := $(INCLUDED)

    as the first line.

John.
--
John Graham-Cumming
[EMAIL PROTECTED]

Home: http://www.jgc.org/
POPFile: http://getpopfile.org/

Sign up for my Spam and Anti-spam Newsletter
at http://www.jgc.org/

PGP key: http://www.jgc.org/pgp/

LinkedIn: https://www.linkedin.com/profile?viewProfile=&key=1906611


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

Reply via email to