Bug 1568562 [wpt PR 18048] - [PE]: Improve the interest rect computation under perspe...
[gecko.git] / Makefile.in
blobed33bb0e83fb0f9cd4a40ac6b312ee55dabac5c2
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 ifndef MOZ_PROFILE_USE
41 ifneq (mobile/android,$(MOZ_BUILD_APP))
42 $(MDDEPDIR)/buildid.h.stub $(MDDEPDIR)/source-repo.h.stub: FORCE
43 endif
44 source-repo.h: $(MDDEPDIR)/source-repo.h.stub
45 buildid.h: $(MDDEPDIR)/buildid.h.stub
46 endif
48 BUILD_BACKEND_FILES := $(addprefix backend.,$(addsuffix Backend,$(BUILD_BACKENDS)))
50 ifndef TEST_MOZBUILD
51 ifndef MOZ_PROFILE_USE
52 # We need to explicitly put BUILD_BACKEND_FILES here otherwise the rule in
53 # rules.mk doesn't run early enough.
54 $(RUNNABLE_TIERS) binaries:: CLOBBER $(BUILD_BACKEND_FILES)
55 endif
56 endif
58 ifdef JS_STANDALONE
59 .PHONY: CLOBBER
60 CLOBBER:
61 else
62 CLOBBER: $(topsrcdir)/CLOBBER
63 @echo 'STOP! The CLOBBER file has changed.'
64 @echo 'Please run the build through "mach build".'
65 @exit 1
66 endif
68 install_manifests := \
69 $(addprefix dist/,branding include public private xpi-stage) \
70 _tests \
71 $(NULL)
72 # Skip the dist/bin install manifest when using the hybrid
73 # FasterMake/RecursiveMake backend. This is a hack until bug 1241744 moves
74 # xpidl handling to FasterMake in that case, mechanically making the dist/bin
75 # install manifest non-existent (non-existent manifests being skipped)
76 ifeq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
77 install_manifests += dist/bin
78 endif
79 install_manifest_depends = \
80 CLOBBER \
81 $(BUILD_BACKEND_FILES) \
82 $(NULL)
84 .PHONY: install-manifests
85 install-manifests: $(addprefix install-,$(install_manifests))
87 # If we're using the hybrid FasterMake/RecursiveMake backend, we want
88 # to recurse in the faster/ directory in parallel of install manifests.
89 ifneq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
90 install-manifests: faster
91 .PHONY: faster
92 faster:
93 $(MAKE) -C faster FASTER_RECURSIVE_MAKE=1
94 endif
96 .PHONY: $(addprefix install-,$(install_manifests))
97 $(addprefix install-,$(install_manifests)): install-%: $(install_manifest_depends)
98 ifneq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
99 @# If we're using the hybrid FasterMake/RecursiveMake backend, we want
100 @# to ensure the FasterMake end doesn't have install manifests for the
101 @# same directory, because that would blow up
102 $(if $(wildcard _build_manifests/install/$(subst /,_,$*)),$(if $(wildcard faster/install_$(subst /,_,$*)*),$(error FasterMake and RecursiveMake ends of the hybrid build system want to handle $*)))
103 endif
104 $(addprefix $(call py_action,process_install_manifest,--track install_$(subst /,_,$*).track $*) ,$(wildcard _build_manifests/install/$(subst /,_,$*)))
106 # Dummy wrapper rule to allow the faster backend to piggy back
107 $(addprefix install-,$(subst /,_,$(filter dist/%,$(install_manifests)))): install-dist_%: install-dist/% ;
109 .PHONY: install-tests
110 install-tests: install-test-files
112 .PHONY: install-test-files
113 install-test-files:
114 $(call py_action,process_install_manifest,--track install__test_files.track _tests _build_manifests/install/_test_files)
116 include $(topsrcdir)/build/moz-automation.mk
118 # dist and _tests should be purged during cleaning. However, we don't want them
119 # purged during PGO builds because they contain some auto-generated files.
120 ifneq ($(filter-out maybe_clobber_profiledbuild,$(MAKECMDGOALS)),)
121 GARBAGE_DIRS += dist _tests
122 endif
124 # Dummy rule for the cases below where we don't depend on dist/include
125 recurse_pre-export::
127 # Windows PGO builds don't perform a clean before the 2nd pass. So, we want
128 # to preserve content for the 2nd pass on Windows. Everywhere else, we always
129 # process the install manifests as part of export.
130 # For the binaries rule, not all the install manifests matter, so force only
131 # the interesting ones to be done.
132 ifdef MOZ_1TIER_PGO
133 ifndef NO_PROFILE_GUIDED_OPTIMIZE
134 ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
135 recurse_pre-export:: install-manifests
136 binaries::
137 @$(MAKE) install-manifests install_manifests=dist/include
138 endif
139 endif
140 else # !MOZ_1TIER_PGO (normal build)
141 recurse_pre-export:: install-manifests
142 binaries::
143 @$(MAKE) install-manifests install_manifests=dist/include
144 endif
146 # Host binaries are not produced for macOS consumers: that is, there's
147 # no macOS-hosted job to produce them at this time. Therefore we
148 # enable --host-bins only for automation builds, which only require Linux and
149 # Windows host binaries.
150 recurse_artifact:
151 $(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)
153 ifdef MOZ_EME_WIN32_ARTIFACT
154 recurse_win32-artifact:
155 rm -rf $(DIST)/i686
156 $(topsrcdir)/mach --log-no-times artifact install --job $(if $(MOZ_PGO),win32-pgo,win32-opt) --no-tests --distdir $(DIST)/i686
157 mv $(DIST)/i686/bin/* $(DIST)/i686
158 endif
160 ifdef MOZ_ANDROID_FAT_AAR_ARCHITECTURES
161 recurse_android-fat-aar-artifact:
162 $(call py_action,fat_aar,\
163 $(addprefix --armeabi-v7a $(MOZ_FETCHES_DIR)/,$(MOZ_ANDROID_FAT_AAR_ARMEABI_V7A)) \
164 $(addprefix --arm64-v8a $(MOZ_FETCHES_DIR)/,$(MOZ_ANDROID_FAT_AAR_ARM64_V8A)) \
165 $(addprefix --x86 $(MOZ_FETCHES_DIR)/,$(MOZ_ANDROID_FAT_AAR_X86)) \
166 $(addprefix --x86-64 $(MOZ_FETCHES_DIR)/,$(MOZ_ANDROID_FAT_AAR_X86_64)) \
167 --distdir $(abspath $(DIST)/fat-aar))
168 endif
170 ifdef MOZ_WIDGET_TOOLKIT
171 ifdef ENABLE_TESTS
172 # Additional makefile targets to call automated test suites
173 include $(topsrcdir)/testing/testsuite-targets.mk
174 endif
175 endif
177 default all::
178 $(call BUILDSTATUS,TIERS $(TIERS) $(if $(MOZ_AUTOMATION),$(MOZ_AUTOMATION_TIERS)))
180 # PGO build target.
181 profiledbuild::
182 $(call BUILDSTATUS,TIERS pgo_profile_generate pgo_package pgo_profile pgo_clobber pgo_profile_use)
183 $(call BUILDSTATUS,TIER_START pgo_profile_generate)
184 $(MAKE) default MOZ_PROFILE_GENERATE=1 MOZ_LTO=
185 $(call BUILDSTATUS,TIER_FINISH pgo_profile_generate)
186 $(call BUILDSTATUS,TIER_START pgo_package)
187 $(MAKE) package MOZ_INTERNAL_SIGNING_FORMAT= MOZ_EXTERNAL_SIGNING_FORMAT=
188 rm -f jarlog/en-US.log
189 $(call BUILDSTATUS,TIER_FINISH pgo_package)
190 $(call BUILDSTATUS,TIER_START pgo_profile)
191 JARLOG_FILE=jarlog/en-US.log $(PYTHON) $(topsrcdir)/build/pgo/profileserver.py
192 $(call BUILDSTATUS,TIER_FINISH pgo_profile)
193 $(call BUILDSTATUS,TIER_START pgo_clobber)
194 $(MAKE) maybe_clobber_profiledbuild
195 $(call BUILDSTATUS,TIER_FINISH pgo_clobber)
196 $(call BUILDSTATUS,TIER_START pgo_profile_use)
197 $(MAKE) default MOZ_PROFILE_USE=1 MOZ_1TIER_PGO=1
198 $(call BUILDSTATUS,TIER_FINISH pgo_profile_use)
200 # Change default target to PGO build if PGO is enabled.
201 ifdef MOZ_PGO
202 ifdef COMPILE_ENVIRONMENT
203 # If one of these is already set in addition to PGO we are doing a single phase
204 # of PGO in isolation, so don't override the default target.
205 ifeq (,$(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE))
206 OVERRIDE_DEFAULT_GOAL := profiledbuild
207 endif
208 endif
209 endif
211 include $(topsrcdir)/config/rules.mk
213 ifdef SCCACHE_VERBOSE_STATS
214 default::
215 -$(CCACHE) --show-stats --stats-format=json > sccache-stats.json
216 @echo "===SCCACHE STATS==="
217 -$(CCACHE) --show-stats
218 @echo "==================="
219 endif
221 distclean::
222 $(RM) $(DIST_GARBAGE)
224 ifdef MOZ_CRASHREPORTER
225 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
227 endif
229 .PHONY: prepsymbolsarchive
230 prepsymbolsarchive:
231 echo packing symbols
232 $(NSINSTALL) -D $(DIST)/$(PKG_PATH)
234 ifndef MOZ_AUTOMATION
235 prepsymbolsarchive: recurse_syms
236 endif
238 .PHONY: symbolsfullarchive
239 symbolsfullarchive: prepsymbolsarchive
240 $(RM) '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip'
241 $(call py_action,symbols_archive,'$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip' \
242 $(abspath $(DIST)/crashreporter-symbols) \
243 --full-archive)
245 .PHONY: symbolsarchive
246 symbolsarchive: prepsymbolsarchive
247 $(RM) '$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip'
248 $(call py_action,symbols_archive,'$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip' \
249 $(abspath $(DIST)/crashreporter-symbols))
251 ifdef MOZ_CRASHREPORTER
252 # Set MOZ_DISABLE_FULL_SYMBOLS to disable generation and upload of the full
253 # crashreporter symbols archives
254 ifdef MOZ_DISABLE_FULL_SYMBOLS
255 buildsymbols: symbolsarchive
256 else
257 buildsymbols: symbolsfullarchive symbolsarchive
258 endif # MOZ_DISABLE_FULL_SYMBOLS
259 else
260 buildsymbols:
261 endif
263 uploadsymbols:
264 ifdef MOZ_CRASHREPORTER
265 $(PYTHON) -u $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.py '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip'
266 endif
268 .PHONY: update-packaging
269 update-packaging:
270 $(MAKE) -C tools/update-packaging
272 .PHONY: package-generated-sources
273 package-generated-sources:
274 $(call py_action,package_generated_sources,'$(DIST)/$(PKG_PATH)$(GENERATED_SOURCE_FILE_PACKAGE)')
276 # PGO support, but we can't do this test in client.mk
277 # No point in clobbering if PGO has been explicitly disabled.
278 ifdef NO_PROFILE_GUIDED_OPTIMIZE
279 maybe_clobber_profiledbuild:
280 else
281 maybe_clobber_profiledbuild: clean
282 ifneq (,$(findstring clang,$(CC_TYPE)))
283 $(LLVM_PROFDATA) merge -o $(DEPTH)/merged.profdata $(DEPTH)/*.profraw
284 endif
285 endif # NO_PROFILE_GUIDED_OPTIMIZE
287 .PHONY: maybe_clobber_profiledbuild
289 ifdef JS_STANDALONE
290 # Delegate js-specific rules to js
291 check-%:
292 $(MAKE) -C js/src $@
294 source-package install:
295 $(MAKE) -C js/src $@
297 # Every export rule depends on config/export, but the rule for config/export
298 # doesn't exist when building js non-standalone.
299 .PHONY: config/export
300 config/export:
302 endif
304 # There used to be build interdependencies here. They are now in config/recurse.mk