3 ms·
I would say it is a make bug in that POSIX make has no good way to get PWD. Not necessarily a bug even, but an annoyance.
by phoebos 4y ago
I would say it is a make bug in that POSIX make has no good way to get PWD. Not necessarily a bug even, but an annoyance.
- 0xbadcafebee 4y ago> POSIX make has no good way to get PWD 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.
- phoebos 4y agoAs you noted, I said that the problems stems from sudo not setting PWD, hence `sudo make` doesn't inherit PWD. I'm not calling that a bug in sudo, but it was a bug in the specific makefile which assumed PWD to be set always. 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).