Skip to contentSkip to conversation

mtd-utils: Use $(CURDIR) in place of $(PWD)

PATCH In review Kevin Cernekee 2 participants 2 messages Sep 28, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd-utils: Use $(CURDIR) in place of $(PWD)

$(PWD) comes from the shell and may cause unexpected side effects when using "make -C".

$(CURDIR) is defined internally by GNU make.

---
 Makefile  |    2 +-
 common.mk |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
Makefile +1 -1
index 93661cb..7ab9743 100644
@@ -33,7 +33,7 @@ clean::
 	-rm -f $(SYMLINKS)
 ifneq ($(BUILDDIR)/.git,)
 ifneq ($(BUILDDIR),.)
-ifneq ($(BUILDDIR),$(PWD))
+ifneq ($(BUILDDIR),$(CURDIR))
 	rm -rf $(BUILDDIR)
 endif
 endif
common.mk +2 -2
index be785b4..0444ad9 100644
@@ -26,10 +26,10 @@ INCLUDEDIR=$(PREFIX)/include
 
 ifndef BUILDDIR
 ifeq ($(origin CROSS),undefined)
-  BUILDDIR := $(PWD)
+  BUILDDIR := $(CURDIR)
 else
 # Remove the trailing slash to make the directory name
-  BUILDDIR := $(PWD)/$(CROSS:-=)
+  BUILDDIR := $(CURDIR)/$(CROSS:-=)
 endif
 endif
 override BUILDDIR := $(patsubst %/,%,$(BUILDDIR))
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 6 lines · Kevin Cernekee

$(PWD) comes from the shell and may cause unexpected side effects when using "make -C".

$(CURDIR) is defined internally by GNU make.

Pushed, thanks!

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)