]> www.infradead.org Git - mtd-utils.git/commitdiff
mtd-utils: Use $(CURDIR) in place of $(PWD)
authorKevin Cernekee <cernekee@gmail.com>
Tue, 28 Sep 2010 00:22:04 +0000 (17:22 -0700)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 28 Sep 2010 06:47:14 +0000 (09:47 +0300)
$(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>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Makefile
common.mk

index 93661cb563ba09396ee68848190c3fc4ae981935..7ab97430c28db0f5dd9a7897bb990df6cfd279a5 100644 (file)
--- 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
index be785b4a827b41de48783e83334be444fe0e6d11..0444ad93b545d0a99be41607cb2e974bb2dda94b 100644 (file)
--- 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))