Bug 1416034 - Refuse to run client.mk unless using mach; r?ted draft
authorGregory Szorc <gps@mozilla.com>
Thu, 09 Nov 2017 15:03:57 -0800
changeset 695858 6dafd7a79e36882afb3bb6b9e1a44159b3f6b1d4
parent 695857 341a29e79d2e43967d70b25f3164248668532cde
child 739727 538daf20ea98a52701621e61beb9cad68a77bc0a
push id88568
push userbmo:gps@mozilla.com
push dateThu, 09 Nov 2017 23:05:47 +0000
reviewersted
bugs1416034
milestone58.0a1
Bug 1416034 - Refuse to run client.mk unless using mach; r?ted We will soon begin the process of moving logic from client.mk into mach. Once we start this process, it won't be possible to invoke client.mk in isolation. This commit introduces a check in client.mk that will error unless client.mk is executed from mach. This should help more easily identify users of client.mk during the transition period - before client.mk is removed and callers start getting missing file errors. Obviously the check can be bypassed easily. If someone does this, upcoming changes will quickly break that workflow. So this isn't a big deal. MozReview-Commit-ID: JB7hXlvTKWe
client.mk
--- a/client.mk
+++ b/client.mk
@@ -114,16 +114,21 @@ CONFIGURES += $(TOPSRCDIR)/js/src/config
 OBJDIR_TARGETS = install export libs clean realclean distclean upload sdk installer package package-compare stage-package source-package l10n-check automation/build
 
 #######################################################################
 # Rules
 
 # The default rule is build
 build::
 
+ifndef MACH
+$(error client.mk must be used via `mach`. Try running \
+`./mach $(firstword $(MAKECMDGOALS) $(.DEFAULT_GOAL))`)
+endif
+
 # Include baseconfig.mk for its $(MAKE) validation.
 include $(TOPSRCDIR)/config/baseconfig.mk
 
 # Define mkdir
 include $(TOPSRCDIR)/config/makefiles/makeutils.mk
 include $(TOPSRCDIR)/config/makefiles/autotargets.mk
 
 # For now, only output "export" lines and lines containing UPLOAD_EXTRA_FILES