> On Jun 22, 2023, at 5:39 PM, David Boyce <david.s.bo...@gmail.com> wrote:
> 
> > DIR := $(shell pwd)
> 
> My only contribution to this is to point out that I believe the above 
> construct, while very common, is unnecessary. The $(CURDIR) variable is 
> defined by the manual to be an absolute path to the current working directory 
> of the make process. Combined with the fact that make has no way to change 
> directories (recipes can cd but make itself cannot, which is a feature), I 
> see no way that invoking a shell and pwd can improve on simply using 
> $(CURDIR).

Ah, $(CURDIR) is even better, since then you don't have to remember to insert 
it in each makefile fragment.

So that sounds like the "obvious" solution unless there's something I'm missing.

--- David A. Wheeler

Reply via email to