summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/main.c b/main.c
index 0be958d..cd58a49 100644
--- a/main.c
+++ b/main.c
@@ -1772,9 +1772,9 @@ main (int argc, char **argv, char **envp)
build_vpath_lists ();
- /* Mark files given with -o flags as very old
- and as having been updated already, and files given with -W flags as
- brand new (time-stamp as far as possible into the future). */
+ /* Mark files given with -o flags as very old and as having been updated
+ already, and files given with -W flags as brand new (time-stamp as far
+ as possible into the future). If restarts is set we'll do -W later. */
if (old_files != 0)
for (p = old_files->list; *p != 0; ++p)
@@ -1786,7 +1786,7 @@ main (int argc, char **argv, char **envp)
f->command_state = cs_finished;
}
- if (new_files != 0)
+ if (!restarts && new_files != 0)
{
for (p = new_files->list; *p != 0; ++p)
{
@@ -2117,6 +2117,16 @@ main (int argc, char **argv, char **envp)
/* Set always_make_flag if -B was given. */
always_make_flag = always_make_set;
+ /* If restarts is set we haven't set up -W files yet, so do that now. */
+ if (restarts && new_files != 0)
+ {
+ for (p = new_files->list; *p != 0; ++p)
+ {
+ f = enter_command_line_file (*p);
+ f->last_mtime = f->mtime_before_update = NEW_MTIME;
+ }
+ }
+
/* If there is a temp file from reading a makefile from stdin, get rid of
it now. */
if (stdin_nm && unlink (stdin_nm) < 0 && errno != ENOENT)