summaryrefslogtreecommitdiffstats
path: root/core/node_fns.mk
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-05 14:34:30 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-05 14:34:30 -0800
commit6a5f7f068b54c5cc083a3e8224c010060aab24e9 (patch)
tree6b58337be26e1026062b3f94217eaeac4b97a21f /core/node_fns.mk
parent88b607994a148f4af5bffee163e39ce8296750c6 (diff)
downloadbuild-6a5f7f068b54c5cc083a3e8224c010060aab24e9.zip
build-6a5f7f068b54c5cc083a3e8224c010060aab24e9.tar.gz
build-6a5f7f068b54c5cc083a3e8224c010060aab24e9.tar.bz2
auto import from //depot/cupcake/@136594
Diffstat (limited to 'core/node_fns.mk')
-rw-r--r--core/node_fns.mk9
1 files changed, 8 insertions, 1 deletions
diff --git a/core/node_fns.mk b/core/node_fns.mk
index 202bb0d..8b026f5 100644
--- a/core/node_fns.mk
+++ b/core/node_fns.mk
@@ -182,8 +182,9 @@ endef
# $(2): makefile representing this node
# $(3): list of node variable names
#
-#TODO: keep a debug stack to make error messages more helpful
+# _include_stack contains the list of included files, with the most recent files first.
define _import-node
+ $(eval _include_stack := $(2) $$(_include_stack))
$(call clear-var-list, $(3))
$(eval include $(2))
$(call copy-var-list, $(1).$(2), $(3))
@@ -196,6 +197,7 @@ define _import-node
$(call _expand-inherited-values,$(1),$(2),$(3))
$(eval $(1).$(2).inherited :=)
+ $(eval _include_stack := $(wordlist 2,9999,$$(_include_stack)))
endef
#
@@ -229,10 +231,15 @@ define import-nodes
$(if \
$(foreach _in,$(2), \
$(eval _node_import_context := _nic.$(1).[[$(_in)]]) \
+ $(if $(_include_stack),$(eval $(error ASSERTION FAILED: _include_stack \
+ should be empty here: $(_include_stack))),) \
+ $(eval _include_stack := ) \
$(call _import-nodes-inner,$(_node_import_context),$(_in),$(3)) \
$(call move-var-list,$(_node_import_context).$(_in),$(1).$(_in),$(3)) \
$(eval _node_import_context :=) \
$(eval $(1) := $($(1)) $(_in)) \
+ $(if $(_include_stack),$(eval $(error ASSERTION FAILED: _include_stack \
+ should be empty here: $(_include_stack))),) \
) \
,)
endef