summaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-01-18 06:48:40 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-01-18 06:48:40 +0000
commit9edf5cdd69d2d2a74b37ec14e475c5d6367e6eec (patch)
treecdd1b559532b294398b9e97a24e57ccb5a950c0b /make
parentfaf0150036689985ecea64e78f2637093857cd7b (diff)
Change subdir traversal to primarily cache information about what is available in subdirectories.
- Rest of makefiles will move to using the information after it has been computed, instead of during subdir traversal. Also, add 'make info-functions' target, which prints information on all the functions available in compiler-rt. Also, add 'make help-devel' for listing help on targets intended for compiler-rt developers or direct users. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@93715 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'make')
-rw-r--r--make/subdir.mk17
1 files changed, 13 insertions, 4 deletions
diff --git a/make/subdir.mk b/make/subdir.mk
index ccde0dc8d..cf767f876 100644
--- a/make/subdir.mk
+++ b/make/subdir.mk
@@ -54,6 +54,11 @@ ifneq ($(DEBUGMAKE),)
$$(info MAKE: $(Dir): Processing subdirectory)
endif
+# Construct the variable key for this directory.
+$(call Set,DirKey,SubDir.$(subst .,,$(subst /,__,$(1))))
+$(call Append,SubDirKeys,$(DirKey))
+$(call Set,$(DirKey).Dir,$(Dir))
+
# Reset subdirectory specific variables to sentinel value.
$$(foreach var,$$(RequiredSubdirVariables) $$(OptionalSubdirVariables),\
$$(call Set,$$(var),UNDEFINED))
@@ -63,7 +68,7 @@ include $(1)/Makefile.mk
ifeq ($(DEBUGMAKE),2)
$$(foreach var,$(RequiredSubdirVariables) $(OptionalSubdirVariables),\
- $$(if $$(call strneq UNDEFINED,$$($$(var))), \
+ $$(if $$(call strneq,UNDEFINED,$$($$(var))), \
$$(info MAKE: $(Dir): $$(var) is defined), \
$$(info MAKE: $(Dir): $$(var) is undefined)))
endif
@@ -71,16 +76,20 @@ endif
# Check for undefined required variables, and unset sentinel value from optional
# variables.
$$(foreach var,$(RequiredSubdirVariables),\
- $$(if $$(call strneq UNDEFINED,$$($$(var))), \
+ $$(if $$(call strneq,UNDEFINED,$$($$(var))),, \
$$(error $(Dir): variable '$$(var)' was not undefined)))
$$(foreach var,$(OptionalSubdirVariables),\
- $$(if $$(call strneq UNDEFINED,$$($$(var))),, \
+ $$(if $$(call strneq,UNDEFINED,$$($$(var))),, \
$$(call Set,$$(var),)))
+# Collect all subdirectory variables for subsequent use.
+$$(foreach var,$(RequiredSubdirVariables) $(OptionalSubdirVariables),\
+ $$(call Set,$(DirKey).$$(var),$$($$(var))))
+
# Recurse.
include make/subdir.mk
-# Restore directory variable.
+# Restore directory variable, for cleanliness.
$$(call Set,Dir,$(1))
ifneq ($(DEBUGMAKE),)