Bug 1262241 - Add a build system mode that prints out how directories are recursed. r?mshal
Run with:
make -C objdir target RECURSE_TRACE_ONLY=1
--- a/config/recurse.mk
+++ b/config/recurse.mk
@@ -55,33 +55,35 @@ CURRENT_TIER := $(subst recurse_,,$(CURR
ifdef CURRENT_TIER
ifeq (0,$(MAKELEVEL))
export NO_RECURSE_MAKELEVEL=1
else
export NO_RECURSE_MAKELEVEL=$(word $(MAKELEVEL),2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20)
endif
endif
+RECURSE = $(if $(RECURSE_TRACE_ONLY),@echo $2/$1,$(call SUBMAKE,$1,$2))
+
# Use the $(*_dirs) variables available in root.mk
CURRENT_DIRS := $($(CURRENT_TIER)_dirs)
# Need a list of compile targets because we can't use pattern rules:
# https://savannah.gnu.org/bugs/index.php?42833
# Only recurse the paths starting with RECURSE_BASE_DIR when provided.
.PHONY: $(compile_targets)
$(compile_targets):
- $(if $(filter $(RECURSE_BASE_DIR)%,$@),$(call SUBMAKE,$(@F),$(@D)))
+ $(if $(filter $(RECURSE_BASE_DIR)%,$@),$(call RECURSE,$(@F),$(@D)))
# The compile tier has different rules from other tiers.
ifneq ($(CURRENT_TIER),compile)
# Recursion rule for all directories traversed for all subtiers in the
# current tier.
$(addsuffix /$(CURRENT_TIER),$(CURRENT_DIRS)): %/$(CURRENT_TIER):
- $(call SUBMAKE,$(CURRENT_TIER),$*)
+ $(call RECURSE,$(CURRENT_TIER),$*)
.PHONY: $(addsuffix /$(CURRENT_TIER),$(CURRENT_DIRS))
# Dummy rules for possibly inexisting dependencies for the above tier targets
$(addsuffix /Makefile,$(CURRENT_DIRS)) $(addsuffix /backend.mk,$(CURRENT_DIRS)):
ifeq ($(CURRENT_TIER),export)
# At least build/export requires config/export for buildid, but who knows what