summaryrefslogtreecommitdiff
path: root/remake.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>1999-07-06 21:09:32 +0000
committerPaul Smith <psmith@gnu.org>1999-07-06 21:09:32 +0000
commit012254e81e045cc7af01f3ef0d7b63d9d9b9a0d5 (patch)
tree5d6be3ede34c4a1b49eb042fc1c822eead695566 /remake.c
parent2858f7a8f11990a8b9391e70ab4cdaa271522ece (diff)
downloadgunmake-012254e81e045cc7af01f3ef0d7b63d9d9b9a0d5.tar.gz
* Various bugfixes/updates. See ChangeLog.
Diffstat (limited to 'remake.c')
-rw-r--r--remake.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/remake.c b/remake.c
index 973c447..d94094a 100644
--- a/remake.c
+++ b/remake.c
@@ -65,6 +65,9 @@ static int library_search PARAMS ((char **lib, FILE_TIMESTAMP *mtime_ptr));
should only make one goal at a time and return as soon as one goal whose
`changed' member is nonzero is successfully made. */
+/* We need to know this "lower down" for correct error handling. */
+static int updating_makefiles = 0;
+
int
update_goal_chain (goals, makefiles)
register struct dep *goals;
@@ -74,6 +77,8 @@ update_goal_chain (goals, makefiles)
unsigned int j = job_slots;
int status = -1;
+ updating_makefiles = makefiles;
+
#define MTIME(file) (makefiles ? file_mtime_no_search (file) \
: file_mtime (file))
@@ -264,26 +269,27 @@ no_rule_error(file)
= "%sNo rule to make target `%s'%s";
static const char msg_parent[]
= "%sNo rule to make target `%s', needed by `%s'%s";
+
if (keep_going_flag || file->dontcare)
{
- if (!file->dontcare && !file->shownerror)
+ /* If the previous attempt was made while we were creating
+ makefiles, but we aren't anymore, print an error now. */
+ if (!file->dontcare
+ || (file->mfile_status && !updating_makefiles))
{
if (file->parent == 0)
error (NILF, msg_noparent, "*** ", file->name, ".");
else
error (NILF, msg_parent, "*** ",
file->name, file->parent->name, ".");
- file->shownerror = 1;
}
file->update_status = 2;
+ file->mfile_status = updating_makefiles;
}
+ else if (file->parent == 0)
+ fatal (NILF, msg_noparent, "", file->name, "");
else
- {
- if (file->parent == 0)
- fatal (NILF, msg_noparent, "", file->name, "");
- else
- fatal (NILF, msg_parent, "", file->name, file->parent->name, "");
- }
+ fatal (NILF, msg_parent, "", file->name, file->parent->name, "");
}
/* If FILE is not up to date, execute the commands for it.
@@ -355,8 +361,7 @@ update_file_1 (file, depth)
if (file->update_status > 0)
{
DEBUGPR ("Recently tried and failed to update file `%s'.\n");
- if (!file->shownerror && file->parent)
- no_rule_error(file);
+ no_rule_error(file);
return file->update_status;
}