$(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>
-rm -f $(SYMLINKS)
ifneq ($(BUILDDIR)/.git,)
ifneq ($(BUILDDIR),.)
-ifneq ($(BUILDDIR),$(PWD))
+ifneq ($(BUILDDIR),$(CURDIR))
rm -rf $(BUILDDIR)
endif
endif
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))