summaryrefslogtreecommitdiff
path: root/Makefile.inc
diff options
context:
space:
mode:
authorAndrew Boie <andrew.p.boie@intel.com>2015-07-22 16:15:43 -0700
committerAnas Nashif <anas.nashif@intel.com>2016-02-05 20:14:41 -0500
commitca12bbb569eaaddf0c0dcbd1a1731d18506fe891 (patch)
tree4e0ecdcc5dea62e2c5fe42049926ed24adcd532f /Makefile.inc
parent96726f0a588eee91bcb7dc1918ec96007d0b72ab (diff)
fix issue where two outdirs are created
O was getting passed along to the main Kbuild Make session which is called with -C. If O was a relative path, the outdir would effectively become $(ZEPHYR_BASE)/$(O) which is not what we want. Change-Id: I148539490ecfc2d4e84a0fdf3e3dd1ab24503633 Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Diffstat (limited to 'Makefile.inc')
-rw-r--r--Makefile.inc5
1 files changed, 5 insertions, 0 deletions
diff --git a/Makefile.inc b/Makefile.inc
index ce772ba96..84b9b75a3 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -2,6 +2,11 @@ PROJECT_BASE ?= $(shell pwd)
ARCH?=x86
O ?= $(PROJECT_BASE)/outdir
+# Turn O into an absolute path; we call the main Kbuild with $(MAKE) -C
+# which changes the working directory, relative paths don't work right.
+# Need to create the directory first to make readlink happy
+$(shell mkdir -p $(O))
+override O := $(shell readlink -f $(O))
export ARCH MDEF_FILE QEMU_EXTRA_FLAGS PROJECT_BASE