linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd-utils: Use $(CURDIR) in place of $(PWD)
@ 2010-09-28  0:22 Kevin Cernekee
  2010-09-28  6:48 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Cernekee @ 2010-09-28  0:22 UTC (permalink / raw)
  To: dedekind1; +Cc: linux-mtd

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

$(CURDIR) is defined internally by GNU make.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
---
 Makefile  |    2 +-
 common.mk |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 93661cb..7ab9743 100644
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ clean::
 	-rm -f $(SYMLINKS)
 ifneq ($(BUILDDIR)/.git,)
 ifneq ($(BUILDDIR),.)
-ifneq ($(BUILDDIR),$(PWD))
+ifneq ($(BUILDDIR),$(CURDIR))
 	rm -rf $(BUILDDIR)
 endif
 endif
diff --git a/common.mk b/common.mk
index be785b4..0444ad9 100644
--- a/common.mk
+++ b/common.mk
@@ -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))
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mtd-utils: Use $(CURDIR) in place of $(PWD)
  2010-09-28  0:22 [PATCH] mtd-utils: Use $(CURDIR) in place of $(PWD) Kevin Cernekee
@ 2010-09-28  6:48 ` Artem Bityutskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2010-09-28  6:48 UTC (permalink / raw)
  To: Kevin Cernekee; +Cc: linux-mtd

On Mon, 2010-09-27 at 17:22 -0700, Kevin Cernekee wrote:
> $(PWD) comes from the shell and may cause unexpected side effects when
> using "make -C".
> 
> $(CURDIR) is defined internally by GNU make.
> 
> Signed-off-by: Kevin Cernekee <cernekee@gmail.com>

Pushed, thanks!

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-28  6:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-28  0:22 [PATCH] mtd-utils: Use $(CURDIR) in place of $(PWD) Kevin Cernekee
2010-09-28  6:48 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).