[Top][All Lists]

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

Re: Which behavior is expected of $(shell )

From: Changqing Li
Subject: Re: Which behavior is expected of $(shell )
Date: Tue, 22 Nov 2022 13:56:36 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

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:

* 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.


reply via email to

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