Bug 958404 - Use tiers for js build. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Mon, 20 Jan 2014 09:11:37 +0900
changeset 164271 17c463691232faa0b4c1c55dc38662b42c70ab09
parent 164270 b528de4b776fb6b87dbeaebca1fa1a7de45512a7
child 164272 c8356a0b4158144bad2b4b6a968b2c6488e62c7f
push id4455
push usercbook@mozilla.com
push dateMon, 20 Jan 2014 11:54:56 +0000
treeherderfx-team@8f8b2d541dbd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs958404
milestone29.0a1
Bug 958404 - Use tiers for js build. r=gps
config/recurse.mk
moz.build
--- a/config/recurse.mk
+++ b/config/recurse.mk
@@ -62,17 +62,18 @@ 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
 
 # Get all directories traversed for all subtiers in the current tier, or use
 # directly the $(*_dirs) variables available in root.mk when there is no
 # TIERS (like for js/src).
-CURRENT_DIRS := $(or $($(CURRENT_TIER)_dirs),$(foreach subtier,$(CURRENT_SUBTIERS),$($(CURRENT_TIER)_subtier_$(subtier))))
+TIER_DIRS = $(or $($(1)_dirs),$(foreach subtier,$($(1)_subtiers),$($(1)_subtier_$(subtier))))
+CURRENT_DIRS := $(call TIER_DIRS,$(CURRENT_TIER))
 
 ifneq (,$(filter binaries libs,$(CURRENT_TIER)))
 WANT_STAMPS = 1
 STAMP_TOUCH = $(TOUCH) $(@D)/binaries
 endif
 
 # Subtier delimiter rules
 $(addprefix subtiers/,$(addsuffix _start/$(CURRENT_TIER),$(CURRENT_SUBTIERS))): subtiers/%_start/$(CURRENT_TIER): $(if $(WANT_STAMPS),$(call mkdir_deps,subtiers/%_start))
@@ -194,22 +195,25 @@ endif # ifdef TIERS
 
 endif # ifeq ($(NO_RECURSE_MAKELEVEL),$(MAKELEVEL))
 
 endif # ifeq (1_.,$(MOZ_PSEUDO_DERECURSE)_$(DEPTH))
 
 ifdef MOZ_PSEUDO_DERECURSE
 ifeq (.,$(DEPTH))
 # top-level directories
-recurse_targets := $(addsuffix /binaries,$(binaries_dirs))
-ifdef recurse_targets
-# only js/src has binaries_dirs, and we want to adjust paths for it.
+ifdef BUILDING_JS
+ifndef JS_STANDALONE
+# Only define recurse_targets for js, when it is built as part of gecko.
+recurse_targets := $(addsuffix /binaries,$(call TIER_DIRS,binaries))
+# we want to adjust paths for js/src.
 want_abspaths = 1
 endif
 endif
+endif
 
 ifdef COMPILE_ENVIRONMENT
 
 # Aggregate all dependency files relevant to a binaries build except in
 # the mozilla top-level directory.
 ifneq (_.,$(recurse_targets)_$(DEPTH))
 ALL_DEP_FILES := \
   $(BINARIES_PP) \
--- a/moz.build
+++ b/moz.build
@@ -6,18 +6,18 @@
 
 CONFIGURE_SUBST_FILES += [
     'config/autoconf.mk',
     'config/emptyvars.mk',
 ]
 
 if CONFIG['BUILDING_JS']:
     if CONFIG['JS_STANDALONE']:
-        DIRS += ['config']
-    DIRS += ['js/src']
+        add_tier_dir('base', ['config'])
+    add_tier_dir('js', ['js/src'])
 else:
     CONFIGURE_SUBST_FILES += [
         'mozilla-config.h',
         'tools/update-packaging/Makefile',
     ]
 
     if CONFIG['ENABLE_CLANG_PLUGIN']:
         add_tier_dir('base', 'build/clang-plugin', external=True)