2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 ifneq (,$(filter automation
/%,$(MAKECMDGOALS
)))
7 ifeq (4.0,$(firstword $(sort 4.0 $(MAKE_VERSION
))))
8 MAKEFLAGS
+= --output-sync
=target
14 include $(topsrcdir
)/toolkit
/mozapps
/installer
/package-name.mk
16 # Log file from the 'make upload' step. We need this to parse out the URLs of
18 AUTOMATION_UPLOAD_OUTPUT
= $(DIST
)/automation-upload.txt
20 # Helper variables to convert from MOZ_AUTOMATION_* variables to the
21 # corresponding the make target
22 tier_BUILD_SYMBOLS
= buildsymbols
24 tier_L10N_CHECK
= l10n-check
25 tier_PRETTY_L10N_CHECK
= pretty-l10n-check
26 tier_INSTALLER
= installer
27 tier_PRETTY_INSTALLER
= pretty-installer
28 tier_PACKAGE
= package
29 tier_PRETTY_PACKAGE
= pretty-package
30 tier_PACKAGE_TESTS
= package-tests
31 tier_PRETTY_PACKAGE_TESTS
= pretty-package-tests
32 tier_UPDATE_PACKAGING
= update-packaging
33 tier_PRETTY_UPDATE_PACKAGING
= pretty-update-packaging
34 tier_UPLOAD_SYMBOLS
= uploadsymbols
37 # Automation build steps. Everything in MOZ_AUTOMATION_TIERS also gets used in
38 # TIERS for mach display. As such, the MOZ_AUTOMATION_TIERS are roughly sorted
39 # here in the order that they will be executed (since mach doesn't know of the
40 # dependencies between them).
41 moz_automation_symbols
= \
43 PRETTY_PACKAGE_TESTS \
51 PRETTY_UPDATE_PACKAGING \
57 MOZ_AUTOMATION_TIERS
:= $(foreach sym
,$(moz_automation_symbols
),$(if
$(filter 1,$(MOZ_AUTOMATION_
$(sym
))),$(tier_
$(sym
))))
59 # Dependencies between automation build steps
60 automation
/uploadsymbols
: automation
/buildsymbols
62 automation
/update-packaging
: automation
/package
63 automation
/pretty-update-packaging
: automation
/pretty-package
64 automation
/pretty-update-packaging
: automation
/pretty-installer
66 automation
/l10n-check
: automation
/package
67 automation
/l10n-check
: automation
/installer
68 automation
/pretty-l10n-check
: automation
/pretty-package
69 automation
/pretty-l10n-check
: automation
/pretty-installer
71 automation
/upload
: automation
/installer
72 automation
/upload
: automation
/package
73 automation
/upload
: automation
/package-tests
74 automation
/upload
: automation
/buildsymbols
75 automation
/upload
: automation
/update-packaging
77 # automation/{pretty-}package and automation/check should depend on build (which is
78 # implicit due to the way client.mk invokes automation/build), but buildsymbols
79 # changes the binaries/libs, and that's what we package/test.
80 automation
/pretty-package
: automation
/buildsymbols
81 automation
/check: automation
/buildsymbols
83 # The 'pretty' versions of targets run before the regular ones to avoid
84 # conflicts in writing to the same files.
85 automation
/installer
: automation
/pretty-installer
86 automation
/package
: automation
/pretty-package
87 automation
/package-tests
: automation
/pretty-package-tests
88 automation
/l10n-check
: automation
/pretty-l10n-check
89 automation
/update-packaging
: automation
/pretty-update-packaging
91 automation
/build
: $(addprefix automation
/,$(MOZ_AUTOMATION_TIERS
))
92 $(PYTHON
) $(topsrcdir
)/build
/gen_mach_buildprops.py
--complete-mar-file
$(DIST
)/$(COMPLETE_MAR
) --upload-output
$(AUTOMATION_UPLOAD_OUTPUT
)
94 # make check runs with the keep-going flag so we can see all the failures
95 AUTOMATION_EXTRA_CMDLINE-check
= -k
97 # We need the log from make upload to grep it for urls in order to set
99 AUTOMATION_EXTRA_CMDLINE-upload
= 2>&1 | tee
$(AUTOMATION_UPLOAD_OUTPUT
)
101 # Note: We have to force -j1 here, at least until bug 1036563 is fixed.
102 AUTOMATION_EXTRA_CMDLINE-l10n-check
= -j1
103 AUTOMATION_EXTRA_CMDLINE-pretty-l10n-check
= -j1
105 # And force -j1 here until bug 1077670 is fixed.
106 AUTOMATION_EXTRA_CMDLINE-package-tests
= -j1
107 AUTOMATION_EXTRA_CMDLINE-pretty-package-tests
= -j1
109 # The commands only run if the corresponding MOZ_AUTOMATION_* variable is
110 # enabled. This means, for example, if we enable MOZ_AUTOMATION_UPLOAD, then
111 # 'buildsymbols' will only run if MOZ_AUTOMATION_BUILD_SYMBOLS is also set.
112 # However, the target automation/buildsymbols will still be executed in this
113 # case because it is a prerequisite of automation/upload.
114 define automation_commands
115 $(call BUILDSTATUS
,TIER_START
$1)
116 @
$(MAKE
) $1 $(AUTOMATION_EXTRA_CMDLINE-
$1)
117 $(call BUILDSTATUS
,TIER_FINISH
$1)
121 $(if
$(filter $*,$(MOZ_AUTOMATION_TIERS
)),$(call automation_commands
,$*))