Makefile: Don't trust PWD
PATCH v2 1/1 Makefile: Don't trust PWD
PWD comes from the environment and it's possible that it's already set to something which isn't the full path of the current working directory. Use the make variable $(CURDIR) instead.
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -119,7 +119,7 @@ cscope: cscope_dirs = lib lib/libfdt lib/linux $(TEST_DIR) $(ARCH_LIBDIRS) lib/a cscope: $(RM) ./cscope.* find -L $(cscope_dirs) -maxdepth 1 \ - -name '*.[chsS]' -exec realpath --relative-base=$(PWD) {} \; | sort -u > ./cscope.files + -name '*.[chsS]' -exec realpath --relative-base=$(CURDIR) {} \; | sort -u > ./cscope.files cscope -bk .PHONY: tags
Signature · 1 line
2.31.1
Quoted 16 lines · Andrew Jones
PWD comes from the environment and it's possible that it's already set to something which isn't the full path of the current working directory. Use the make variable $(CURDIR) instead.
Suggested-by Thomas Huth <[email protected]>Signed-off-by Andrew Jones <[email protected]>--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Makefile +0
-0
Makefile cscope: cscope_dirs = lib lib/libfdt lib/linux $(TEST_DIR) $(ARCH_LIBDIRS) lib/a · line 125
Quoted 8 lines
Makefile +1
-1@@ -119,7 +119,7 @@ cscope: cscope_dirs = lib lib/libfdt lib/linux $(TEST_DIR) $(ARCH_LIBDIRS) lib/a cscope: $(RM) ./cscope.* find -L $(cscope_dirs) -maxdepth 1 \ - -name '*.[chsS]' -exec realpath --relative-base=$(PWD) {} \; | sort -u > ./cscope.files + -name '*.[chsS]' -exec realpath --relative-base=$(CURDIR) {} \; | sort -u > ./cscope.files cscope -bk .PHONY: tags
Perfect for me, works as expected on Z.
Signature · 2 lines
Pierre Morel IBM Lab Boeblingen
Quoted 16 lines · Andrew Jones
PWD comes from the environment and it's possible that it's already set to something which isn't the full path of the current working directory. Use the make variable $(CURDIR) instead.
Suggested-by Thomas Huth <[email protected]>Signed-off-by Andrew Jones <[email protected]>--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Makefile +0
-0
Makefile cscope: cscope_dirs = lib lib/libfdt lib/linux $(TEST_DIR) $(ARCH_LIBDIRS) lib/a · line 125
Quoted 8 lines
Makefile +1
-1@@ -119,7 +119,7 @@ cscope: cscope_dirs = lib lib/libfdt lib/linux $(TEST_DIR) $(ARCH_LIBDIRS) lib/a cscope: $(RM) ./cscope.* find -L $(cscope_dirs) -maxdepth 1 \ - -name '*.[chsS]' -exec realpath --relative-base=$(PWD) {} \; | sort -u > ./cscope.files + -name '*.[chsS]' -exec realpath --relative-base=$(CURDIR) {} \; | sort -u > ./cscope.files cscope -bk .PHONY: tags
Andrew Jones
AppliedQuoted 26 lines · Andrew Jones
PWD comes from the environment and it's possible that it's already set to something which isn't the full path of the current working directory. Use the make variable $(CURDIR) instead.
Suggested-by Thomas Huth <[email protected]>Signed-off-by Andrew Jones <[email protected]>--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Makefile +1
-1@@ -119,7 +119,7 @@ cscope: cscope_dirs = lib lib/libfdt lib/linux $(TEST_DIR) $(ARCH_LIBDIRS) lib/a cscope: $(RM) ./cscope.* find -L $(cscope_dirs) -maxdepth 1 \ - -name '*.[chsS]' -exec realpath --relative-base=$(PWD) {} \; | sort -u > ./cscope.files + -name '*.[chsS]' -exec realpath --relative-base=$(CURDIR) {} \; | sort -u > ./cscope.files cscope -bk .PHONY: tagsSignature · 1 line
2.31.1
Applied to misc/queue and merged to master.
Thanks,
drew