Makefile: Don't trust PWD
PATCH 1/1 Makefile: Don't trust PWD
It's possible that PWD is already set to something which isn't the full path of the current working directory. Let's make sure it is.
--- Makefile | 1 + 1 file changed, 1 insertion(+)
Makefile +1 -0
@@ -1,4 +1,5 @@ SHELL := /usr/bin/env bash +PWD := $(shell pwd) ifeq ($(wildcard config.mak),) $(error run ./configure first. See ./configure -h)
Signature · 1 line
2.31.1
Quoted 14 lines · Andrew Jones
It's possible that PWD is already set to something which isn't the full path of the current working directory. Let's make sure it is.
Signed-off-by Andrew Jones <[email protected]>--- Makefile | 1 + 1 file changed, 1 insertion(+)Makefile +0
-0
Makefile line 2
Quoted 2 lines
Makefile +1
-0@@ -1,4 +1,5 @@ SHELL := /usr/bin/env bash +PWD := $(shell pwd)
I think we should rather use $(CURDIR) in Makefiles instead, since this is the official way that GNU Make handles the current working directory.
By the way, is this cscope thing also supposed to work in out-of-tree builds?
Thomas
Quoted 10 lines · Thomas Huth
Quoted 9 lines · Andrew Jones
It's possible that PWD is already set to something which isn't the full path of the current working directory. Let's make sure it is.
Signed-off-by Andrew Jones <[email protected]>--- Makefile | 1 + 1 file changed, 1 insertion(+)
Quoted 10 lines
Makefile line 2
Quoted 7 lines
Makefile +1
-0@@ -1,4 +1,5 @@ SHELL := /usr/bin/env bash +PWD := $(shell pwd)I think we should rather use $(CURDIR) in Makefiles instead, since this is the official way that GNU Make handles the current working directory.
Agreed. I'll send a v2.
Quoted 2 lines
By the way, is this cscope thing also supposed to work in out-of-tree builds?
I personally don't care if it works from the out-of-tree build dir. I generally want to be able to use git commands while browsing code too, so I won't be running cscope anywhere but in a repo with a checked-out working tree.
Thanks,
drew