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/.
7 # We can't package tests if they aren't enabled.
8 MOZ_AUTOMATION_PACKAGE_TESTS
= 0
12 # Narrow the definition of cross compilation to not include win32 builds
13 # on win64 and linux32 builds on linux64.
14 ifeq ($(HOST_OS_ARCH
),$(OS_TARGET
))
15 ifneq (,$(filter x86
%,$(TARGET_CPU
)))
18 FUZZY_CROSS_COMPILE
= 1
21 FUZZY_CROSS_COMPILE
= 1
25 # Don't run make check when cross compiling, when doing artifact builds
26 # or when building instrumented builds for PGO.
27 ifneq (,$(USE_ARTIFACT
)$(FUZZY_CROSS_COMPILE
)$(MOZ_PROFILE_GENERATE
))
28 MOZ_AUTOMATION_CHECK
:= 0
31 ifneq (,$(filter automation
/%,$(MAKECMDGOALS
)))
32 ifneq (4.0,$(firstword $(sort 4.0 $(MAKE_VERSION
))))
38 include $(topsrcdir
)/toolkit
/mozapps
/installer
/package-name.mk
39 include $(topsrcdir
)/toolkit
/mozapps
/installer
/upload-files.mk
41 # Clear out DIST_FILES if it was set by upload-files.mk (for Android builds)
45 # Helper variables to convert from MOZ_AUTOMATION_* variables to the
46 # corresponding the make target
47 tier_MOZ_AUTOMATION_BUILD_SYMBOLS
= buildsymbols
48 tier_MOZ_AUTOMATION_PACKAGE
= package
49 tier_MOZ_AUTOMATION_PACKAGE_TESTS
= package-tests
50 tier_MOZ_AUTOMATION_PACKAGE_GENERATED_SOURCES
= package-generated-sources
51 tier_MOZ_AUTOMATION_UPLOAD_SYMBOLS
= uploadsymbols
52 tier_MOZ_AUTOMATION_UPLOAD
= upload
53 tier_MOZ_AUTOMATION_CHECK
= check
55 # Automation build steps. Everything in MOZ_AUTOMATION_TIERS also gets used in
56 # TIERS for mach display. As such, the MOZ_AUTOMATION_TIERS are roughly sorted
57 # here in the order that they will be executed (since mach doesn't know of the
58 # dependencies between them).
59 moz_automation_symbols
= \
60 MOZ_AUTOMATION_PACKAGE_TESTS \
61 MOZ_AUTOMATION_UPLOAD \
64 ifneq (,$(COMPILE_ENVIRONMENT
)$(MOZ_ARTIFACT_BUILDS
))
65 moz_automation_symbols
+= \
66 MOZ_AUTOMATION_BUILD_SYMBOLS \
67 MOZ_AUTOMATION_UPLOAD_SYMBOLS \
68 MOZ_AUTOMATION_PACKAGE \
69 MOZ_AUTOMATION_PACKAGE_GENERATED_SOURCES \
70 MOZ_AUTOMATION_CHECK \
73 MOZ_AUTOMATION_TIERS
:= $(foreach sym
,$(moz_automation_symbols
),$(if
$(filter 1,$($(sym
))),$(tier_
$(sym
))))
75 # Dependencies between automation build steps
76 automation-start
/uploadsymbols
: automation
/buildsymbols
78 automation-start
/upload
: automation
/package
79 automation-start
/upload
: automation
/package-tests
80 automation-start
/upload
: automation
/buildsymbols
81 automation-start
/upload
: automation
/package-generated-sources
83 # Run the check tier after everything else.
84 automation-start
/check: $(addprefix automation
/,$(filter-out check,$(MOZ_AUTOMATION_TIERS
)))
86 automation
/build
: $(addprefix automation
/,$(MOZ_AUTOMATION_TIERS
))
87 @echo Automation steps completed.
89 # Run as many tests as possible, even in case of one of them failing.
90 AUTOMATION_EXTRA_CMDLINE-check
= --keep-going
92 # The commands only run if the corresponding MOZ_AUTOMATION_* variable is
93 # enabled. This means, for example, if we enable MOZ_AUTOMATION_UPLOAD, then
94 # 'buildsymbols' will only run if MOZ_AUTOMATION_BUILD_SYMBOLS is also set.
95 # However, the target automation/buildsymbols will still be executed in this
96 # case because it is a prerequisite of automation/upload.
97 define automation_commands
98 @
+$(PYTHON3
) $(topsrcdir
)/config
/run-and-prefix.py
$1 $(MAKE
) $1 $(AUTOMATION_EXTRA_CMDLINE-
$1)
99 $(call BUILDSTATUS
,TIER_FINISH
$1)
102 # The tier start message is in a separate target so make doesn't buffer it
103 # until the step completes with output syncing enabled.
105 $(if
$(filter $*,$(MOZ_AUTOMATION_TIERS
)),$(call BUILDSTATUS
,TIER_START
$*))
107 automation
/%: automation-start
/%
108 $(if
$(filter $*,$(MOZ_AUTOMATION_TIERS
)),$(call automation_commands
,$*))