Formerly read.c.~74~

This commit is contained in:
Roland McGrath 1994-02-16 22:55:31 +00:00
parent d68bb0895b
commit 4b7d940657

36
read.c
View File

@ -267,6 +267,20 @@ read_makefile (filename, flags)
two_colon = 0; two_colon = 0;
#endif #endif
if (debug_flag)
{
printf ("Reading makefile `%s'", filename);
if (flags & RM_NO_DEFAULT_GOAL)
printf (" (no default goal)");
if (flags & RM_INCLUDED)
printf (" (search path)");
if (flags & RM_DONTCARE)
printf (" (don't care)");
if (flags & RM_NO_TILDE)
printf (" (no ~ expansion)");
puts ("...");
}
/* First, get a stream to read. */ /* First, get a stream to read. */
/* Expand ~ in FILENAME unless it came from `include', /* Expand ~ in FILENAME unless it came from `include',
@ -360,7 +374,7 @@ read_makefile (filename, flags)
remove_comments (collapsed); remove_comments (collapsed);
p = collapsed; p = collapsed;
while (*p == ' ') while (isspace (*p) && *p != '\t')
++p; ++p;
/* We cannot consider a line containing just a tab to be empty /* We cannot consider a line containing just a tab to be empty
because it might constitute an empty command for a target. */ because it might constitute an empty command for a target. */
@ -592,12 +606,20 @@ read_makefile (filename, flags)
/* This line has been dealt with. */ /* This line has been dealt with. */
; ;
else if (lb.buffer[0] == '\t') else if (lb.buffer[0] == '\t')
/* This line starts with a tab but was not caught above {
because there was no preceding target, and the line p = lb.buffer;
might have been usable as a variable definition. while (isblank (*p))
But now it is definitely lossage. */ ++p;
makefile_fatal (filename, lineno, if (*p == '\0')
"commands commence before first target"); /* The line is completely blank; that is harmless. */
continue;
/* This line starts with a tab but was not caught above
because there was no preceding target, and the line
might have been usable as a variable definition.
But now it is definitely lossage. */
makefile_fatal (filename, lineno,
"commands commence before first target");
}
else else
{ {
/* This line describes some target files. */ /* This line describes some target files. */