[Buildroot] [PATCH 2/2] Canonicalize $(BASE_DIR)

Jérôme Pouiller jezz at sysmic.org
Fri Sep 30 10:09:54 UTC 2016


If compilation path contains symlinks, $(*_DIR) variables does not contains
same values depending if user run 'make O=out' or 'make -C out'.

This patch always canonicalize $(BASE_DIR) to avoid this problem.

Signed-off-by: Jérôme Pouiller <jezz at sysmic.org>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 5e4daef..5c907e5 100644
--- a/Makefile
+++ b/Makefile
@@ -136,7 +136,7 @@ endif
 # line doesn't affect the environment of $(shell ..) calls, so
 # explictly throw away any output from 'cd' here.
 export CDPATH :=
-BASE_DIR := $(shell mkdir -p $(O) && cd $(O) >/dev/null && pwd)
+BASE_DIR := $(shell mkdir -p $(O) && cd $(O) >/dev/null && readlink -m .)
 $(if $(BASE_DIR),, $(error output directory "$(O)" does not exist))
 
 
-- 
1.9.1




More information about the buildroot mailing list