Bug 1604100 [wpt PR 20784] - HtmlImportsRequestInitiatorLock: Check imports controlle...
[gecko.git] / Makefile.in
blobc538c7e9824c2722aa0ca325e9e520985c8a0fa8
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 ifeq (,$(MAKE_VERSION))
7 $(error GNU Make is required)
8 endif
9 make_min_ver := 3.81
10 ifneq ($(make_min_ver),$(firstword $(sort $(make_min_ver) $(MAKE_VERSION))))
11 $(error GNU Make $(make_min_ver) or higher is required)
12 endif
14 export TOPLEVEL_BUILD := 1
16 default::
18 ifndef TEST_MOZBUILD
19 ifdef MOZ_BUILD_APP
20 include $(wildcard $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk)
21 endif
22 endif
24 include $(topsrcdir)/config/config.mk
26 GARBAGE_DIRS += _javagen _profile staticlib
27 # To share compilation of dependencies, Rust libraries all set their
28 # CARGO_TARGET_DIR as a subdirectory of topobjdir. Normally, we would add
29 # RUST*TARGET to GARBAGE_DIRS for those directories building Rust libraries.
30 # But the directories building Rust libraries don't actually have
31 # subdirectories to remove. So we add to GARBAGE_DIRS once here, globally,
32 # for it to have the desired effect.
33 GARBAGE_DIRS += $(RUST_TARGET)
34 DIST_GARBAGE = config.cache config.log config.status* config-defs.h \
35 config/autoconf.mk \
36 mozilla-config.h \
37 netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
38 .mozconfig.mk
40 ifneq (mobile/android,$(MOZ_BUILD_APP))
41 $(MDDEPDIR)/buildid.h.stub $(MDDEPDIR)/source-repo.h.stub: FORCE
42 endif
43 source-repo.h: $(MDDEPDIR)/source-repo.h.stub
44 buildid.h: $(MDDEPDIR)/buildid.h.stub
46 BUILD_BACKEND_FILES := $(addprefix backend.,$(addsuffix Backend,$(BUILD_BACKENDS)))
48 ifndef TEST_MOZBUILD
49 # We need to explicitly put BUILD_BACKEND_FILES here otherwise the rule in
50 # rules.mk doesn't run early enough.
51 $(RUNNABLE_TIERS) binaries:: CLOBBER $(BUILD_BACKEND_FILES)
52 endif
54 ifdef JS_STANDALONE
55 .PHONY: CLOBBER
56 CLOBBER:
57 else
58 CLOBBER: $(topsrcdir)/CLOBBER
59 @echo 'STOP! The CLOBBER file has changed.'
60 @echo 'Please run the build through "mach build".'
61 @exit 1
62 endif
64 install_manifests := \
65 $(addprefix dist/,branding include public private xpi-stage) \
66 _tests \
67 $(NULL)
68 # Skip the dist/bin install manifest when using the hybrid
69 # FasterMake/RecursiveMake backend. This is a hack until bug 1241744 moves
70 # xpidl handling to FasterMake in that case, mechanically making the dist/bin
71 # install manifest non-existent (non-existent manifests being skipped)
72 ifeq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
73 install_manifests += dist/bin
74 endif
75 install_manifest_depends = \
76 CLOBBER \
77 $(BUILD_BACKEND_FILES) \
78 $(NULL)
80 .PHONY: install-manifests
81 install-manifests: $(addprefix install-,$(install_manifests))
83 # If we're using the hybrid FasterMake/RecursiveMake backend, we want
84 # to recurse in the faster/ directory in parallel of install manifests.
85 ifneq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
86 install-manifests: faster
87 .PHONY: faster
88 faster:
89 $(MAKE) -C faster FASTER_RECURSIVE_MAKE=1
90 endif
92 .PHONY: $(addprefix install-,$(install_manifests))
93 $(addprefix install-,$(install_manifests)): install-%: $(install_manifest_depends)
94 ifneq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
95 @# If we're using the hybrid FasterMake/RecursiveMake backend, we want
96 @# to ensure the FasterMake end doesn't have install manifests for the
97 @# same directory, because that would blow up
98 $(if $(wildcard _build_manifests/install/$(subst /,_,$*)),$(if $(wildcard faster/install_$(subst /,_,$*)*),$(error FasterMake and RecursiveMake ends of the hybrid build system want to handle $*)))
99 endif
100 $(addprefix $(call py_action,process_install_manifest,--track install_$(subst /,_,$*).track $*) ,$(wildcard _build_manifests/install/$(subst /,_,$*)))
102 # Dummy wrapper rule to allow the faster backend to piggy back
103 $(addprefix install-,$(subst /,_,$(filter dist/%,$(install_manifests)))): install-dist_%: install-dist/% ;
105 .PHONY: install-tests
106 install-tests: install-test-files
108 .PHONY: install-test-files
109 install-test-files:
110 $(call py_action,process_install_manifest,--track install__test_files.track _tests _build_manifests/install/_test_files)
112 include $(topsrcdir)/build/moz-automation.mk
114 # dist and _tests should be purged during cleaning.
115 GARBAGE_DIRS += dist _tests
117 # Dummy rule for the cases below where we don't depend on dist/include
118 recurse_pre-export::
120 # For the binaries rule, not all the install manifests matter, so force only
121 # the interesting ones to be done.
122 recurse_pre-export:: install-manifests
123 binaries::
124 @$(MAKE) install-manifests install_manifests=dist/include
126 # Host binaries are not produced for macOS consumers: that is, there's
127 # no macOS-hosted job to produce them at this time. Therefore we
128 # enable --host-bins only for automation builds, which only require Linux and
129 # Windows host binaries.
130 recurse_artifact:
131 $(topsrcdir)/mach --log-no-times artifact install$(if $(MOZ_ARTIFACT_BUILD_SYMBOLS), --symbols$(addprefix =,$(filter full,$(MOZ_ARTIFACT_BUILD_SYMBOLS))))$(if $(MOZ_AUTOMATION), --host-bins)
133 ifdef MOZ_EME_WIN32_ARTIFACT
134 recurse_win32-artifact:
135 rm -rf $(DIST)/i686
136 $(topsrcdir)/mach --log-no-times artifact install --job $(if $(MOZ_PGO),win32-pgo,win32-opt) --no-tests --distdir $(DIST)/i686
137 mv $(DIST)/i686/bin/* $(DIST)/i686
138 endif
140 ifdef MOZ_ANDROID_FAT_AAR_ARCHITECTURES
141 recurse_android-fat-aar-artifact:
142 $(call py_action,fat_aar,\
143 $(addprefix --armeabi-v7a $(MOZ_FETCHES_DIR)/,$(MOZ_ANDROID_FAT_AAR_ARMEABI_V7A)) \
144 $(addprefix --arm64-v8a $(MOZ_FETCHES_DIR)/,$(MOZ_ANDROID_FAT_AAR_ARM64_V8A)) \
145 $(addprefix --x86 $(MOZ_FETCHES_DIR)/,$(MOZ_ANDROID_FAT_AAR_X86)) \
146 $(addprefix --x86-64 $(MOZ_FETCHES_DIR)/,$(MOZ_ANDROID_FAT_AAR_X86_64)) \
147 --distdir $(abspath $(DIST)/fat-aar))
148 endif
150 ifeq ($(MOZ_BUILD_APP),mobile/android)
152 recurse_android-stage-package: stage-package
154 recurse_android-archive-geckoview:
155 GRADLE_INVOKED_WITHIN_MACH_BUILD=1 $(topsrcdir)/mach --log-no-times android archive-geckoview
156 endif
158 ifdef MOZ_WIDGET_TOOLKIT
159 ifdef ENABLE_TESTS
160 # Additional makefile targets to call automated test suites
161 include $(topsrcdir)/testing/testsuite-targets.mk
162 endif
163 endif
165 default all::
166 $(call BUILDSTATUS,TIERS $(TIERS) $(if $(MOZ_AUTOMATION),$(MOZ_AUTOMATION_TIERS)))
168 include $(topsrcdir)/config/rules.mk
170 ifdef SCCACHE_VERBOSE_STATS
171 default::
172 -$(CCACHE) --show-stats --stats-format=json > sccache-stats.json
173 @echo "===SCCACHE STATS==="
174 -$(CCACHE) --show-stats
175 @echo "==================="
176 endif
178 distclean::
179 $(RM) $(DIST_GARBAGE)
181 ifdef MOZ_CRASHREPORTER
182 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
184 endif
186 .PHONY: prepsymbolsarchive
187 prepsymbolsarchive:
188 echo packing symbols
189 $(NSINSTALL) -D $(DIST)/$(PKG_PATH)
191 ifndef MOZ_AUTOMATION
192 prepsymbolsarchive: recurse_syms
193 endif
195 .PHONY: symbolsfullarchive
196 symbolsfullarchive: prepsymbolsarchive
197 $(RM) '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip'
198 $(call py_action,symbols_archive,'$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip' \
199 $(abspath $(DIST)/crashreporter-symbols) \
200 --full-archive)
202 .PHONY: symbolsarchive
203 symbolsarchive: prepsymbolsarchive
204 $(RM) '$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip'
205 $(call py_action,symbols_archive,'$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip' \
206 $(abspath $(DIST)/crashreporter-symbols))
208 ifdef MOZ_CRASHREPORTER
209 # Set MOZ_DISABLE_FULL_SYMBOLS to disable generation and upload of the full
210 # crashreporter symbols archives
211 ifdef MOZ_DISABLE_FULL_SYMBOLS
212 buildsymbols: symbolsarchive
213 else
214 buildsymbols: symbolsfullarchive symbolsarchive
215 endif # MOZ_DISABLE_FULL_SYMBOLS
216 else
217 buildsymbols:
218 endif
220 uploadsymbols:
221 ifdef MOZ_CRASHREPORTER
222 $(PYTHON) -u $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.py '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip'
223 endif
225 .PHONY: update-packaging
226 update-packaging:
227 $(MAKE) -C tools/update-packaging
229 .PHONY: package-generated-sources
230 package-generated-sources:
231 $(call py_action,package_generated_sources,'$(DIST)/$(PKG_PATH)$(GENERATED_SOURCE_FILE_PACKAGE)')
233 ifdef JS_STANDALONE
234 # Delegate js-specific rules to js
235 check-%:
236 $(MAKE) -C js/src $@
238 source-package install:
239 $(MAKE) -C js/src $@
241 # Every export rule depends on config/export, but the rule for config/export
242 # doesn't exist when building js non-standalone.
243 .PHONY: config/export
244 config/export:
246 endif
248 # There used to be build interdependencies here. They are now in config/recurse.mk