Bug 1528152 [wpt PR 15381] - Quirks: move vertical-align-in-quirks.html to historical...
[gecko.git] / Makefile.in
blob5724d031152a35bbec84ce10011568523add06e7
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 DIST_GARBAGE = config.cache config.log config.status* config-defs.h \
28 config/autoconf.mk \
29 mozilla-config.h \
30 netwerk/necko-config.h xpcom/xpcom-config.h xpcom/xpcom-private.h \
31 .mozconfig.mk
33 ifndef MOZ_PROFILE_USE
34 # Automation builds should always have a new buildid, but for the sake of not
35 # re-linking libxul on every incremental build we do not enforce this for
36 # developer builds. Tests always need a new buildid as well.
37 ifneq (,$(MOZ_AUTOMATION)$(MOZ_BUILD_DATE)$(TEST_MOZBUILD))
38 $(MDDEPDIR)/buildid.h.stub $(MDDEPDIR)/source-repo.h.stub: FORCE
39 endif
40 # Additionally, provide a dummy target during tests, because
41 # faster/rules.mk will expect these targets to exist.
42 ifdef TEST_MOZBUILD
43 source-repo.h: $(MDDEPDIR)/source-repo.h.stub
44 buildid.h: $(MDDEPDIR)/buildid.h.stub
45 endif
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 $(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 # Regenerate the build backend if it is out of date. We only have this rule in
69 # this main make file because having it in rules.mk and applied to partial tree
70 # builds resulted in a world of hurt. Gory details are in bug 877308.
72 # The mach build driver will ensure the backend is up to date for partial tree
73 # builds. This cleanly avoids most of the pain.
75 ifndef TEST_MOZBUILD
77 .PHONY: backend
78 backend: $(BUILD_BACKEND_FILES)
80 include $(topsrcdir)/build/rebuild-backend.mk
82 Makefile: $(BUILD_BACKEND_FILES)
83 @$(TOUCH) $@
85 default:: $(BUILD_BACKEND_FILES)
86 endif
88 install_manifests := \
89 $(addprefix dist/,branding include public private xpi-stage) \
90 _tests \
91 $(NULL)
92 # Skip the dist/bin install manifest when using the hybrid
93 # FasterMake/RecursiveMake backend. This is a hack until bug 1241744 moves
94 # xpidl handling to FasterMake in that case, mechanically making the dist/bin
95 # install manifest non-existent (non-existent manifests being skipped)
96 ifeq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
97 install_manifests += dist/bin
98 endif
99 install_manifest_depends = \
100 CLOBBER \
101 $(BUILD_BACKEND_FILES) \
102 $(NULL)
104 .PHONY: install-manifests
105 install-manifests: $(addprefix install-,$(install_manifests))
107 # If we're using the hybrid FasterMake/RecursiveMake backend, we want
108 # to recurse in the faster/ directory in parallel of install manifests.
109 ifneq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
110 install-manifests: faster
111 .PHONY: faster
112 faster:
113 $(MAKE) -C faster FASTER_RECURSIVE_MAKE=1
114 endif
116 .PHONY: $(addprefix install-,$(install_manifests))
117 $(addprefix install-,$(install_manifests)): install-%: $(install_manifest_depends)
118 ifneq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
119 @# If we're using the hybrid FasterMake/RecursiveMake backend, we want
120 @# to ensure the FasterMake end doesn't have install manifests for the
121 @# same directory, because that would blow up
122 $(if $(wildcard _build_manifests/install/$(subst /,_,$*)),$(if $(wildcard faster/install_$(subst /,_,$*)*),$(error FasterMake and RecursiveMake ends of the hybrid build system want to handle $*)))
123 endif
124 $(addprefix $(call py_action,process_install_manifest,--track install_$(subst /,_,$*).track $*) ,$(wildcard _build_manifests/install/$(subst /,_,$*)))
126 # Dummy wrapper rule to allow the faster backend to piggy back
127 $(addprefix install-,$(subst /,_,$(filter dist/%,$(install_manifests)))): install-dist_%: install-dist/% ;
129 .PHONY: install-tests
130 install-tests: install-test-files
132 .PHONY: install-test-files
133 install-test-files:
134 $(call py_action,process_install_manifest,--track install__test_files.track _tests _build_manifests/install/_test_files)
136 include $(topsrcdir)/build/moz-automation.mk
138 # dist and _tests should be purged during cleaning. However, we don't want them
139 # purged during PGO builds because they contain some auto-generated files.
140 ifneq ($(filter-out maybe_clobber_profiledbuild,$(MAKECMDGOALS)),)
141 GARBAGE_DIRS += dist _tests
142 endif
144 # Dummy rule for the cases below where we don't depend on dist/include
145 recurse_pre-export::
147 # Windows PGO builds don't perform a clean before the 2nd pass. So, we want
148 # to preserve content for the 2nd pass on Windows. Everywhere else, we always
149 # process the install manifests as part of export.
150 # For the binaries rule, not all the install manifests matter, so force only
151 # the interesting ones to be done.
152 ifdef MOZ_PROFILE_USE
153 ifndef NO_PROFILE_GUIDED_OPTIMIZE
154 ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
155 recurse_pre-export:: install-manifests
156 binaries::
157 @$(MAKE) install-manifests install_manifests=dist/include
158 endif
159 endif
160 else # !MOZ_PROFILE_USE (normal build)
161 recurse_pre-export:: install-manifests
162 binaries::
163 @$(MAKE) install-manifests install_manifests=dist/include
164 endif
166 # Host binaries are not produced for macOS consumers: that is, there's
167 # no macOS-hosted job to produce them at this time. Therefore we
168 # enable --host-bins only for automation builds, which only require Linux and
169 # Windows host binaries.
170 recurse_artifact:
171 $(topsrcdir)/mach --log-no-times artifact install$(if $(MOZ_ARTIFACT_BUILD_SYMBOLS), --symbols)$(if $(MOZ_AUTOMATION), --host-bins)
173 ifdef MOZ_EME_WIN32_ARTIFACT
174 recurse_win32-artifact:
175 rm -rf $(DIST)/i686
176 $(topsrcdir)/mach --log-no-times artifact install --job $(if $(MOZ_PGO),win32-pgo,win32-opt) --no-tests --distdir $(DIST)/i686
177 mv $(DIST)/i686/bin/* $(DIST)/i686
178 endif
180 ifdef MOZ_WIDGET_TOOLKIT
181 ifdef ENABLE_TESTS
182 # Additional makefile targets to call automated test suites
183 include $(topsrcdir)/testing/testsuite-targets.mk
184 endif
185 endif
187 default all::
188 $(call BUILDSTATUS,TIERS $(TIERS) $(if $(MOZ_AUTOMATION),$(MOZ_AUTOMATION_TIERS)))
190 # PGO build target.
191 profiledbuild::
192 $(call BUILDSTATUS,TIERS pgo_profile_generate pgo_package pgo_profile pgo_clobber pgo_profile_use)
193 $(call BUILDSTATUS,TIER_START pgo_profile_generate)
194 $(MAKE) default MOZ_PROFILE_GENERATE=1 MOZ_LTO=
195 $(call BUILDSTATUS,TIER_FINISH pgo_profile_generate)
196 $(call BUILDSTATUS,TIER_START pgo_package)
197 $(MAKE) package MOZ_INTERNAL_SIGNING_FORMAT= MOZ_EXTERNAL_SIGNING_FORMAT=
198 rm -f jarlog/en-US.log
199 $(call BUILDSTATUS,TIER_FINISH pgo_package)
200 $(call BUILDSTATUS,TIER_START pgo_profile)
201 JARLOG_FILE=jarlog/en-US.log $(PYTHON) $(topsrcdir)/build/pgo/profileserver.py
202 $(call BUILDSTATUS,TIER_FINISH pgo_profile)
203 $(call BUILDSTATUS,TIER_START pgo_clobber)
204 $(MAKE) maybe_clobber_profiledbuild
205 $(call BUILDSTATUS,TIER_FINISH pgo_clobber)
206 $(call BUILDSTATUS,TIER_START pgo_profile_use)
207 $(MAKE) default MOZ_PROFILE_USE=1 $(if $(CLANG_CL),MOZ_PROFILE_ORDER_FILE=$(topobjdir)/cygprofile.txt)
208 $(call BUILDSTATUS,TIER_FINISH pgo_profile_use)
210 # Change default target to PGO build if PGO is enabled.
211 ifdef MOZ_PGO
212 ifdef COMPILE_ENVIRONMENT
213 # If one of these is already set in addition to PGO we are doing a single phase
214 # of PGO in isolation, so don't override the default target.
215 ifeq (,$(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE))
216 OVERRIDE_DEFAULT_GOAL := profiledbuild
217 endif
218 endif
219 endif
221 include $(topsrcdir)/config/rules.mk
223 ifdef SCCACHE_VERBOSE_STATS
224 default::
225 -$(CCACHE) --show-stats --stats-format=json > sccache-stats.json
226 @echo "===SCCACHE STATS==="
227 -$(CCACHE) --show-stats
228 @echo "==================="
229 endif
231 distclean::
232 $(RM) $(DIST_GARBAGE)
234 ifdef MOZ_CRASHREPORTER
235 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
237 endif
239 .PHONY: prepsymbolsarchive
240 prepsymbolsarchive:
241 echo packing symbols
242 $(NSINSTALL) -D $(DIST)/$(PKG_PATH)
244 ifndef MOZ_AUTOMATION
245 prepsymbolsarchive: recurse_syms
246 endif
248 .PHONY: symbolsfullarchive
249 symbolsfullarchive: prepsymbolsarchive
250 $(RM) '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip'
251 $(call py_action,symbols_archive,'$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip' \
252 $(abspath $(DIST)/crashreporter-symbols) \
253 --full-archive)
255 .PHONY: symbolsarchive
256 symbolsarchive: prepsymbolsarchive
257 $(RM) '$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip'
258 $(call py_action,symbols_archive,'$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip' \
259 $(abspath $(DIST)/crashreporter-symbols))
261 ifdef MOZ_CRASHREPORTER
262 # Set MOZ_DISABLE_FULL_SYMBOLS to disable generation and upload of the full
263 # crashreporter symbols archives
264 ifdef MOZ_DISABLE_FULL_SYMBOLS
265 buildsymbols: symbolsarchive
266 else
267 buildsymbols: symbolsfullarchive symbolsarchive
268 endif # MOZ_DISABLE_FULL_SYMBOLS
269 else
270 buildsymbols:
271 endif
273 uploadsymbols:
274 ifdef MOZ_CRASHREPORTER
275 $(PYTHON) -u $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.py '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip'
276 endif
278 .PHONY: update-packaging
279 update-packaging:
280 $(MAKE) -C tools/update-packaging
282 .PHONY: package-generated-sources
283 package-generated-sources:
284 $(call py_action,package_generated_sources,'$(DIST)/$(PKG_PATH)$(GENERATED_SOURCE_FILE_PACKAGE)')
286 # PGO support, but we can't do this test in client.mk
287 # No point in clobbering if PGO has been explicitly disabled.
288 ifdef NO_PROFILE_GUIDED_OPTIMIZE
289 maybe_clobber_profiledbuild:
290 else
291 maybe_clobber_profiledbuild: clean
292 ifneq (,$(findstring clang,$(CC_TYPE)))
293 $(LLVM_PROFDATA) merge -o $(DEPTH)/merged.profdata $(DEPTH)/*.profraw
294 endif
295 endif # NO_PROFILE_GUIDED_OPTIMIZE
297 .PHONY: maybe_clobber_profiledbuild
299 ifdef JS_STANDALONE
300 # Delegate js-specific rules to js
301 check-%:
302 $(MAKE) -C js/src $@
304 source-package install:
305 $(MAKE) -C js/src $@
307 # Every export rule depends on config/export, but the rule for config/export
308 # doesn't exist when building js non-standalone.
309 .PHONY: config/export
310 config/export:
312 endif
314 # There used to be build interdependencies here. They are now in config/recurse.mk