RE: BUG?: BASH_ENV as a target-specific variable is inherited by the target's prerequisites even if marked "private"
"Cook, Malcolm" <[email protected]> Mon, 4 Dec 2023 20:10:03 +0000
| Newsgroups | gmane.comp.gnu.make.general |
|---|---|
| Message-ID | <DS7PR20MB467184E29876C2EC9FEF66BFBE86A@DS7PR20MB4671.namprd20.prod.outlook.com> |
> I don't have the answer, but I'm just wondering whether order makes any > difference here: what if you write "export private" > rather than "private export"? I had wondered and tested that too. It does not make a difference. > Might it be that "export" and "private" are just sort of semantic opposites that > don't make sense? Kind of like combining "static extern" in C? > > You can always do this to give a specific command its needed environment > variable: > > BASH_ENV=$(bash_env) recipe command ... > > I.e. have an unexported bash_env variable which is then injected into the > specific command that needs it. You don't even have to make it private, since > the prerequisites don't reference it.