From f0929a13c3c33238136163ecef54dbca16afea21 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 15 Jul 1993 02:25:00 +0000 Subject: Formerly read.c.~66~ --- read.c | 16 +++++++++++----- 1 file 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. */ -- cgit v1.2.3