build/moz-automation.mk
author Sylvestre Ledru <sledru@mozilla.com>
Mon, 14 Nov 2016 15:42:55 +0100
changeset 892664 9f9e3ba9227879d0b85ecb0e6456a3dcac0d0d0b
parent 883493 7d59e316811b4fe54b3df9adaa2312d4084dfe00
child 910856 87232cd5eb91495ad948510686c7293ce08a285f
child 911214 1f48c1444e3f118e025a2a39aba1078e8a640115
child 914490 9f5efe3acc59414446273b51da88772b09f07ec6
child 920370 edbcc41920fe83c65c9fe91adfbc2d56c90d5dc1
child 921113 26e2f536d8b66f9b87c5ac4cc2a54af1e228909d
child 927592 6a98f10ff0f2f84b9a65da4d7c15eabf33fa7698
child 927672 7fca1de93453185151ae6efd328bda702e32b1e4
child 928783 73cc53ef4ffff5eab83a8da5c552a7c81e53fa74
child 1489916 19545120490da48aaf901abb052ba53cb57ab466
permissions -rw-r--r--
Bug 1313040 - Update the list of ignored directories/files with clang-format r=mystor MozReview-Commit-ID: ByV08Oryu6h

#
# 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_PRETTY_L10N_CHECK = pretty-l10n-check
tier_MOZ_AUTOMATION_INSTALLER = installer
tier_MOZ_AUTOMATION_PRETTY_INSTALLER = pretty-installer
tier_MOZ_AUTOMATION_PACKAGE = package
tier_MOZ_AUTOMATION_PRETTY_PACKAGE = pretty-package
tier_MOZ_AUTOMATION_PACKAGE_TESTS = package-tests
tier_MOZ_AUTOMATION_PRETTY_PACKAGE_TESTS = pretty-package-tests
tier_MOZ_AUTOMATION_UPDATE_PACKAGING = update-packaging
tier_MOZ_AUTOMATION_PRETTY_UPDATE_PACKAGING = pretty-update-packaging
tier_MOZ_AUTOMATION_UPLOAD_SYMBOLS = uploadsymbols
tier_MOZ_AUTOMATION_UPLOAD = upload
tier_MOZ_AUTOMATION_SDK = sdk

# 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_PRETTY_PACKAGE_TESTS \
  MOZ_AUTOMATION_BUILD_SYMBOLS \
  MOZ_AUTOMATION_UPLOAD_SYMBOLS \
  MOZ_AUTOMATION_PACKAGE \
  MOZ_AUTOMATION_PRETTY_PACKAGE \
  MOZ_AUTOMATION_INSTALLER \
  MOZ_AUTOMATION_PRETTY_INSTALLER \
  MOZ_AUTOMATION_UPDATE_PACKAGING \
  MOZ_AUTOMATION_PRETTY_UPDATE_PACKAGING \
  MOZ_AUTOMATION_L10N_CHECK \
  MOZ_AUTOMATION_PRETTY_L10N_CHECK \
  MOZ_AUTOMATION_UPLOAD \
  MOZ_AUTOMATION_SDK \
  $(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/pretty-update-packaging: automation/pretty-package
automation/pretty-update-packaging: automation/pretty-installer

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

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

# automation/{pretty-}package should depend on build (which is implicit due to
# the way client.mk invokes automation/build), but buildsymbols changes the
# binaries/libs, and that's what we package/test.
automation/pretty-package: automation/buildsymbols

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

# The 'pretty' versions of targets run before the regular ones to avoid
# conflicts in writing to the same files.
automation/installer: automation/pretty-installer
automation/package: automation/pretty-package
automation/package-tests: automation/pretty-package-tests
automation/l10n-check: automation/pretty-l10n-check
automation/update-packaging: automation/pretty-update-packaging

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
AUTOMATION_EXTRA_CMDLINE-pretty-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,$*))