build: fix application build in symlinked environment

This fixes issues building in a tree which has symlinks in its path,
for some reason PROJECT_BASE ends up having symlinks removed from it
but not ZEPHYR_BASE, causing Python to generate relative paths
with "../.." (for example) in the beginning. This patch ensures both
have symlinks removed before computing SOURCE_DIR.

Change-Id: I3e0688b602a320d7644834b73cde79cfe91cb677
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2015-07-29 13:21:49 -07:00 committed by Anas Nashif
parent be59308978
commit 776d5f7c22
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@ endif
SOURCE_DIR ?= $(PROJECT_BASE)/src/
# Kbuild doesn't work correctly if this is an absolute path
override SOURCE_DIR := $(shell python -c "import os.path; print(\"%s\" % os.path.relpath('$(SOURCE_DIR)', '$(ZEPHYR_BASE)'))")/
override SOURCE_DIR := $(shell python -c "import os.path; print(\"%s\" % os.path.relpath(os.path.realpath('$(SOURCE_DIR)'), os.path.realpath('$(ZEPHYR_BASE)')))")/
export SOURCE_DIR
CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \