Bug 1686476 [wpt PR 27145] - [AspectRatio] Correctly handle intrinsic size for replac...
[gecko.git] / Makefile.in
blob9ceb4c20f75f99059ee3d8f9db442c3de052591c
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 ifneq (mobile/android,$(MOZ_BUILD_APP))
27 $(MDDEPDIR)/buildid.h.stub $(MDDEPDIR)/source-repo.h.stub: FORCE
28 endif
29 source-repo.h: $(MDDEPDIR)/source-repo.h.stub
30 buildid.h: $(MDDEPDIR)/buildid.h.stub
32 BUILD_BACKEND_FILES := $(addprefix backend.,$(addsuffix Backend,$(BUILD_BACKENDS)))
34 ifndef TEST_MOZBUILD
35 # We need to explicitly put BUILD_BACKEND_FILES here otherwise the rule in
36 # rules.mk doesn't run early enough.
37 $(RUNNABLE_TIERS) binaries:: CLOBBER $(BUILD_BACKEND_FILES)
38 endif
40 ifdef JS_STANDALONE
41 .PHONY: CLOBBER
42 CLOBBER:
43 else
44 CLOBBER: $(topsrcdir)/CLOBBER
45 @echo 'STOP! The CLOBBER file has changed.'
46 @echo 'Please run the build through "mach build".'
47 @exit 1
48 endif
50 install_manifests := \
51 $(addprefix dist/,branding include public private xpi-stage) \
52 _tests \
53 $(NULL)
54 # Skip the dist/bin install manifest when using the hybrid
55 # FasterMake/RecursiveMake backend. This is a hack until bug 1241744 moves
56 # xpidl handling to FasterMake in that case, mechanically making the dist/bin
57 # install manifest non-existent (non-existent manifests being skipped)
58 ifeq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
59 install_manifests += dist/bin
60 endif
61 install_manifest_depends = \
62 CLOBBER \
63 $(BUILD_BACKEND_FILES) \
64 $(NULL)
66 .PHONY: install-manifests
67 install-manifests: $(addprefix install-,$(install_manifests))
69 # If we're using the hybrid FasterMake/RecursiveMake backend, we want
70 # to recurse in the faster/ directory in parallel of install manifests.
71 ifneq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
72 install-manifests: faster
73 .PHONY: faster
74 faster:
75 $(MAKE) -C faster FASTER_RECURSIVE_MAKE=1
76 endif
78 .PHONY: $(addprefix install-,$(install_manifests))
79 $(addprefix install-,$(install_manifests)): install-%: $(install_manifest_depends)
80 ifneq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS)))
81 @# If we're using the hybrid FasterMake/RecursiveMake backend, we want
82 @# to ensure the FasterMake end doesn't have install manifests for the
83 @# same directory, because that would blow up
84 $(if $(wildcard _build_manifests/install/$(subst /,_,$*)),$(if $(wildcard faster/install_$(subst /,_,$*)*),$(error FasterMake and RecursiveMake ends of the hybrid build system want to handle $*)))
85 endif
86 $(addprefix $(call py_action,process_install_manifest,$(if $(filter copy,$(NSDISTMODE)),--no-symlinks )--track install_$(subst /,_,$*).track $*) ,$(wildcard _build_manifests/install/$(subst /,_,$*)))
88 # Dummy wrapper rule to allow the faster backend to piggy back
89 $(addprefix install-,$(subst /,_,$(filter dist/%,$(install_manifests)))): install-dist_%: install-dist/% ;
91 .PHONY: install-tests
92 install-tests: install-test-files
94 .PHONY: install-test-files
95 install-test-files:
96 $(call py_action,process_install_manifest,$(if $(filter copy,$(NSDISTMODE)),--no-symlinks )--track install__test_files.track _tests _build_manifests/install/_test_files)
98 include $(topsrcdir)/build/moz-automation.mk
100 # Dummy rule for the cases below where we don't depend on dist/include
101 recurse_pre-export::
103 # For the binaries rule, not all the install manifests matter, so force only
104 # the interesting ones to be done.
105 recurse_pre-export:: install-manifests
106 binaries::
107 @$(MAKE) install-manifests install_manifests=dist/include
109 ifdef BUILD_VERBOSE_LOG
110 verbose_flag = -v
111 endif
113 # Host binaries are not produced for macOS consumers: that is, there's
114 # no macOS-hosted job to produce them at this time. Therefore we
115 # enable --host-bins only for automation builds, which only require Linux and
116 # Windows host binaries.
117 recurse_artifact:
118 $(PYTHON3) $(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) $(verbose_flag)
120 ifdef MOZ_EME_WIN32_ARTIFACT
121 recurse_win32-artifact:
122 rm -rf $(DIST)/i686
123 $(PYTHON3) $(topsrcdir)/mach --log-no-times artifact install --job win32-opt --no-tests --distdir $(DIST)/i686 $(verbose_flag)
124 mv $(DIST)/i686/bin/* $(DIST)/i686
125 endif
127 ifdef MOZ_ANDROID_FAT_AAR_ARCHITECTURES
128 recurse_android-fat-aar-artifact:
129 $(call py_action,fat_aar,\
130 $(addprefix --armeabi-v7a $(MOZ_FETCHES_DIR)/,$(MOZ_ANDROID_FAT_AAR_ARMEABI_V7A)) \
131 $(addprefix --arm64-v8a $(MOZ_FETCHES_DIR)/,$(MOZ_ANDROID_FAT_AAR_ARM64_V8A)) \
132 $(addprefix --x86 $(MOZ_FETCHES_DIR)/,$(MOZ_ANDROID_FAT_AAR_X86)) \
133 $(addprefix --x86-64 $(MOZ_FETCHES_DIR)/,$(MOZ_ANDROID_FAT_AAR_X86_64)) \
134 --distdir $(abspath $(DIST)/fat-aar))
135 endif
137 ifeq ($(MOZ_BUILD_APP),mobile/android)
139 recurse_android-stage-package: stage-package
141 recurse_android-archive-geckoview:
142 GRADLE_INVOKED_WITHIN_MACH_BUILD=1 $(topsrcdir)/mach --log-no-times android archive-geckoview
143 endif
145 ifdef MOZ_WIDGET_TOOLKIT
146 ifdef ENABLE_TESTS
147 # Additional makefile targets to call automated test suites
148 include $(topsrcdir)/testing/testsuite-targets.mk
149 endif
150 endif
152 default all::
153 $(call BUILDSTATUS,TIERS $(TIERS) $(if $(MOZ_AUTOMATION),$(MOZ_AUTOMATION_TIERS)))
155 include $(topsrcdir)/config/rules.mk
157 ifdef SCCACHE_VERBOSE_STATS
158 default::
159 -$(CCACHE) --show-stats --stats-format=json > sccache-stats.json
160 @echo "===SCCACHE STATS==="
161 -$(CCACHE) --show-stats
162 @echo "==================="
163 endif
165 ifdef MOZ_CRASHREPORTER
166 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
168 endif
170 .PHONY: prepsymbolsarchive
171 prepsymbolsarchive:
172 echo packing symbols
173 $(NSINSTALL) -D $(DIST)/$(PKG_PATH)
175 ifndef MOZ_AUTOMATION
176 prepsymbolsarchive: recurse_syms
177 endif
179 .PHONY: symbolsfullarchive
180 symbolsfullarchive: prepsymbolsarchive
181 $(RM) '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).tar.zst'
182 $(call py_action,symbols_archive,'$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).tar.zst' \
183 $(abspath $(DIST)/crashreporter-symbols) \
184 --full-archive)
186 .PHONY: symbolsarchive
187 symbolsarchive: prepsymbolsarchive
188 $(RM) '$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip'
189 $(call py_action,symbols_archive,'$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip' \
190 $(abspath $(DIST)/crashreporter-symbols))
192 ifdef MOZ_CRASHREPORTER
193 # Set MOZ_ENABLE_FULL_SYMBOLS to enable generation and upload of the full
194 # crashreporter symbols archives
195 ifdef MOZ_ENABLE_FULL_SYMBOLS
196 buildsymbols: symbolsfullarchive symbolsarchive
197 else
198 buildsymbols: symbolsarchive
199 endif # MOZ_ENABLE_FULL_SYMBOLS
200 else
201 buildsymbols:
202 endif
204 uploadsymbols:
205 ifdef MOZ_CRASHREPORTER
206 $(PYTHON3) -u $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.py '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).tar.zst'
207 endif
209 .PHONY: update-packaging
210 update-packaging:
211 $(MAKE) -C tools/update-packaging
213 .PHONY: package-generated-sources
214 package-generated-sources:
215 $(call py_action,package_generated_sources,'$(DIST)/$(PKG_PATH)$(GENERATED_SOURCE_FILE_PACKAGE)')
217 ifdef JS_STANDALONE
218 # Delegate js-specific rules to js
219 check-%:
220 $(MAKE) -C js/src $@
222 source-package install:
223 $(MAKE) -C js/src $@
225 # Every export rule depends on config/export, but the rule for config/export
226 # doesn't exist when building js non-standalone.
227 .PHONY: config/export
228 config/export:
230 endif
232 # There used to be build interdependencies here. They are now in config/recurse.mk