@@ -47,7 +47,7 @@ ifndef MOZ_PROFILE_USE
47
47
# We need to explicitly put BUILD_BACKEND_FILES here otherwise the rule in
48
48
# rules.mk doesn't run early enough.
49
49
$(TIERS ) binaries :: CLOBBER $(configure_dir ) /configure config.status $(BUILD_BACKEND_FILES )
50
- ifndef JS_STANDALONE
50
+ ifdef MOZ_WIDGET_TOOLKIT
51
51
ifdef COMPILE_ENVIRONMENT
52
52
$(TIERS ) binaries :: $(topsrcdir ) /js/src/configure js/src/config.status
53
53
endif
@@ -61,8 +61,7 @@ CLOBBER:
61
61
else
62
62
CLOBBER : $(topsrcdir ) /CLOBBER
63
63
@echo ' STOP! The CLOBBER file has changed.'
64
- @echo ' Please run the build through a sanctioned build wrapper, such as'
65
- @echo ' "mach build" or client.mk.'
64
+ @echo ' Please run the build through "mach build".'
66
65
@exit 1
67
66
endif
68
67
@@ -96,42 +95,16 @@ ifndef TEST_MOZBUILD
96
95
.PHONY : backend
97
96
backend : $(BUILD_BACKEND_FILES )
98
97
99
- # A traditional rule would look like this:
100
- # backend.%:
101
- # @echo do stuff
102
- #
103
- # But with -j<n>, and multiple items in BUILD_BACKEND_FILES, the command would
104
- # run multiple times in parallel.
105
- #
106
- # "Fortunately", make has some weird semantics for pattern rules: if there are
107
- # multiple targets in a pattern rule and each of them is matched at most once,
108
- # the command will only run once. So:
109
- # backend%RecursiveMakeBackend backend%FasterMakeBackend:
110
- # @echo do stuff
111
- # backend: backend.RecursiveMakeBackend backend.FasterMakeBackend
112
- # would only execute the command once.
113
- #
114
- # Credit where due: http://stackoverflow.com/questions/2973445/gnu-makefile-rule-generating-a-few-targets-from-a-single-source-file/3077254#3077254
115
- $(subst .,% ,$(BUILD_BACKEND_FILES ) ) :
116
- @echo ' Build configuration changed. Regenerating backend.'
117
- $(PYTHON ) config.status
98
+ include $(topsrcdir ) /build/rebuild-backend.mk
118
99
119
100
Makefile : $(BUILD_BACKEND_FILES )
120
101
@$(TOUCH ) $@
121
102
122
- define build_backend_rule
123
- $(1 ) _files := $$(shell cat $(1 ) .in)
124
- $(1 ) : $$($(1 ) _files)
125
- $$($(1 ) _files) :
126
-
127
- endef
128
- $(foreach file,$(BUILD_BACKEND_FILES),$(eval $(call build_backend_rule,$(file))))
129
-
130
103
default :: $(BUILD_BACKEND_FILES )
131
104
endif
132
105
133
106
install_manifests := \
134
- $(addprefix dist/,branding idl include public private sdk xpi-stage) \
107
+ $(addprefix dist/,branding idl include public private xpi-stage) \
135
108
_tests \
136
109
$(NULL )
137
110
# Skip the dist/bin install manifest when using the hybrid
@@ -148,7 +121,7 @@ install_manifest_depends = \
148
121
$(BUILD_BACKEND_FILES ) \
149
122
$(NULL )
150
123
151
- ifndef JS_STANDALONE
124
+ ifdef MOZ_WIDGET_TOOLKIT
152
125
ifdef COMPILE_ENVIRONMENT
153
126
install_manifest_depends += \
154
127
$(topsrcdir ) /js/src/configure \
@@ -171,40 +144,40 @@ faster: install-dist/idl
171
144
$(MAKE ) -C faster FASTER_RECURSIVE_MAKE=1
172
145
endif
173
146
174
- # process_install_manifest needs to be invoked with --no-remove when building
175
- # js as standalone because automated builds are building nspr separately and
176
- # that would remove the resulting files.
177
- # Eventually, a standalone js build would just be able to build nspr itself,
178
- # removing the need for the former.
179
- ifdef JS_STANDALONE
180
- NO_REMOVE =1
147
+ .PHONY : tup
148
+ tup :
149
+ $( call BUILDSTATUS,TIERS $( if $( MOZ_ARTIFACT_BUILDS ) ,artifact ) make tup)
150
+ ifdef MOZ_ARTIFACT_BUILDS
151
+ $(call BUILDSTATUS,TIER_START artifact)
152
+ $(MAKE) recurse_artifact
153
+ $(call BUILDSTATUS,TIER_FINISH artifact)
181
154
endif
155
+ $(call BUILDSTATUS,TIER_START make)
156
+ $(MAKE) buildid.h source-repo.h
157
+ $(call BUILDSTATUS,TIER_FINISH make)
158
+ $(call BUILDSTATUS,TIER_START tup)
159
+ @$(TUP) $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),,--verbose)
160
+ $(call BUILDSTATUS,TIER_FINISH tup)
182
161
183
- .PHONY : $(addprefix install-,$(subst /,_, $( install_manifests ) ) )
162
+ .PHONY : $(addprefix install-,$(install_manifests ) )
184
163
$(addprefix install-,$(install_manifests ) ) : install-% : $(install_manifest_depends )
185
164
ifneq (,$(filter FasterMake+RecursiveMake,$(BUILD_BACKENDS ) ) )
186
165
@# If we're using the hybrid FasterMake/RecursiveMake backend, we want
187
166
@# to ensure the FasterMake end doesn't have install manifests for the
188
167
@# same directory, because that would blow up
189
168
$(if $(wildcard _build_manifests/install/$(subst /,_,$*)),$(if $(wildcard faster/install_$(subst /,_,$*)*),$(error FasterMake and RecursiveMake ends of the hybrid build system want to handle $*)))
190
169
endif
191
- $(addprefix $(call py_action,process_install_manifest,$(if $(NO_REMOVE),--no-remove ) $*) ,$(wildcard _build_manifests/install/$(subst /,_,$*)))
170
+ $(addprefix $(call py_action,process_install_manifest,--track install_$(subst /,_,$*).track $*) ,$(wildcard _build_manifests/install/$(subst /,_,$*)))
192
171
193
172
# Dummy wrapper rule to allow the faster backend to piggy back
194
173
$(addprefix install-,$(subst /,_,$(filter dist/% ,$(install_manifests ) ) ) ) : install-dist_% : install-dist/% ;
195
174
196
175
.PHONY : install-tests
197
176
install-tests : install-test-files
198
177
199
- # We no longer run "make install-tests" directly before running tests, but we still
200
- # want to depend on things like config.status, hence this target.
201
- .PHONY : run-tests-deps
202
- run-tests-deps : $(install_manifest_depends )
203
-
204
- # Force --no-remove, because $objdir/_tests is handled by multiple manifests.
205
178
.PHONY : install-test-files
206
179
install-test-files :
207
- $(call py_action,process_install_manifest,--no-remove _tests _build_manifests/install/_test_files)
180
+ $(call py_action,process_install_manifest,--track install__test_files.track _tests _build_manifests/install/_test_files)
208
181
209
182
include $(topsrcdir ) /build/moz-automation.mk
210
183
@@ -214,6 +187,9 @@ ifneq ($(filter-out maybe_clobber_profiledbuild,$(MAKECMDGOALS)),)
214
187
GARBAGE_DIRS += dist _tests
215
188
endif
216
189
190
+ # Dummy rule for the cases below where we don't depend on dist/include
191
+ recurse_pre-export ::
192
+
217
193
# Windows PGO builds don't perform a clean before the 2nd pass. So, we want
218
194
# to preserve content for the 2nd pass on Windows. Everywhere else, we always
219
195
# process the install manifests as part of export.
@@ -224,23 +200,19 @@ ifndef NO_PROFILE_GUIDED_OPTIMIZE
224
200
ifneq ($(OS_ARCH ) _$(GNU_CC ) , WINNT_)
225
201
recurse_pre-export :: install-manifests
226
202
binaries ::
227
- @$(MAKE ) install-manifests NO_REMOVE=1 install_manifests=dist/include
203
+ @$(MAKE ) install-manifests install_manifests=dist/include
228
204
endif
229
205
endif
230
206
else # !MOZ_PROFILE_USE (normal build)
231
207
recurse_pre-export :: install-manifests
232
208
binaries ::
233
- @$(MAKE ) install-manifests NO_REMOVE=1 install_manifests=dist/include
209
+ @$(MAKE ) install-manifests install_manifests=dist/include
234
210
endif
235
211
236
- # For historical reasons that are unknown, $(DIST)/sdk is always blown away
237
- # with no regard for PGO passes. This decision could probably be revisited.
238
- recurse_pre-export :: install-dist/sdk
239
-
240
212
recurse_artifact :
241
213
$(topsrcdir ) /mach --log-no-times artifact install
242
214
243
- ifndef JS_STANDALONE
215
+ ifdef MOZ_WIDGET_TOOLKIT
244
216
ifdef ENABLE_TESTS
245
217
# Additional makefile targets to call automated test suites
246
218
include $(topsrcdir ) /testing/testsuite-targets.mk
@@ -250,108 +222,97 @@ endif
250
222
default all ::
251
223
$(call BUILDSTATUS,TIERS $(TIERS ) $(if $(MOZ_AUTOMATION ) ,$(MOZ_AUTOMATION_TIERS ) ) )
252
224
253
- include $(topsrcdir ) /config/rules.mk
225
+ # PGO build target.
226
+ profiledbuild ::
227
+ $(call BUILDSTATUS,TIERS pgo_profile_generate pgo_package pgo_profile pgo_clobber pgo_profile_use)
228
+ $(call BUILDSTATUS,TIER_START pgo_profile_generate)
229
+ $(MAKE ) default MOZ_PROFILE_GENERATE=1 MOZ_PGO_INSTRUMENTED=1
230
+ $(call BUILDSTATUS,TIER_FINISH pgo_profile_generate)
231
+ $(call BUILDSTATUS,TIER_START pgo_package)
232
+ $(MAKE ) package MOZ_PGO_INSTRUMENTED=1 MOZ_INTERNAL_SIGNING_FORMAT= MOZ_EXTERNAL_SIGNING_FORMAT=
233
+ rm -f jarlog/en-US.log
234
+ $(call BUILDSTATUS,TIER_FINISH pgo_package)
235
+ $(call BUILDSTATUS,TIER_START pgo_profile)
236
+ MOZ_PGO_INSTRUMENTED=1 JARLOG_FILE=jarlog/en-US.log $(PYTHON ) $(topsrcdir ) /build/pgo/profileserver.py 10
237
+ $(call BUILDSTATUS,TIER_FINISH pgo_profile)
238
+ $(call BUILDSTATUS,TIER_START pgo_clobber)
239
+ $(MAKE ) maybe_clobber_profiledbuild
240
+ $(call BUILDSTATUS,TIER_FINISH pgo_clobber)
241
+ $(call BUILDSTATUS,TIER_START pgo_profile_use)
242
+ $(MAKE ) default MOZ_PROFILE_USE=1
243
+ $(call BUILDSTATUS,TIER_FINISH pgo_profile_use)
244
+
245
+ # Change default target to PGO build if PGO is enabled.
246
+ ifdef MOZ_PGO
247
+ OVERRIDE_DEFAULT_GOAL := profiledbuild
248
+ endif
254
249
255
- distclean ::
256
- $(RM ) $(DIST_GARBAGE )
250
+ include $(topsrcdir ) /config/rules.mk
257
251
258
- ifeq ($(OS_ARCH ) ,WINNT)
259
- # we want to copy PDB files on Windows
260
- MAKE_SYM_STORE_ARGS := -c --vcs-info
261
- ifdef PDBSTR_PATH
262
- MAKE_SYM_STORE_ARGS += -i
263
- endif
264
- ifdef MSVC_HAS_DIA_SDK
265
- DUMP_SYMS_BIN ?= $(DIST ) /host/bin/dump_syms.exe
266
- else
267
- DUMP_SYMS_BIN ?= $(topsrcdir ) /toolkit/crashreporter/tools/win32/dump_syms_vc$(_MSC_VER ) .exe
268
- endif
269
- # PDB files don't get moved to dist, so we need to scan the whole objdir
270
- MAKE_SYM_STORE_PATH := .
271
- endif
272
- ifeq ($(OS_ARCH ) ,Darwin)
273
- # need to pass arch flags for universal builds
274
- ifdef UNIVERSAL_BINARY
275
- MAKE_SYM_STORE_ARGS := -c -a 'i386 x86_64' --vcs-info
276
- MAKE_SYM_STORE_PATH := $(DIST ) /universal
277
- else
278
- MAKE_SYM_STORE_ARGS := -c -a $(OS_TEST ) --vcs-info
279
- MAKE_SYM_STORE_PATH := $(DIST ) /bin
280
- endif
281
- DUMP_SYMS_BIN ?= $(DIST ) /host/bin/dump_syms
252
+ ifdef SCCACHE_VERBOSE_STATS
253
+ default ::
254
+ -$(CCACHE ) --show-stats --stats-format=json > sccache-stats.json
255
+ @echo " ===SCCACHE STATS==="
256
+ -$(CCACHE ) --show-stats
257
+ @echo " ==================="
258
+ ifndef MOZ_PROFILE_GENERATE
259
+ # Ideally we'd do that in the same file as we set the sccache.log location for
260
+ # sccache, but it's too late in the build.
261
+ -gzip -9 $(DIST)/sccache.log
282
262
endif
283
- ifeq (,$(filter-out Linux SunOS,$(OS_ARCH ) ) )
284
- MAKE_SYM_STORE_ARGS := -c --vcs-info
285
- DUMP_SYMS_BIN ?= $(DIST ) /host/bin/dump_syms
286
- MAKE_SYM_STORE_PATH := $(DIST ) /bin
287
263
endif
288
- MAKE_SYM_STORE_ARGS += --install-manifest=$(DEPTH ) /_build_manifests/install/dist_include,$(DIST ) /include
289
264
290
- SYM_STORE_SOURCE_DIRS := $(topsrcdir )
265
+ distclean ::
266
+ $(RM ) $(DIST_GARBAGE )
291
267
292
268
ifdef MOZ_CRASHREPORTER
293
269
include $(topsrcdir ) /toolkit/mozapps/installer/package-name.mk
294
270
295
- SYMBOL_INDEX_NAME = \
296
- $(MOZ_APP_NAME ) -$(MOZ_APP_VERSION ) -$(OS_TARGET ) -$(BUILDID ) -$(CPU_ARCH ) -symbols.txt
297
271
endif
298
272
299
- buildsymbols :
300
- ifdef MOZ_CRASHREPORTER
301
- echo building symbol store
302
- $(RM) -r $(DIST)/crashreporter-symbols
303
- $(RM) '$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip'
304
- $(RM) '$(DIST)/$(SYMBOL_FULL_ARCHIVE_BASENAME).zip'
305
- $(NSINSTALL) -D $(DIST)/crashreporter-symbols
306
- OBJCOPY='$(OBJCOPY)' \
307
- $(PYTHON) $(topsrcdir)/toolkit/crashreporter/tools/symbolstore.py \
308
- $(MAKE_SYM_STORE_ARGS) \
309
- $(foreach dir,$(SYM_STORE_SOURCE_DIRS),-s $(dir)) \
310
- $(DUMP_SYMS_BIN) \
311
- $(DIST)/crashreporter-symbols \
312
- $(MAKE_SYM_STORE_PATH) | grep -iv test > \
313
- $(DIST)/crashreporter-symbols/$(SYMBOL_INDEX_NAME)
273
+ .PHONY : prepsymbolsarchive
274
+ prepsymbolsarchive :
314
275
echo packing symbols
315
276
$(NSINSTALL ) -D $(DIST ) /$(PKG_PATH )
316
- cd $(DIST)/crashreporter-symbols && \
317
- zip -r5D '../$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip' . -x '*test*' -x '*Test*'
318
- cd $(DIST)/crashreporter-symbols && \
319
- grep 'sym' $(SYMBOL_INDEX_NAME) > $(SYMBOL_INDEX_NAME).tmp && \
320
- mv $(SYMBOL_INDEX_NAME).tmp $(SYMBOL_INDEX_NAME)
321
- cd $(DIST)/crashreporter-symbols && \
322
- zip -r5D '../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip' . -i '*.sym' -i '*.txt' -x '*test*' -x '*Test*'
323
- endif # MOZ_CRASHREPORTER
277
+
278
+ ifndef MOZ_AUTOMATION
279
+ prepsymbolsarchive : recurse_syms
280
+ endif
281
+
282
+ .PHONY : symbolsfullarchive
283
+ symbolsfullarchive : prepsymbolsarchive
284
+ $(RM ) ' $(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip'
285
+ $(call py_action,symbols_archive,'$(DIST ) /$(PKG_PATH )$(SYMBOL_FULL_ARCHIVE_BASENAME ) .zip' \
286
+ $(abspath $(DIST)/crashreporter-symbols) \
287
+ --exclude '*test*' \
288
+ --exclude '*Test*' \
289
+ --compress '**/*.sym')
290
+
291
+ .PHONY : symbolsarchive
292
+ symbolsarchive : prepsymbolsarchive
293
+ $(RM ) ' $(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip'
294
+ $(call py_action,symbols_archive,'$(DIST ) /$(PKG_PATH )$(SYMBOL_ARCHIVE_BASENAME ) .zip' \
295
+ $(abspath $(DIST)/crashreporter-symbols) \
296
+ --include '**/*.sym')
297
+
298
+ ifdef MOZ_CRASHREPORTER
299
+ buildsymbols : symbolsfullarchive symbolsarchive
300
+ else
301
+ buildsymbols :
302
+ endif
324
303
325
304
uploadsymbols :
326
305
ifdef MOZ_CRASHREPORTER
327
- ifdef SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE
328
306
$(PYTHON) -u $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.py '$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip'
329
307
endif
330
- endif
331
308
332
309
.PHONY : update-packaging
333
310
update-packaging :
334
311
$(MAKE ) -C tools/update-packaging
335
312
336
- .PHONY : pretty-package
337
- pretty-package :
338
- unset MOZ_SIGN_CMD && $(MAKE ) package MOZ_PKG_PRETTYNAMES=1
339
-
340
- .PHONY : pretty-package-tests
341
- pretty-package-tests :
342
- unset MOZ_SIGN_CMD && $(MAKE ) package-tests MOZ_PKG_PRETTYNAMES=1
343
-
344
- .PHONY : pretty-l10n-check
345
- pretty-l10n-check :
346
- unset MOZ_SIGN_CMD && $(MAKE ) l10n-check MOZ_PKG_PRETTYNAMES=1
347
-
348
- .PHONY : pretty-update-packaging
349
- pretty-update-packaging :
350
- unset MOZ_SIGN_CMD && $(MAKE ) -C tools/update-packaging MOZ_PKG_PRETTYNAMES=1
351
-
352
- .PHONY : pretty-installer
353
- pretty-installer :
354
- unset MOZ_SIGN_CMD && $(MAKE ) installer MOZ_PKG_PRETTYNAMES=1
313
+ .PHONY : package-generated-sources
314
+ package-generated-sources :
315
+ $(call py_action,package_generated_sources,'$(DIST ) /$(PKG_PATH )$(GENERATED_SOURCE_FILE_PACKAGE ) ')
355
316
356
317
# XXX: this is a hack, since we don't want to clobber for MSVC
357
318
# PGO support, but we can't do this test in client.mk
0 commit comments