forked from OSchip/llvm-project
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. llvm-svn: 93715
This commit is contained in:
parent
56e0eb9fc9
commit
2d9816e44b
|
|
@ -37,7 +37,12 @@ help:
|
||||||
@echo " all: build all configurations"
|
@echo " all: build all configurations"
|
||||||
@echo
|
@echo
|
||||||
|
|
||||||
help-hidden: help
|
help-devel: help
|
||||||
|
@echo "Development targets:"
|
||||||
|
@echo " info-functions: list available compiler-rt functions"
|
||||||
|
@echo
|
||||||
|
|
||||||
|
help-hidden: help-devel
|
||||||
@echo "Debugging variables:"
|
@echo "Debugging variables:"
|
||||||
@echo " DEBUGMAKE=1: enable some Makefile logging [default=]"
|
@echo " DEBUGMAKE=1: enable some Makefile logging [default=]"
|
||||||
@echo " =2: enable more Makefile logging"
|
@echo " =2: enable more Makefile logging"
|
||||||
|
|
@ -46,6 +51,14 @@ help-hidden: help
|
||||||
@echo " make-print-FOO: print information on the variable 'FOO'"
|
@echo " make-print-FOO: print information on the variable 'FOO'"
|
||||||
@echo
|
@echo
|
||||||
|
|
||||||
|
info-functions:
|
||||||
|
@echo "compiler-rt Available Functions"
|
||||||
|
@echo
|
||||||
|
@echo "All Functions: $(AvailableFunctions)"
|
||||||
|
@$(foreach fn,$(AvailableFunctions),\
|
||||||
|
printf " %-20s - available in (%s)\n" $(fn)\
|
||||||
|
"$(foreach key,$(AvailableIn.$(fn)),$($(key).Dir))";)
|
||||||
|
|
||||||
# Provide default clean target which is extended by other templates.
|
# Provide default clean target which is extended by other templates.
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean::
|
clean::
|
||||||
|
|
@ -230,3 +243,18 @@ ifneq ($(DEBUGMAKE),)
|
||||||
$(info MAKE: Done processing Makefile)
|
$(info MAKE: Done processing Makefile)
|
||||||
$(info )
|
$(info )
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
###
|
||||||
|
# Function Information
|
||||||
|
#
|
||||||
|
# FIXME: Factor out.
|
||||||
|
|
||||||
|
AvailableObjects := $(sort $(foreach key,$(SubDirKeys),\
|
||||||
|
$($(key).ObjNames)))
|
||||||
|
AvailableFunctions := $(AvailableObjects:%.o=%)
|
||||||
|
|
||||||
|
# Compute lists of where each function is available.
|
||||||
|
$(foreach key,$(SubDirKeys),\
|
||||||
|
$(foreach fn,$(subst .o,,$($(key).ObjNames)),\
|
||||||
|
$(call Append,AvailableIn.$(fn),$(key))))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,11 @@ ifneq ($(DEBUGMAKE),)
|
||||||
$$(info MAKE: $(Dir): Processing subdirectory)
|
$$(info MAKE: $(Dir): Processing subdirectory)
|
||||||
endif
|
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.
|
# Reset subdirectory specific variables to sentinel value.
|
||||||
$$(foreach var,$$(RequiredSubdirVariables) $$(OptionalSubdirVariables),\
|
$$(foreach var,$$(RequiredSubdirVariables) $$(OptionalSubdirVariables),\
|
||||||
$$(call Set,$$(var),UNDEFINED))
|
$$(call Set,$$(var),UNDEFINED))
|
||||||
|
|
@ -63,7 +68,7 @@ include $(1)/Makefile.mk
|
||||||
|
|
||||||
ifeq ($(DEBUGMAKE),2)
|
ifeq ($(DEBUGMAKE),2)
|
||||||
$$(foreach var,$(RequiredSubdirVariables) $(OptionalSubdirVariables),\
|
$$(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 defined), \
|
||||||
$$(info MAKE: $(Dir): $$(var) is undefined)))
|
$$(info MAKE: $(Dir): $$(var) is undefined)))
|
||||||
endif
|
endif
|
||||||
|
|
@ -71,16 +76,20 @@ endif
|
||||||
# Check for undefined required variables, and unset sentinel value from optional
|
# Check for undefined required variables, and unset sentinel value from optional
|
||||||
# variables.
|
# variables.
|
||||||
$$(foreach var,$(RequiredSubdirVariables),\
|
$$(foreach var,$(RequiredSubdirVariables),\
|
||||||
$$(if $$(call strneq UNDEFINED,$$($$(var))), \
|
$$(if $$(call strneq,UNDEFINED,$$($$(var))),, \
|
||||||
$$(error $(Dir): variable '$$(var)' was not undefined)))
|
$$(error $(Dir): variable '$$(var)' was not undefined)))
|
||||||
$$(foreach var,$(OptionalSubdirVariables),\
|
$$(foreach var,$(OptionalSubdirVariables),\
|
||||||
$$(if $$(call strneq UNDEFINED,$$($$(var))),, \
|
$$(if $$(call strneq,UNDEFINED,$$($$(var))),, \
|
||||||
$$(call Set,$$(var),)))
|
$$(call Set,$$(var),)))
|
||||||
|
|
||||||
|
# Collect all subdirectory variables for subsequent use.
|
||||||
|
$$(foreach var,$(RequiredSubdirVariables) $(OptionalSubdirVariables),\
|
||||||
|
$$(call Set,$(DirKey).$$(var),$$($$(var))))
|
||||||
|
|
||||||
# Recurse.
|
# Recurse.
|
||||||
include make/subdir.mk
|
include make/subdir.mk
|
||||||
|
|
||||||
# Restore directory variable.
|
# Restore directory variable, for cleanliness.
|
||||||
$$(call Set,Dir,$(1))
|
$$(call Set,Dir,$(1))
|
||||||
|
|
||||||
ifneq ($(DEBUGMAKE),)
|
ifneq ($(DEBUGMAKE),)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue