Bug 705479 - Throw an error when building Firefox on Windows with gmake with multiple CPUs. r=khuey
authorJon Buckley <jon@jbuckley.ca>
Tue, 29 Nov 2011 16:33:09 -0500
changeset 81788 0e5dfc784411bf06ed09da884a6791aa127a2d06
parent 81787 5559ff27e7a227b6b104220cefd2e33c2b54542a
child 81789 ca140190529a80e7decb5277127af9d527a7846a
push idunknown
push userunknown
push dateunknown
reviewerskhuey
bugs705479
milestone11.0a1
Bug 705479 - Throw an error when building Firefox on Windows with gmake with multiple CPUs. r=khuey
browser/build.mk
--- a/browser/build.mk
+++ b/browser/build.mk
@@ -50,16 +50,32 @@ tier_app_dirs += $(MOZ_BRANDING_DIRECTOR
 ifdef MOZ_SERVICES_SYNC
 tier_app_dirs += services
 endif
 
 tier_app_dirs += browser
 # Never add other tier_app_dirs after browser. They won't get packaged
 # properly on mac.
 
+################################################
+# Parallel build on Windows with GNU make check
+
+default::
+ifeq (,$(findstring pymake,$(MAKE)))
+ifeq ($(HOST_OS_ARCH),WINNT)
+ifneq (1,$(NUMBER_OF_PROCESSORS))
+	@echo $(if $(findstring -j,$(value MAKEFLAGS)), \
+$(error You are using GNU make to build Firefox with -jN on Windows. \
+This will randomly deadlock. To compile a parallel build on Windows \
+run "python -OO build/pymake/make.py -f client.mk build". \
+See https://developer.mozilla.org/en/pymake for more details.))
+endif
+endif
+endif
+
 installer:
 	@$(MAKE) -C browser/installer installer
 
 package:
 	@$(MAKE) -C browser/installer
 
 package-compare:
 	@$(MAKE) -C browser/installer package-compare