summaryrefslogtreecommitdiff
path: root/remake.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2002-07-08 02:26:47 +0000
committerPaul Smith <psmith@gnu.org>2002-07-08 02:26:47 +0000
commit8572d6adf04d397505770b0b0d5cfd91cf6a92a8 (patch)
tree8e590714da1d480bef4ca2afbe81fa95c2624de6 /remake.c
parent4a073980236d80b47a24c5caea3ece4e9bb7e044 (diff)
downloadgunmake-8572d6adf04d397505770b0b0d5cfd91cf6a92a8.tar.gz
Major updates in preparation for 3.80.
New version of the manual, put into the doc subdir. Enhancements: $(eval ...) and $(value ...) functions, various bug fixes, etc. See the ChangeLog. More to come.
Diffstat (limited to 'remake.c')
-rw-r--r--remake.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/remake.c b/remake.c
index ae5f37c..084816b 100644
--- a/remake.c
+++ b/remake.c
@@ -706,6 +706,7 @@ notice_finished_file (file)
{
struct dep *d;
int ran = file->command_state == cs_running;
+ int touched = 0;
file->command_state = cs_finished;
file->updated = 1;
@@ -734,24 +735,36 @@ notice_finished_file (file)
if (file->phony)
file->update_status = 0;
else
- /* Should set file's modification date and do nothing else. */
- file->update_status = touch_file (file);
+ {
+ /* Should set file's modification date and do nothing else. */
+ file->update_status = touch_file (file);
+
+ /* Pretend we ran a real touch command, to suppress the
+ "`foo' is up to date" message. */
+ commands_started++;
+
+ /* Request for the timestamp to be updated (and distributed
+ to the double-colon entries). Simply setting ran=1 would
+ almost have done the trick, but messes up with the also_make
+ updating logic below. */
+ touched = 1;
+ }
}
}
if (file->mtime_before_update == UNKNOWN_MTIME)
file->mtime_before_update = file->last_mtime;
- if (ran && !file->phony)
+ if ((ran && !file->phony) || touched)
{
struct file *f;
int i = 0;
- /* If -n 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
really check the target's mtime again. Otherwise, assume the target
would have been updated. */
- if (question_flag || just_print_flag)
+ if (question_flag || just_print_flag || touch_flag)
{
for (i = file->cmds->ncommand_lines; i > 0; --i)
if (! (file->cmds->lines_flags[i-1] & COMMANDS_RECURSE))