summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1994-02-16 22:55:31 +0000
committerRoland McGrath <roland@redhat.com>1994-02-16 22:55:31 +0000
commit4b7d940657e8104d8962cb0133bf24c3a5edc7e7 (patch)
tree8b6db24ab5bd737c0f8535eb1cae1a9683d42fc1 /read.c
parentd68bb0895be0a78b26de5a9e88e36196e21429fc (diff)
downloadmake-4b7d940657e8104d8962cb0133bf24c3a5edc7e7.tar.gz
make-4b7d940657e8104d8962cb0133bf24c3a5edc7e7.tar.bz2
make-4b7d940657e8104d8962cb0133bf24c3a5edc7e7.zip
Formerly read.c.~74~
Diffstat (limited to 'read.c')
-rw-r--r--read.c36
1 files changed, 29 insertions, 7 deletions
diff --git a/read.c b/read.c
index b2102f8..0bf3a50 100644
--- a/read.c
+++ b/read.c
@@ -267,6 +267,20 @@ read_makefile (filename, flags)
two_colon = 0;
#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. */
/* Expand ~ in FILENAME unless it came from `include',
@@ -360,7 +374,7 @@ read_makefile (filename, flags)
remove_comments (collapsed);
p = collapsed;
- while (*p == ' ')
+ while (isspace (*p) && *p != '\t')
++p;
/* We cannot consider a line containing just a tab to be empty
because it might constitute an empty command for a target. */
@@ -592,12 +606,20 @@ read_makefile (filename, flags)
/* This line has been dealt with. */
;
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
- might have been usable as a variable definition.
- But now it is definitely lossage. */
- makefile_fatal (filename, lineno,
- "commands commence before first target");
+ {
+ p = lb.buffer;
+ while (isblank (*p))
+ ++p;
+ if (*p == '\0')
+ /* 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
{
/* This line describes some target files. */