Makefile.in: Export $MAKE
to be used by other scripts
#9164
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
GNU make is sometimes installed as
gmake
andmake
points to another implementation that does not support GNU make extensions.The name of the make command is stored in
$(MAKE)
and sub-make processes automatically inherit and use this variable. However other executed commands and scripts do not get this variable by default. Therefore of a script tries to call make(1) again, it will either not find this value or, more likely, will hard-codemake
.How
The top-level Makefile now exports the value of
$(MAKE)
into the environment of all executed sub-shells. This way, scripts can use the correct make command name if they need to run make(1) again.An example fixed in this patch is
make/test_target_script.sh
. It used to hard-codemake
and now uses$MAKE
passed from the parent make instance.