make/common/MakeBase.gmk
changeset 36506 17612cee3530
parent 36169 1613fd93b3f4
child 37402 62b5f067032e
child 37030 e047c2f3f510
--- a/make/common/MakeBase.gmk	Tue Mar 15 13:48:18 2016 -0700
+++ b/make/common/MakeBase.gmk	Thu Mar 17 19:03:53 2016 +0000
@@ -247,7 +247,7 @@
             $(HG_SEARCH:%/REPO=%/$(HGTIP_FILENAME)) \
         2> /dev/null)))))
 
-# Emit the repo:tip pairs to $@
+# Emit the repo:tip pairs to $@, but only if they changed since last time
 define GetSourceTips
 	$(CD) $(SRC_ROOT) ; \
 	for i in $(REPO_LIST) IGNORE ; do \
@@ -260,8 +260,13 @@
 	    $(PRINTF) " %s:%s" \
 	        "$${i}" `$(CAT) $${i}/$(HGTIP_FILENAME)` ; \
 	  fi; \
-	done >> $@
-	$(PRINTF) "\n" >> $@
+	done > $@.tmp
+	$(PRINTF) "\n" >> $@.tmp
+	if [ ! -f $@ ] || [ "`$(CAT) $@`" != "`$(CAT) $@.tmp`" ]; then \
+	  $(MV) $@.tmp $@ ; \
+	else \
+	  $(RM) $@.tmp ; \
+	fi
 endef
 
 # Create the HGTIP_FILENAME file. Called from closed/make/SourceBundles.gmk
@@ -644,10 +649,10 @@
 
 # Defines the sub directory structure to store variable value file in
 DependOnVariableDirName = \
-    $(strip $(subst $(SRC_ROOT)/,,\
-        $(if $(filter /%, $(firstword $(MAKEFILE_LIST))), \
+    $(strip $(addsuffix $(if $(MODULE),/$(MODULE)), \
+        $(subst $(SRC_ROOT)/,, $(if $(filter /%, $(firstword $(MAKEFILE_LIST))), \
           $(firstword $(MAKEFILE_LIST)), \
-          $(CURDIR)/$(firstword $(MAKEFILE_LIST)))))
+          $(CURDIR)/$(firstword $(MAKEFILE_LIST))))))
 
 # Defines the name of the file to store variable value in. Generates a name
 # unless parameter 2 is given.