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 |
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) |