Re: Which behavior is expected of $(shell )

Changqing Li <[email protected]>
Newsgroups gmane.comp.gnu.make.general
Message-ID <[email protected]>
On 11/22/22 12:08, Paul Smith wrote:
> CAUTION: This email comes from a non Wind River email account!
> Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
> 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.

Thanks a lot.

Changqing
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.