diff options
author | Roland McGrath <roland@redhat.com> | 1996-03-20 00:56:45 +0000 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 1996-03-20 00:56:45 +0000 |
commit | b8ea37e31cc6b81a77743383641b48c1158cc94a (patch) | |
tree | 3968d63c58b1aabe22f38cf07e99a2b7957d5bf7 | |
parent | e044fe76f6fad68d9a5eab61340e8ef633636d6a (diff) | |
download | gunmake-b8ea37e31cc6b81a77743383641b48c1158cc94a.tar.gz |
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.
-rw-r--r-- | remake.c | 105 |
1 files changed, 67 insertions, 38 deletions
@@ -706,49 +706,78 @@ check_dep (file, depth, this_mtime, must_make_ptr) } else { - /* FILE is an intermediate file. - 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. */ - register struct dep *lastd; - lastd = 0; - d = file->deps; - while (d != 0) + /* FILE is an intermediate file. */ + time_t mtime; + + if (!file->phony && file->cmds == 0 && !file->tried_implicit + && file->secondary) + { + 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 { - if (d->file->updating) + register struct dep *lastd; + + lastd = 0; + d = file->deps; + while (d != 0) { - error ("Circular %s <- %s dependency dropped.", - file->name, d->file->name); - if (lastd == 0) + if (d->file->updating) { - file->deps = d->next; - free ((char *) d); - d = file->deps; - } - else - { - lastd->next = d->next; - free ((char *) d); - d = lastd->next; + error ("Circular %s <- %s dependency dropped.", + file->name, d->file->name); + 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; } - continue; - } - 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; + 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; + } } } |