make-rules/shared-macros.mk
changeset 4359 93edfb908c2a
parent 4339 6501cf9c29f9
child 4439 94148b6e4407
--- a/make-rules/shared-macros.mk	Tue May 26 22:07:16 2015 -0500
+++ b/make-rules/shared-macros.mk	Fri May 22 15:32:02 2015 -0500
@@ -42,9 +42,11 @@
 export DOWNLOAD_SEARCH_PATH +=	$(EXTERNAL_ARCHIVE_MIRROR)
 endif
 
-# The workspace starts at the mercurial root
+# The workspace starts at the parent of the make-rules directory,
+# unless someone already supplied the top.
 ifeq ($(origin WS_TOP), undefined)
-export WS_TOP :=		$(shell hg root)
+export WS_TOP := $(realpath $(dir $(realpath $(dir $(filter \
+			%/make-rules/shared-macros.mk,$(MAKEFILE_LIST))))))
 endif
 
 WS_MACH =	$(WS_TOP)/$(MACH)