summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1993-07-15 02:25:00 +0000
committerRoland McGrath <roland@redhat.com>1993-07-15 02:25:00 +0000
commitf0929a13c3c33238136163ecef54dbca16afea21 (patch)
treebf6842b04224e8d6170514a1dd8b410d6f4b2e02
parent7a031cd4b2e057fc9de5124f32dc586f9c2f0a95 (diff)
downloadgunmake-f0929a13c3c33238136163ecef54dbca16afea21.tar.gz
Formerly read.c.~66~
-rw-r--r--read.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/read.c b/read.c
index 76335fa..2d26f24 100644
--- a/read.c
+++ b/read.c
@@ -143,7 +143,7 @@ read_all_makefiles (makefiles)
{
if (*p != '\0')
*p++ = '\0';
- read_makefile (name, 1);
+ read_makefile (name, RM_NO_DEFAULT_GOAL | RM_INCLUDED | RM_DONTCARE);
}
free (value);
@@ -503,17 +503,22 @@ read_makefile (filename, flags)
v->export = v_noexport;
}
}
- else if (word1eq ("include", 7))
+ else if (word1eq ("include", 7) || word1eq ("-include", 8))
{
/* We have found an `include' line specifying a nested
makefile to be read at this point. */
struct conditionals *save, new_conditionals;
struct nameseq *files;
+ /* "-include" (vs "include") says no
+ error if the file does not exist. */
+ int noerror = p[0] == '-';
- p = allocated_variable_expand (next_token (p + 8));
+ p = allocated_variable_expand (next_token (p + (noerror ? 9 : 8)));
if (*p == '\0')
{
- makefile_error (filename, lineno, "no file name for `include'");
+ makefile_error (filename, lineno,
+ "no file name for `%sinclude'",
+ noerror ? "-" : "");
continue;
}
@@ -543,7 +548,8 @@ read_makefile (filename, flags)
free (files);
files = next;
- read_makefile (name, 2);
+ read_makefile (name, (RM_INCLUDED | RM_NO_TILDE
+ | (noerror ? RM_DONTCARE : 0)));
}
/* Restore state. */