build/moz-automation.mk
author Simon Sapin <simon.sapin@exyr.org>
Tue, 06 Jun 2017 08:13:39 -0700
changeset 1150023 c6508a9f0fb5f1648b37f299be7f3e481cb26c31
parent 1091260 7086da6987e0dee0aa28e27ec5659c6786a21735
child 1097955 fd3fc2235592f893268b68705792a7155d72f1dd
child 1113043 d0aa3139f79bb873bbe8a541fae341554f58c75e
child 1113096 fe0c1559eafb57beb01c9d7745652d7635ee09da
child 1118550 1ba7a9f2dd70018e166677014305935b6e068ff1
child 1174970 4987b6f437995f63e744c5ea435db55f63997fa2
child 1201863 a5944a5aed51eb35771fec8874c6f4ae32c696ea
child 1272385 c94683ffb6fb4ce80eb77a0bc8239f62f669a624
child 1272565 a386e86a28c8713fe1f812b949bfaa8dc4f5c572
child 1276062 f7a1c0b962495150fa9d68df3be7790616f230d1
permissions -rw-r--r--
servo: Merge #17185 - Fix some "unused" warnings (from servo:unused); r=emilio Source-Repo: https://github.com/servo/servo Source-Revision: 87005a0df33531995635728989c929572de429e7

#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

ifneq (,$(filter automation/%,$(MAKECMDGOALS)))
ifeq (4.0,$(firstword $(sort 4.0 $(MAKE_VERSION))))
MAKEFLAGS += --output-sync=target
else
.NOTPARALLEL:
endif
endif

ifndef JS_STANDALONE
include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
include $(topsrcdir)/toolkit/mozapps/installer/upload-files.mk

# Clear out DIST_FILES if it was set by upload-files.mk (for Android builds)
DIST_FILES =
endif

# Helper variables to convert from MOZ_AUTOMATION_* variables to the
# corresponding the make target
tier_MOZ_AUTOMATION_BUILD_SYMBOLS = buildsymbols
tier_MOZ_AUTOMATION_L10N_CHECK = l10n-check
tier_MOZ_AUTOMATION_INSTALLER = installer
tier_MOZ_AUTOMATION_PACKAGE = package
tier_MOZ_AUTOMATION_PACKAGE_TESTS = package-tests
tier_MOZ_AUTOMATION_UPDATE_PACKAGING = update-packaging
tier_MOZ_AUTOMATION_UPLOAD_SYMBOLS = uploadsymbols
tier_MOZ_AUTOMATION_UPLOAD = upload

# Automation build steps. Everything in MOZ_AUTOMATION_TIERS also gets used in
# TIERS for mach display. As such, the MOZ_AUTOMATION_TIERS are roughly sorted
# here in the order that they will be executed (since mach doesn't know of the
# dependencies between them).
moz_automation_symbols = \
  MOZ_AUTOMATION_PACKAGE_TESTS \
  MOZ_AUTOMATION_BUILD_SYMBOLS \
  MOZ_AUTOMATION_UPLOAD_SYMBOLS \
  MOZ_AUTOMATION_PACKAGE \
  MOZ_AUTOMATION_INSTALLER \
  MOZ_AUTOMATION_UPDATE_PACKAGING \
  MOZ_AUTOMATION_L10N_CHECK \
  MOZ_AUTOMATION_UPLOAD \
  $(NULL)
MOZ_AUTOMATION_TIERS := $(foreach sym,$(moz_automation_symbols),$(if $(filter 1,$($(sym))),$(tier_$(sym))))

# Dependencies between automation build steps
automation/uploadsymbols: automation/buildsymbols

automation/update-packaging: automation/package
automation/update-packaging: automation/installer

automation/l10n-check: automation/package
automation/l10n-check: automation/installer

automation/upload: automation/installer
automation/upload: automation/package
automation/upload: automation/package-tests
automation/upload: automation/buildsymbols
automation/upload: automation/update-packaging

# The installer and packager all run stage-package, and may conflict
# with each other.
automation/installer: automation/package

automation/build: $(addprefix automation/,$(MOZ_AUTOMATION_TIERS))
	@echo Automation steps completed.

# Note: We have to force -j1 here, at least until bug 1036563 is fixed.
AUTOMATION_EXTRA_CMDLINE-l10n-check = -j1

# The commands only run if the corresponding MOZ_AUTOMATION_* variable is
# enabled. This means, for example, if we enable MOZ_AUTOMATION_UPLOAD, then
# 'buildsymbols' will only run if MOZ_AUTOMATION_BUILD_SYMBOLS is also set.
# However, the target automation/buildsymbols will still be executed in this
# case because it is a prerequisite of automation/upload.
define automation_commands
@+$(MAKE) $1 $(AUTOMATION_EXTRA_CMDLINE-$1)
$(call BUILDSTATUS,TIER_FINISH $1)
endef

# The tier start message is in a separate target so make doesn't buffer it
# until the step completes with output syncing enabled.
automation-start/%:
	$(if $(filter $*,$(MOZ_AUTOMATION_TIERS)),$(call BUILDSTATUS,TIER_START $*))

automation/%: automation-start/%
	$(if $(filter $*,$(MOZ_AUTOMATION_TIERS)),$(call automation_commands,$*))