summaryrefslogtreecommitdiff
path: root/remake.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>1999-09-04 22:05:18 +0000
committerPaul Smith <psmith@gnu.org>1999-09-04 22:05:18 +0000
commit860a30ae1eea90f30b0f0f4ee70c90ee059cfbb8 (patch)
treeb2b623d1a54ee3165bc29f0a4e79fd04e59758e4 /remake.c
parente49b2f15c9c875f7db16064834ffac123f48b612 (diff)
downloadgunmake-860a30ae1eea90f30b0f0f4ee70c90ee059cfbb8.tar.gz
* Fix for infinite recursion.
Diffstat (limited to 'remake.c')
-rw-r--r--remake.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/remake.c b/remake.c
index 1e21e61..fe9b7ff 100644
--- a/remake.c
+++ b/remake.c
@@ -154,13 +154,6 @@ update_goal_chain (goals, makefiles)
x = update_file (file, makefiles ? 1 : 0);
check_renamed (file);
- /* If we don't know what the file's last mtime was, find it. */
- if (! file->last_mtime)
- {
- (void) f_mtime (file, 0);
- check_renamed (file);
- }
-
/* Set the goal's `changed' flag if any commands were started
by calling update_file above. We check this flag below to
decide when to give an "up to date" diagnostic. */
@@ -186,22 +179,27 @@ update_goal_chain (goals, makefiles)
stop = (!keep_going_flag && !question_flag
&& !makefiles);
}
- else if (file->updated && g->changed &&
- file->last_mtime != file->mtime_before_update)
- {
- /* Updating was done. If this is a makefile and
- just_print_flag or question_flag is set
- (meaning -n or -q was given and this file was
- specified as a command-line target), don't
- change STATUS. If STATUS is changed, we will
- get re-exec'd, and fall into an infinite loop. */
- if (!makefiles
- || (!just_print_flag && !question_flag))
- status = 0;
- if (makefiles && file->dontcare)
- /* This is a default makefile. Stop remaking. */
- stop = 1;
- }
+ else
+ {
+ FILE_TIMESTAMP mtime = MTIME (file);
+ check_renamed (file);
+ if (file->updated && g->changed &&
+ mtime != file->mtime_before_update)
+ {
+ /* Updating was done. If this is a makefile and
+ just_print_flag or question_flag is set
+ (meaning -n or -q was given and this file was
+ specified as a command-line target), don't
+ change STATUS. If STATUS is changed, we will
+ get re-exec'd, and enter an infinite loop. */
+ if (!makefiles
+ || (!just_print_flag && !question_flag))
+ status = 0;
+ if (makefiles && file->dontcare)
+ /* This is a default makefile; stop remaking. */
+ stop = 1;
+ }
+ }
}
}