/[make]/make/remake.c
ViewVC logotype

Diff of /make/remake.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.118 by psmith, Sat Jun 25 23:00:17 2005 UTC revision 1.119 by bosk, Wed Dec 7 11:33:38 2005 UTC
# Line 841  notice_finished_file (struct file *file) Line 841  notice_finished_file (struct file *file)
841    
842    if ((ran && !file->phony) || touched)    if ((ran && !file->phony) || touched)
843      {      {
       struct file *f;  
844        int i = 0;        int i = 0;
845    
846        /* If -n, -t, or -q and all the commands are recursive, we ran them so        /* If -n, -t, or -q and all the commands are recursive, we ran them so
# Line 861  notice_finished_file (struct file *file) Line 860  notice_finished_file (struct file *file)
860          i = 1;          i = 1;
861    
862        file->last_mtime = i == 0 ? UNKNOWN_MTIME : NEW_MTIME;        file->last_mtime = i == 0 ? UNKNOWN_MTIME : NEW_MTIME;
863        }
864    
865      if (file->double_colon)
866        {
867          /* If this is a double colon rule and it is the last one to be
868             updated, propagate the change of modification time to all the
869             double-colon entries for this file.
870    
871             We do it on the last update because it is important to handle
872             individual entries as separate rules with separate timestamps
873             while they are treated as targets and then as one rule with the
874             unified timestamp when they are considered as a prerequisite
875             of some target.  */
876    
877          struct file *f;
878          FILE_TIMESTAMP max_mtime = file->last_mtime;
879    
880        /* Propagate the change of modification time to all the double-colon        /* Check that all rules were updated and at the same time find
881           entries for this file.  */           the max timestamp.  We assume UNKNOWN_MTIME is newer then
882        for (f = file->double_colon; f != 0; f = f->prev)           any other value.  */
883          f->last_mtime = file->last_mtime;        for (f = file->double_colon; f != 0 && f->updated; f = f->prev)
884            if (max_mtime != UNKNOWN_MTIME
885                && (f->last_mtime == UNKNOWN_MTIME || f->last_mtime > max_mtime))
886              max_mtime = f->last_mtime;
887    
888          if (f == 0)
889            for (f = file->double_colon; f != 0; f = f->prev)
890              f->last_mtime = max_mtime;
891      }      }
892    
893    if (ran && file->update_status != -1)    if (ran && file->update_status != -1)

Legend:
Removed from v.1.118  
changed lines
  Added in v.1.119

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26