diff options
author | Roland McGrath <roland@redhat.com> | 1993-07-15 02:25:00 +0000 |
---|---|---|
committer | Roland McGrath <roland@redhat.com> | 1993-07-15 02:25:00 +0000 |
commit | f0929a13c3c33238136163ecef54dbca16afea21 (patch) | |
tree | bf6842b04224e8d6170514a1dd8b410d6f4b2e02 | |
parent | 7a031cd4b2e057fc9de5124f32dc586f9c2f0a95 (diff) | |
download | gunmake-f0929a13c3c33238136163ecef54dbca16afea21.tar.gz |
Formerly read.c.~66~
-rw-r--r-- | read.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -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. */ |