moz-automation.mk 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. #
  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/.
  5. ifneq (,$(filter automation/%,$(MAKECMDGOALS)))
  6. ifeq (4.0,$(firstword $(sort 4.0 $(MAKE_VERSION))))
  7. MAKEFLAGS += --output-sync=target
  8. else
  9. .NOTPARALLEL:
  10. endif
  11. endif
  12. ifndef JS_STANDALONE
  13. include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
  14. include $(topsrcdir)/toolkit/mozapps/installer/upload-files.mk
  15. # Clear out DIST_FILES if it was set by upload-files.mk (for Android builds)
  16. DIST_FILES =
  17. endif
  18. # Helper variables to convert from MOZ_AUTOMATION_* variables to the
  19. # corresponding the make target
  20. tier_MOZ_AUTOMATION_BUILD_SYMBOLS = buildsymbols
  21. tier_MOZ_AUTOMATION_L10N_CHECK = l10n-check
  22. tier_MOZ_AUTOMATION_PRETTY_L10N_CHECK = pretty-l10n-check
  23. tier_MOZ_AUTOMATION_INSTALLER = installer
  24. tier_MOZ_AUTOMATION_PRETTY_INSTALLER = pretty-installer
  25. tier_MOZ_AUTOMATION_PACKAGE = package
  26. tier_MOZ_AUTOMATION_PRETTY_PACKAGE = pretty-package
  27. tier_MOZ_AUTOMATION_PACKAGE_TESTS = package-tests
  28. tier_MOZ_AUTOMATION_PRETTY_PACKAGE_TESTS = pretty-package-tests
  29. tier_MOZ_AUTOMATION_UPDATE_PACKAGING = update-packaging
  30. tier_MOZ_AUTOMATION_PRETTY_UPDATE_PACKAGING = pretty-update-packaging
  31. tier_MOZ_AUTOMATION_UPLOAD_SYMBOLS = uploadsymbols
  32. tier_MOZ_AUTOMATION_UPLOAD = upload
  33. tier_MOZ_AUTOMATION_SDK = sdk
  34. # Automation build steps. Everything in MOZ_AUTOMATION_TIERS also gets used in
  35. # TIERS for mach display. As such, the MOZ_AUTOMATION_TIERS are roughly sorted
  36. # here in the order that they will be executed (since mach doesn't know of the
  37. # dependencies between them).
  38. moz_automation_symbols = \
  39. MOZ_AUTOMATION_PACKAGE_TESTS \
  40. MOZ_AUTOMATION_PRETTY_PACKAGE_TESTS \
  41. MOZ_AUTOMATION_BUILD_SYMBOLS \
  42. MOZ_AUTOMATION_UPLOAD_SYMBOLS \
  43. MOZ_AUTOMATION_PACKAGE \
  44. MOZ_AUTOMATION_PRETTY_PACKAGE \
  45. MOZ_AUTOMATION_INSTALLER \
  46. MOZ_AUTOMATION_PRETTY_INSTALLER \
  47. MOZ_AUTOMATION_UPDATE_PACKAGING \
  48. MOZ_AUTOMATION_PRETTY_UPDATE_PACKAGING \
  49. MOZ_AUTOMATION_L10N_CHECK \
  50. MOZ_AUTOMATION_PRETTY_L10N_CHECK \
  51. MOZ_AUTOMATION_UPLOAD \
  52. MOZ_AUTOMATION_SDK \
  53. $(NULL)
  54. MOZ_AUTOMATION_TIERS := $(foreach sym,$(moz_automation_symbols),$(if $(filter 1,$($(sym))),$(tier_$(sym))))
  55. # Dependencies between automation build steps
  56. automation/uploadsymbols: automation/buildsymbols
  57. automation/update-packaging: automation/package
  58. automation/update-packaging: automation/installer
  59. automation/pretty-update-packaging: automation/pretty-package
  60. automation/pretty-update-packaging: automation/pretty-installer
  61. automation/l10n-check: automation/package
  62. automation/l10n-check: automation/installer
  63. automation/pretty-l10n-check: automation/pretty-package
  64. automation/pretty-l10n-check: automation/pretty-installer
  65. automation/upload: automation/installer
  66. automation/upload: automation/package
  67. automation/upload: automation/package-tests
  68. automation/upload: automation/buildsymbols
  69. automation/upload: automation/update-packaging
  70. automation/upload: automation/sdk
  71. # automation/{pretty-}package should depend on build (which is implicit due to
  72. # the way client.mk invokes automation/build), but buildsymbols changes the
  73. # binaries/libs, and that's what we package/test.
  74. automation/pretty-package: automation/buildsymbols
  75. # The installer, sdk and packager all run stage-package, and may conflict
  76. # with each other.
  77. automation/installer: automation/package
  78. automation/sdk: automation/installer automation/package
  79. # The 'pretty' versions of targets run before the regular ones to avoid
  80. # conflicts in writing to the same files.
  81. automation/installer: automation/pretty-installer
  82. automation/package: automation/pretty-package
  83. automation/package-tests: automation/pretty-package-tests
  84. automation/l10n-check: automation/pretty-l10n-check
  85. automation/update-packaging: automation/pretty-update-packaging
  86. automation/build: $(addprefix automation/,$(MOZ_AUTOMATION_TIERS))
  87. @echo Automation steps completed.
  88. # Note: We have to force -j1 here, at least until bug 1036563 is fixed.
  89. AUTOMATION_EXTRA_CMDLINE-l10n-check = -j1
  90. AUTOMATION_EXTRA_CMDLINE-pretty-l10n-check = -j1
  91. # The commands only run if the corresponding MOZ_AUTOMATION_* variable is
  92. # enabled. This means, for example, if we enable MOZ_AUTOMATION_UPLOAD, then
  93. # 'buildsymbols' will only run if MOZ_AUTOMATION_BUILD_SYMBOLS is also set.
  94. # However, the target automation/buildsymbols will still be executed in this
  95. # case because it is a prerequisite of automation/upload.
  96. define automation_commands
  97. @+$(MAKE) $1 $(AUTOMATION_EXTRA_CMDLINE-$1)
  98. $(call BUILDSTATUS,TIER_FINISH $1)
  99. endef
  100. # The tier start message is in a separate target so make doesn't buffer it
  101. # until the step completes with output syncing enabled.
  102. automation-start/%:
  103. $(if $(filter $*,$(MOZ_AUTOMATION_TIERS)),$(call BUILDSTATUS,TIER_START $*))
  104. automation/%: automation-start/%
  105. $(if $(filter $*,$(MOZ_AUTOMATION_TIERS)),$(call automation_commands,$*))