2014-05-16 22:37:31 +04:00
|
|
|
#
|
|
|
|
# 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/.
|
|
|
|
|
2017-08-29 20:34:40 +03:00
|
|
|
ifndef ENABLE_TESTS
|
|
|
|
# We can't package tests if they aren't enabled.
|
|
|
|
MOZ_AUTOMATION_PACKAGE_TESTS = 0
|
|
|
|
endif
|
|
|
|
|
2019-08-21 15:31:30 +03:00
|
|
|
ifdef CROSS_COMPILE
|
|
|
|
# Narrow the definition of cross compilation to not include win32 builds
|
|
|
|
# on win64 and linux32 builds on linux64.
|
|
|
|
ifeq ($(HOST_OS_ARCH),$(OS_TARGET))
|
2019-08-22 02:12:08 +03:00
|
|
|
ifneq (,$(filter x86%,$(CPU_ARCH)))
|
2019-08-21 15:31:30 +03:00
|
|
|
FUZZY_CROSS_COMPILE =
|
|
|
|
else
|
|
|
|
FUZZY_CROSS_COMPILE = 1
|
|
|
|
endif
|
2019-08-22 02:12:08 +03:00
|
|
|
else
|
|
|
|
FUZZY_CROSS_COMPILE = 1
|
|
|
|
endif
|
2019-08-21 15:31:30 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Don't run make check when cross compiling, when doing artifact builds
|
|
|
|
# or when building instrumented builds for PGO.
|
|
|
|
ifneq (,$(USE_ARTIFACT)$(FUZZY_CROSS_COMPILE)$(MOZ_PROFILE_GENERATE))
|
|
|
|
MOZ_AUTOMATION_CHECK := 0
|
|
|
|
endif
|
|
|
|
|
2014-06-19 04:06:13 +04:00
|
|
|
ifneq (,$(filter automation/%,$(MAKECMDGOALS)))
|
|
|
|
ifeq (4.0,$(firstword $(sort 4.0 $(MAKE_VERSION))))
|
|
|
|
MAKEFLAGS += --output-sync=target
|
|
|
|
else
|
|
|
|
.NOTPARALLEL:
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2016-05-30 20:45:19 +03:00
|
|
|
ifndef JS_STANDALONE
|
2016-05-19 17:35:39 +03:00
|
|
|
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 =
|
2016-05-30 20:45:19 +03:00
|
|
|
endif
|
2016-05-19 17:35:39 +03:00
|
|
|
|
2014-06-16 21:17:21 +04:00
|
|
|
# Helper variables to convert from MOZ_AUTOMATION_* variables to the
|
|
|
|
# corresponding the make target
|
2015-06-17 23:58:26 +03:00
|
|
|
tier_MOZ_AUTOMATION_BUILD_SYMBOLS = buildsymbols
|
|
|
|
tier_MOZ_AUTOMATION_PACKAGE = package
|
|
|
|
tier_MOZ_AUTOMATION_PACKAGE_TESTS = package-tests
|
2017-07-31 19:47:08 +03:00
|
|
|
tier_MOZ_AUTOMATION_PACKAGE_GENERATED_SOURCES = package-generated-sources
|
2015-06-17 23:58:26 +03:00
|
|
|
tier_MOZ_AUTOMATION_UPLOAD_SYMBOLS = uploadsymbols
|
|
|
|
tier_MOZ_AUTOMATION_UPLOAD = upload
|
2019-08-21 15:31:30 +03:00
|
|
|
tier_MOZ_AUTOMATION_CHECK = check
|
2014-06-16 21:17:21 +04:00
|
|
|
|
2014-05-16 22:37:31 +04:00
|
|
|
# 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).
|
2014-07-03 07:15:10 +04:00
|
|
|
moz_automation_symbols = \
|
2015-06-17 23:58:26 +03:00
|
|
|
MOZ_AUTOMATION_PACKAGE_TESTS \
|
|
|
|
MOZ_AUTOMATION_BUILD_SYMBOLS \
|
|
|
|
MOZ_AUTOMATION_UPLOAD_SYMBOLS \
|
|
|
|
MOZ_AUTOMATION_PACKAGE \
|
2017-07-31 19:47:08 +03:00
|
|
|
MOZ_AUTOMATION_PACKAGE_GENERATED_SOURCES \
|
2015-06-17 23:58:26 +03:00
|
|
|
MOZ_AUTOMATION_UPLOAD \
|
2019-08-21 15:31:30 +03:00
|
|
|
MOZ_AUTOMATION_CHECK \
|
2014-07-03 07:15:10 +04:00
|
|
|
$(NULL)
|
2015-06-17 23:58:26 +03:00
|
|
|
MOZ_AUTOMATION_TIERS := $(foreach sym,$(moz_automation_symbols),$(if $(filter 1,$($(sym))),$(tier_$(sym))))
|
2014-05-16 22:37:31 +04:00
|
|
|
|
2014-06-16 21:17:21 +04:00
|
|
|
# Dependencies between automation build steps
|
2019-08-22 00:25:35 +03:00
|
|
|
automation-start/uploadsymbols: automation/buildsymbols
|
2014-05-16 22:37:31 +04:00
|
|
|
|
2019-08-22 00:25:35 +03:00
|
|
|
automation-start/upload: automation/package
|
|
|
|
automation-start/upload: automation/package-tests
|
|
|
|
automation-start/upload: automation/buildsymbols
|
|
|
|
automation-start/upload: automation/package-generated-sources
|
2014-05-16 22:37:31 +04:00
|
|
|
|
2019-08-21 15:31:30 +03:00
|
|
|
# Run the check tier after everything else.
|
|
|
|
automation-start/check: $(addprefix automation/,$(filter-out check,$(MOZ_AUTOMATION_TIERS)))
|
|
|
|
|
2014-06-16 21:17:21 +04:00
|
|
|
automation/build: $(addprefix automation/,$(MOZ_AUTOMATION_TIERS))
|
2015-08-25 18:42:44 +03:00
|
|
|
@echo Automation steps completed.
|
2014-05-16 22:37:31 +04:00
|
|
|
|
2019-08-21 15:31:30 +03:00
|
|
|
# Run as many tests as possible, even in case of one of them failing.
|
|
|
|
AUTOMATION_EXTRA_CMDLINE-check = --keep-going
|
|
|
|
|
2014-06-16 21:17:21 +04:00
|
|
|
# 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
|
2020-05-05 22:53:22 +03:00
|
|
|
@+$(PYTHON3) $(topsrcdir)/config/run-and-prefix.py $1 $(MAKE) $1 $(AUTOMATION_EXTRA_CMDLINE-$1)
|
2014-06-16 21:17:21 +04:00
|
|
|
$(call BUILDSTATUS,TIER_FINISH $1)
|
|
|
|
endef
|
|
|
|
|
2015-06-17 23:59:20 +03:00
|
|
|
# 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/%
|
2014-06-16 21:17:21 +04:00
|
|
|
$(if $(filter $*,$(MOZ_AUTOMATION_TIERS)),$(call automation_commands,$*))
|