From deaaf3200d1f98b8f16b4ddfb325b2c218033d8e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 27 Mar 2013 07:57:41 +0200 Subject: Override out_root if it came exported from recursive make invocation --- build/bootstrap.make | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/build/bootstrap.make b/build/bootstrap.make index 56a7679..44eb57e 100644 --- a/build/bootstrap.make +++ b/build/bootstrap.make @@ -263,7 +263,10 @@ src_base := $(abspath $(dir $(%makefile%))) ifneq ($(src_root),$(src_base)) -ifeq ($(origin out_root),undefined) +# In recursive make invocation, out_root may come from the environment +# in which case we need to override it. +# +ifneq ($(origin out_root),file) out_root := $(abspath $(patsubst \ %$(subst $(src_root)/,,$(src_base)),%,$(CURDIR))) endif @@ -272,7 +275,10 @@ out_base := $(out_root)/$(subst $(src_root)/,,$(src_base)) else -ifeq ($(origin out_root),undefined) +# In recursive make invocation, out_root may come from the environment +# in which case we need to override it. +# +ifneq ($(origin out_root),file) out_root := $(abspath $(CURDIR)) endif -- cgit v1.1