+2000-02-12 Tim Magill <magill@gate.net>
+
+ * implicit.c (try_implicit_rule):
+ * remake.c (check_dep):
+ * remake.c (update_file_1):
+ move setting of tried_implicit into try_implicit_rule(). It is
+ only called in two places and the flag is set immediately after.
+
+
+ * remake.c (update_file_1): collapsed if statement based on
+ file->command_state into switch statment which immediately
+ follows. Removed code that could not be reached.
+
+ * remake.c (update_file): advance f pointer so as not to consider
+ same file twice after breaking loop.
+
+ * file.c (rehash_file): replaced hard coded check_renamed loop
+ with standard macro. seemed like the right thing to do.
+
+
2000-02-09 Tim Magill <magill@gate.net>
Started branch for cleaning up internal make structure regarding
recursion paths. Branch name is filedef-cleanup and was started
register unsigned int oldhash;
register char *n;
- while (file->renamed != 0)
- file = file->renamed;
+ check_renamed(file);
/* Find the hash values of the old and new names. */
struct file *double_colon;
short int update_status; /* Status of the last attempt to update,
- or -1 if none has been made. */
+ or -1 if none has been made.
+ 0 = commands ran and won
+ 1 = files need to be updated (-q)
+ 2 = commands ran and lost */
enum /* State of the commands. */
{ /* Note: It is important that cs_not_started be zero. */
struct file *file;
unsigned int depth;
{
+ int ret = 0;
DBF (DB_IMPLICIT, _("Looking for an implicit rule for `%s'.\n"));
/* The order of these searches was previously reversed. My logic now is
should come first. */
if (pattern_search (file, 0, depth, 0))
- return 1;
+ ret = 1;
#ifndef NO_ARCHIVES
/* If this is an archive member reference, use just the
archive member name to search for implicit rules. */
- if (ar_name (file->name))
+ else if (ar_name (file->name))
{
DBF (DB_IMPLICIT,
_("Looking for archive-member implicit rule for `%s'.\n"));
if (pattern_search (file, 1, depth, 0))
- return 1;
+ {
+ ret = 1;
+ }
}
#endif
- return 0;
+ file->tried_implicit = 1;
+ return ret;
}
\f
/* Process the remaining rules in the double colon chain so they're marked
considered. Start their prerequisites, too. */
- for (; f != 0 ; f = f->prev)
+ for (f = (f ? f->prev : 0); f != 0 ; f = f->prev)
{
struct dep *d;
DBF (DB_VERBOSE, _("Considering target file `%s'.\n"));
- if (file->command_state == cs_finished)
- {
- if (file->update_status > 0)
- {
- DBF (DB_VERBOSE,
- _("Recently tried and failed to update file `%s'.\n"));
- return file->update_status;
- }
-
- DBF (DB_VERBOSE, _("File `%s' was considered already.\n"));
- return 0;
- }
switch (file->command_state)
{
case cs_not_started:
case cs_deps_running:
break;
+
case cs_running:
DBF (DB_VERBOSE, _("Still updating file `%s'.\n"));
return 0;
+
case cs_finished:
- DBF (DB_VERBOSE, _("Finished updating file `%s'.\n"));
- return file->update_status;
+ if (file->update_status > 0)
+ {
+ DBF (DB_VERBOSE,
+ _("Recently tried and failed to update file `%s'.\n"));
+ return file->update_status;
+ }
+
+ DBF (DB_VERBOSE, _("File `%s' was considered already.\n"));
+ return 0;
+
default:
abort ();
}
DBF (DB_IMPLICIT, _("Found an implicit rule for `%s'.\n"));
else
DBF (DB_IMPLICIT, _("No implicit rule found for `%s'.\n"));
- file->tried_implicit = 1;
}
if (file->cmds == 0 && !file->is_target
&& default_file != 0 && default_file->cmds != 0)
DBF (DB_IMPLICIT, _("Found an implicit rule for `%s'.\n"));
else
DBF (DB_IMPLICIT, _("No implicit rule found for `%s'.\n"));
- file->tried_implicit = 1;
}
if (file->cmds == 0 && !file->is_target
&& default_file != 0 && default_file->cmds != 0)