by 0xbadcafebee · 3y ago · 0 comments
It should't happen because make isn't the problem, it's sudo not setting PWD to what you expect by default. This isn't a make bug, it's a sudo bug. Author even explicitly says this. They just prefer to modify make, for.... reasons.
It can.... get it from the environment.... like every application run by every operating system does. PWD is only ever set by a shell. It exports it as an environment variable. Programs can read environment variables passed to them.
A good solution to the problem is for make to set the PWD macro. BSD make already does this.
> It can get if from the environment like every application does
Well no, applications either read an environment variable or use getcwd(2).