Index: ChangeLog
===================================================================
RCS file: /cvsroot/make/make/ChangeLog,v
retrieving revision 2.276
diff -u -r2.276 ChangeLog
--- ChangeLog	12 Jun 2005 22:22:07 -0000	2.276
+++ ChangeLog	17 Jun 2005 23:53:29 -0000
@@ -1,3 +1,14 @@
+2005-06-17  Jason Wessel <jason.wessel@windriver.com>
+
+	Add updatecache function to reset modification time cache
+
+	* function.c (func_updatecache): Added the new function
+	func_updatecache for the explicit purpose to reset the
+	modification timestamps of the listed targets.  This allows a
+	target rule to modify a series of targets that it doesn't directly
+	depend on or that may have been passed into the rule by a
+	variable.
+	
 2005-06-12  Paul D. Smith  <psmith@gnu.org>
 
 	Fix Savannah bug # 1328.
Index: function.c
===================================================================
RCS file: /cvsroot/make/make/function.c,v
retrieving revision 1.87
diff -u -r1.87 function.c
--- function.c	4 Mar 2005 12:52:32 -0000	1.87
+++ function.c	17 Jun 2005 23:53:30 -0000
@@ -68,6 +68,57 @@
 static struct hash_table function_table;
 
 
+/*
+  $(updatecache <targets to flush time stamp cache on>)
+
+  Always resolves to the empty string.
+
+  This will update reset the time stamps on any specified objects,
+  allowing dependancies to be recomputed correctly incases where a
+  manual update is needed.
+*/
+
+char *
+func_updatecache (char *o, char **argv, const char *funcname UNUSED)
+{
+        char * s1 = argv[0];
+        char * t;
+        struct file *f;
+        struct file *file;
+        char tmp;
+        int len;
+        while ((t = find_next_token (&s1, &len)) != 0)
+          {
+            if (t[len] == '\0')
+              {
+                file = lookup_file(t);
+                if (file && file->is_target)
+                  {
+                    file->updated = 1;
+                    file->last_mtime = UNKNOWN_MTIME;
+                    for (f = file->double_colon; f != 0; f = f->prev)
+                      f->last_mtime = UNKNOWN_MTIME;
+                  }
+              }
+            else
+              {
+                tmp = t[len];
+                t[len] = '\0';
+                file = lookup_file(t);
+                if (file && file->is_target)
+                  {
+                    file->updated = 1;
+                    file->last_mtime = UNKNOWN_MTIME;
+                    for (f = file->double_colon; f != 0; f = f->prev)
+                      f->last_mtime = UNKNOWN_MTIME;
+                  }
+                t[len] = tmp;
+              }
+          }
+        o = variable_buffer_output (o, "", 0);
+        return o;
+}
+
 /* Store into VARIABLE_BUFFER at O the result of scanning TEXT and replacing
    each occurrence of SUBST with REPLACE. TEXT is null-terminated.  SLEN is
    the length of SUBST and RLEN is the length of REPLACE.  If BY_WORD is
@@ -1958,6 +2009,7 @@
   { STRING_SIZE_TUPLE("if"),            2,  3,  0,  func_if},
   { STRING_SIZE_TUPLE("value"),         0,  1,  1,  func_value},
   { STRING_SIZE_TUPLE("eval"),          0,  1,  1,  func_eval},
+  { STRING_SIZE_TUPLE("updatecache"),   0,  1,  1,  func_updatecache},
 #ifdef EXPERIMENTAL
   { STRING_SIZE_TUPLE("eq"),            2,  2,  1,  func_eq},
   { STRING_SIZE_TUPLE("not"),           0,  1,  1,  func_not},
