[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Which make-related variables are passed to subprocesses
From: |
Paul Smith |
Subject: |
Re: Which make-related variables are passed to subprocesses |
Date: |
Fri, 20 Apr 2018 22:53:24 -0400 |
On Fri, 2018-04-20 at 23:33 +0200, Sébastien Hinderer wrote:
> Well, perhaps the way I designed things is wrong, but it turns out that
> in my case it would make a lot of sense. I am developiing a test driver
> which needs to invoke make to build some tests. Ideally it should invoke
> the same make that was used to invoke it, that's why having the MAKE
> variable would be useful. Well I passed it explicitly to things do work
> now.
If you need to run a program that needs to invoke make, then yes you
should pass it explicitly to that program. Or you can ask make to
export the MAKE variable by adding:
export MAKE
to your makefile.
Normally, sub-makes are invoked directly, like:
recurse:
$(MAKE) -C subdir
or whatever. In this situation there's no need for the MAKE variable
to be added to the environment of the sub-process by default.