(notice_finished_file): Only recheck modtimes if FILE->command_state was
authorRoland McGrath <roland@redhat.com>
Wed, 7 Sep 1994 07:06:46 +0000 (07:06 +0000)
committerRoland McGrath <roland@redhat.com>
Wed, 7 Sep 1994 07:06:46 +0000 (07:06 +0000)
cs_running on entry (meaning the commands actually just ran).
(update_file_1): Whenever we set FILE->update_status, call
notice_finished_file instead of just set_command_state.

remake.c

index 7ed67944c76602418f5f4c24f58050eaeed3851e..b9fe4559f79f590daccbb51c2532b40104e40062 100644 (file)
--- a/remake.c
+++ b/remake.c
@@ -478,9 +478,8 @@ update_file_1 (file, depth)
 
   if (dep_status != 0)
     {
-      set_command_state (file, cs_finished);
       file->update_status = dep_status;
-      file->updated = 1;
+      notice_finished_file (file);
 
       depth--;
 
@@ -549,9 +548,8 @@ update_file_1 (file, depth)
   if (!must_make)
     {
       DEBUGPR ("No need to remake target `%s'.\n");
-      set_command_state (file, cs_finished);
       file->update_status = 0;
-      file->updated = 1;
+      notice_finished_file (file);
       return 0;
     }
 
@@ -596,6 +594,7 @@ notice_finished_file (file)
      register struct file *file;
 {
   struct dep *d;
+  int ran = file->command_state == cs_running;
 
   file->command_state = cs_finished;
   file->updated = 1;
@@ -629,7 +628,7 @@ notice_finished_file (file)
        }
     }
 
-  if (!file->phony)
+  if (ran && !file->phony)
     {
       struct file *f;
 
@@ -656,7 +655,7 @@ notice_finished_file (file)
        d->file->updated = 1;
        d->file->update_status = file->update_status;
 
-       if (!d->file->phony)
+       if (ran && !d->file->phony)
          /* Fetch the new modification time.
             We do this instead of just invalidating the cached time
             so that a vpath_search can happen.  Otherwise, it would