Bug 1262241 - Add a build system mode that prints out how directories are recursed. r?mshal draft
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 04 Apr 2017 14:02:45 +0900
changeset 555382 ccb75d247b1dc379a7a6c91dad3ff433300b7969
parent 555363 f96834ed8133d401db485e7ac25af59c6a04d7a1
child 555383 2d1f14026d1c35e1530335a073743538fd41d98e
push id52231
push userbmo:mh+mozilla@glandium.org
push dateTue, 04 Apr 2017 07:03:18 +0000
reviewersmshal
bugs1262241
milestone55.0a1
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
config/recurse.mk
--- 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