mirror of
https://salsa.debian.org/srivasta/make-dfsg.git
synced 2025-02-06 03:33:03 +00:00
Sat Aug 19 23:11:00 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu>
* remake.c (check_dep): For a secondary file, try implicit and default rules if appropriate. Wed Aug 2 04:29:42 1995 Richard Stallman <rms@mole.gnu.ai.mit.edu> * remake.c (check_dep): If an intermediate file exists, do consider its actual date.
This commit is contained in:
parent
e044fe76f6
commit
b8ea37e31c
1 changed files with 67 additions and 38 deletions
105
remake.c
105
remake.c
|
@ -706,49 +706,78 @@ check_dep (file, depth, this_mtime, must_make_ptr)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* FILE is an intermediate file.
|
/* FILE is an intermediate file. */
|
||||||
Update all non-intermediate files we depend on, if necessary,
|
time_t mtime;
|
||||||
and see whether any of them is more recent than the file
|
|
||||||
on whose behalf we are checking. */
|
if (!file->phony && file->cmds == 0 && !file->tried_implicit
|
||||||
register struct dep *lastd;
|
&& file->secondary)
|
||||||
lastd = 0;
|
|
||||||
d = file->deps;
|
|
||||||
while (d != 0)
|
|
||||||
{
|
{
|
||||||
if (d->file->updating)
|
if (try_implicit_rule (file, depth))
|
||||||
|
DEBUGPR ("Found an implicit rule for `%s'.\n");
|
||||||
|
else
|
||||||
|
DEBUGPR ("No implicit rule found for `%s'.\n");
|
||||||
|
file->tried_implicit = 1;
|
||||||
|
}
|
||||||
|
if (file->cmds == 0 && !file->is_target && file->secondary
|
||||||
|
&& default_file != 0 && default_file->cmds != 0)
|
||||||
|
{
|
||||||
|
DEBUGPR ("Using default commands for `%s'.\n");
|
||||||
|
file->cmds = default_file->cmds;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If the intermediate file actually exists
|
||||||
|
and is newer, then we should remake from it. */
|
||||||
|
check_renamed (file);
|
||||||
|
mtime = file_mtime (file);
|
||||||
|
check_renamed (file);
|
||||||
|
if (mtime > this_mtime)
|
||||||
|
*must_make_ptr = 1;
|
||||||
|
/* Otherwise, update all non-intermediate files we depend on,
|
||||||
|
if necessary, and see whether any of them is more
|
||||||
|
recent than the file on whose behalf we are checking. */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
register struct dep *lastd;
|
||||||
|
|
||||||
|
lastd = 0;
|
||||||
|
d = file->deps;
|
||||||
|
while (d != 0)
|
||||||
{
|
{
|
||||||
error ("Circular %s <- %s dependency dropped.",
|
if (d->file->updating)
|
||||||
file->name, d->file->name);
|
|
||||||
if (lastd == 0)
|
|
||||||
{
|
{
|
||||||
file->deps = d->next;
|
error ("Circular %s <- %s dependency dropped.",
|
||||||
free ((char *) d);
|
file->name, d->file->name);
|
||||||
d = file->deps;
|
if (lastd == 0)
|
||||||
|
{
|
||||||
|
file->deps = d->next;
|
||||||
|
free ((char *) d);
|
||||||
|
d = file->deps;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lastd->next = d->next;
|
||||||
|
free ((char *) d);
|
||||||
|
d = lastd->next;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
d->file->parent = file;
|
||||||
lastd->next = d->next;
|
dep_status |= check_dep (d->file, depth, this_mtime, must_make_ptr);
|
||||||
free ((char *) d);
|
check_renamed (d->file);
|
||||||
d = lastd->next;
|
if (dep_status != 0 && !keep_going_flag)
|
||||||
}
|
break;
|
||||||
continue;
|
|
||||||
|
if (d->file->command_state == cs_running
|
||||||
|
|| d->file->command_state == cs_deps_running)
|
||||||
|
/* Record that some of FILE's dependencies are still being made.
|
||||||
|
This tells the upper levels to wait on processing it until
|
||||||
|
the commands are finished. */
|
||||||
|
set_command_state (file, cs_deps_running);
|
||||||
|
|
||||||
|
lastd = d;
|
||||||
|
d = d->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
d->file->parent = file;
|
|
||||||
dep_status |= check_dep (d->file, depth, this_mtime, must_make_ptr);
|
|
||||||
check_renamed (d->file);
|
|
||||||
if (dep_status != 0 && !keep_going_flag)
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (d->file->command_state == cs_running
|
|
||||||
|| d->file->command_state == cs_deps_running)
|
|
||||||
/* Record that some of FILE's dependencies are still being made.
|
|
||||||
This tells the upper levels to wait on processing it until
|
|
||||||
the commands are finished. */
|
|
||||||
set_command_state (file, cs_deps_running);
|
|
||||||
|
|
||||||
lastd = d;
|
|
||||||
d = d->next;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue