summaryrefslogtreecommitdiff
path: root/remake.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>1999-04-09 05:57:35 +0000
committerPaul Smith <psmith@gnu.org>1999-04-09 05:57:35 +0000
commita2ea1bd27fcf4b78f5464af76b505e0211f3341e (patch)
treee71ebfd38da2d10a16389da692ea678aa52177ce /remake.c
parent3d1cdf4106fb107757898c92e55e928d35c02af9 (diff)
downloadgunmake-a2ea1bd27fcf4b78f5464af76b505e0211f3341e.tar.gz
If a file declared .INTERMEDIATE already exists before make starts, we
won't delete it--this is how normal intermediate files behave, too.
Diffstat (limited to 'remake.c')
-rw-r--r--remake.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/remake.c b/remake.c
index b8b5c7f..674f7ef 100644
--- a/remake.c
+++ b/remake.c
@@ -1140,11 +1140,22 @@ f_mtime (file, search)
/* Store the mtime into all the entries for this file. */
if (file->double_colon)
file = file->double_colon;
+
do
{
+ /* If this file is not implicit but it is intermediate then it was
+ made so by the .INTERMEDIATE target. If this file has never
+ been built by us but was found now, it existed before make
+ started. So, turn off the intermediate bit so make doesn't
+ delete it, since it didn't create it. */
+ if (mtime != (FILE_TIMESTAMP)-1 && file->command_state == cs_not_started
+ && !file->tried_implicit && file->intermediate)
+ file->intermediate = 0;
+
file->last_mtime = mtime;
file = file->prev;
- } while (file != 0);
+ }
+ while (file != 0);
return mtime;
}