From 0c3f05bcd739d6674b4c99c2bb5f3b0cc1eb1127 Mon Sep 17 00:00:00 2001 From: Louise Mendoza Date: Wed, 30 Dec 2015 16:17:36 -0600 Subject: [PATCH] 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 Signed-off-by: Anas Nashif --- Makefile | 13 ++++++++++++- Makefile.inc | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 091bb0b82ce..812622df16c 100644 --- a/Makefile +++ b/Makefile @@ -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)")) diff --git a/Makefile.inc b/Makefile.inc index f8a980bd4fe..a99b6cc59b5 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -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