help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Which behavior is expected of $(shell )


From: Paul Smith
Subject: Re: Which behavior is expected of $(shell )
Date: Mon, 21 Nov 2022 23:08:38 -0500
User-agent: Evolution 3.46.1 (by Flathub.org)

On Tue, 2022-11-22 at 11:12 +0800, Changqing Li wrote:
> Here is what the make manual says,
> 
> 6.10 Variables from the Environment

It's not really related to this section.  It's related to how the shell
function works.  From that section of the manual we see:

| All variables that are marked as export will also be passed to the
| shell started by the shell function.

In your example, KBUILD_OUTPUT is coming from the environment, and all
variables imported from the environment automatically exported.  So,
the value of the KBUILD_OUTPUT variable set in the makefile is exported
to the shell function.

However, this behavior is new in GNU make 4.4.

> the value in shell environment like what 4.3  done. But I don't find 
> which commit or bug ID is for fixing this issue,  so I send this mail
> to double check with the exports at this. Thanks a lot.

See this from the NEWS file for GNU make 4.4:

https://git.savannah.gnu.org/cgit/make.git/tree/NEWS?h=4.4&id=ed493f6c9116cc217b99c2cfa6a95f15803235a2#n74

> * WARNING: Backward-incompatibility!
>   Previously makefile variables marked as export were not exported to commands
>   started by the $(shell ...) function.  Now, all exported variables are
>   exported to $(shell ...).

This is the reason for the difference in behavior you see.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]