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
)
10 ifneq ($(make_min_ver
),$(firstword $(sort $(make_min_ver
) $(MAKE_VERSION
))))
11 $(error GNU Make
$(make_min_ver
) or higher is required
)
14 export TOPLEVEL_BUILD
:= 1
20 include $(wildcard $(topsrcdir
)/$(MOZ_BUILD_APP
)/build.mk
)
24 include $(topsrcdir
)/config
/config.mk
26 ifneq (mobile
/android
,$(MOZ_BUILD_APP
))
27 $(MDDEPDIR
)/buildid.h.stub
$(MDDEPDIR
)/source-repo.h.stub
: FORCE
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
)))
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
)
44 CLOBBER
: $(topsrcdir
)/CLOBBER
45 @echo
'STOP! The CLOBBER file has changed.'
46 @echo
'Please run the build through "mach build".'
50 install_manifests
:= \
51 $(addprefix dist/,branding
include public private xpi-stage
) \
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
61 install_manifest_depends
= \
63 $(BUILD_BACKEND_FILES
) \
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
75 $(MAKE
) -C faster FASTER_RECURSIVE_MAKE
=1
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
$*)))
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
/% ;
92 install-tests
: install-test-files
94 .PHONY
: 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
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
107 @
$(MAKE
) install-manifests install_manifests
=dist/include
109 ifdef BUILD_VERBOSE_LOG
114 $(PYTHON3
) $(topsrcdir
)/mach
--log-no-times artifact
install$(if
$(MOZ_ARTIFACT_BUILD_SYMBOLS
), --symbols
$(addprefix =,$(filter full
,$(MOZ_ARTIFACT_BUILD_SYMBOLS
)))) $(if
$(ENABLE_TESTS
),,--no-tests
) $(verbose_flag
)
116 ifdef MOZ_ANDROID_FAT_AAR_ARCHITECTURES
117 recurse_android-fat-aar-artifact
:
118 $(call py_action
,fat_aar
,\
119 $(addprefix --armeabi-v7a
$(MOZ_FETCHES_DIR
)/,$(MOZ_ANDROID_FAT_AAR_ARMEABI_V7A
)) \
120 $(addprefix --arm64-v8a
$(MOZ_FETCHES_DIR
)/,$(MOZ_ANDROID_FAT_AAR_ARM64_V8A
)) \
121 $(addprefix --x86
$(MOZ_FETCHES_DIR
)/,$(MOZ_ANDROID_FAT_AAR_X86
)) \
122 $(addprefix --x86-64
$(MOZ_FETCHES_DIR
)/,$(MOZ_ANDROID_FAT_AAR_X86_64
)) \
123 --distdir
$(abspath
$(DIST
)/fat-aar
))
126 ifeq ($(MOZ_BUILD_APP
),mobile
/android
)
128 recurse_android-stage-package
: stage-package
130 recurse_android-archive-geckoview
:
131 GRADLE_INVOKED_WITHIN_MACH_BUILD
=1 $(topsrcdir
)/mach
--log-no-times android archive-geckoview
134 ifdef MOZ_WIDGET_TOOLKIT
136 # Additional makefile targets to call automated test suites
137 include $(topsrcdir
)/testing
/testsuite-targets.mk
142 $(call BUILDSTATUS
,TIERS
$(TIERS
) $(if
$(MOZ_AUTOMATION
),$(MOZ_AUTOMATION_TIERS
)))
144 include $(topsrcdir
)/config
/rules.mk
146 ifdef SCCACHE_VERBOSE_STATS
148 -$(CCACHE
) --show-stats
--stats-format
=json
> '$(UPLOAD_PATH)/sccache-stats.json'
149 @echo
"===SCCACHE STATS==="
150 -$(CCACHE
) --show-stats
151 @echo
"==================="
154 ifdef MOZ_CRASHREPORTER
155 include $(topsrcdir
)/toolkit
/mozapps
/installer
/package-name.mk
159 .PHONY
: prepsymbolsarchive
162 $(NSINSTALL
) -D
$(DIST
)/$(PKG_PATH
)
164 ifndef MOZ_AUTOMATION
165 prepsymbolsarchive
: recurse_syms
168 .PHONY
: symbolsfullarchive
169 symbolsfullarchive
: prepsymbolsarchive
170 $(RM
) '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).tar.zst'
171 $(call py_action
,symbols_archive
,'$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).tar.zst' \
172 $(abspath
$(DIST
)/crashreporter-symbols
) \
175 .PHONY
: symbolsarchive
176 symbolsarchive
: prepsymbolsarchive
177 $(RM
) '$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip'
178 $(call py_action
,symbols_archive
,'$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip' \
179 $(abspath
$(DIST
)/crashreporter-symbols
))
181 ifdef MOZ_CRASHREPORTER
182 # Set MOZ_ENABLE_FULL_SYMBOLS to enable generation and upload of the full
183 # crashreporter symbols archives
184 ifdef MOZ_ENABLE_FULL_SYMBOLS
185 buildsymbols
: symbolsfullarchive symbolsarchive
187 buildsymbols
: symbolsarchive
188 endif # MOZ_ENABLE_FULL_SYMBOLS
191 @echo
"Skipping symbols generation because MOZ_CRASHREPORTER is not set."
195 ifdef MOZ_CRASHREPORTER
196 $(PYTHON3
) -u
$(topsrcdir
)/toolkit
/crashreporter
/tools
/upload_symbols.py
'$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).tar.zst'
199 .PHONY
: package-generated-sources
200 package-generated-sources
:
201 $(call py_action
,package_generated_sources
,'$(DIST)/$(PKG_PATH)$(GENERATED_SOURCE_FILE_PACKAGE)')
204 # Delegate js-specific rules to js
208 source-package
install:
211 # Every export rule depends on config/export, but the rule for config/export
212 # doesn't exist when building js non-standalone.
213 .PHONY
: config
/export
218 # There used to be build interdependencies here. They are now in config/recurse.mk