mingw: Use built-in pwd with -W option for mingw builds

The pwd for mingw has a different output to the pwd shell's built-in pwd.
This change uses the built-in pwd for keep compatibilty with the path
in mingw.

Change-Id: I43d605157e19f661480e68ecbbd024c5f077e461
Signed-off-by: Louise Mendoza <yonattan.a.louise.mendoza@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
Louise Mendoza 2015-12-30 16:17:36 -06:00 committed by Anas Nashif
commit 0c3f05bcd7
2 changed files with 13 additions and 2 deletions

View file

@ -19,6 +19,17 @@ export SOURCE_DIR PROJECT MDEF_FILE
# o Look for make include files relative to root of kernel src
MAKEFLAGS += -rR --include-dir=$(CURDIR)
UNAME := $(shell uname)
ifeq (MINGW, $(findstring MINGW, $(UNAME)))
HOST_OS=MINGW
PWD_OPT=-W
else ifeq (Linux, $(findstring Linux, $(UNAME)))
HOST_OS=Linux
else ifeq (Darwin, $(findstring Darwin, $(UNAME)))
HOST_OS=Darwin
endif
export HOST_OS
# Avoid funny character set dependencies
unexport LC_ALL
LC_COLLATE=C
@ -140,7 +151,7 @@ ifneq ($(KBUILD_OUTPUT),)
# check that the output directory actually exists
saved-output := $(KBUILD_OUTPUT)
KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) \
&& /bin/pwd)
&& pwd $(PWD_OPT))
$(if $(KBUILD_OUTPUT),, \
$(error failed to create output directory "$(saved-output)"))

View file

@ -6,7 +6,7 @@ DQUOTE = "
ARCH ?= x86
PROJECT_BASE ?= $(shell pwd)
PROJECT_BASE ?= $(CURDIR)
O ?= $(PROJECT_BASE)/outdir
# Turn O into an absolute path; we call the main Kbuild with $(MAKE) -C