diff options
| author | Poul-Henning Kamp <phk@FreeBSD.org> | 2005-09-26 20:31:00 +0000 |
|---|---|---|
| committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2005-09-26 20:31:00 +0000 |
| commit | 2e5ee2bfacc0e6f26fbb8ab6ee08621482ed5348 (patch) | |
| tree | 4f55db457e21d4349b7ca39ce5dce6880c4d7400 /usr.bin/make/parse.c | |
| parent | b2828ad291931415982d7b6e07e0233f26695d4a (diff) | |
Notes
Diffstat (limited to 'usr.bin/make/parse.c')
| -rw-r--r-- | usr.bin/make/parse.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index 4d6610313d07..dda7afd78156 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -239,6 +239,7 @@ static const struct keyword { #define NKEYWORDS (sizeof(parseKeywords) / sizeof(parseKeywords[0])) static void parse_include(char *, int, int); +static void parse_sinclude(char *, int, int); static void parse_message(char *, int, int); static void parse_undef(char *, int, int); static void parse_for(char *, int, int); @@ -267,6 +268,7 @@ static const struct directive { { "ifndef", COND_IFNDEF, TRUE, Cond_If }, { "ifnmake", COND_IFNMAKE, TRUE, Cond_If }, { "include", 0, FALSE, parse_include }, + { "sinclude", 0, FALSE, parse_sinclude }, { "undef", 0, FALSE, parse_undef }, { "warning", 0, FALSE, parse_message }, /* DIRECTIVES-END-TAG */ @@ -2065,7 +2067,7 @@ ParseFinishLine(void) * options */ static void -parse_include(char *file, int code __unused, int lineno __unused) +xparse_include(char *file, int sinclude) { char *fullname; /* full pathname of file */ char endc; /* the character which ends the file spec */ @@ -2181,7 +2183,8 @@ parse_include(char *file, int code __unused, int lineno __unused) if (fullname == NULL) { *cp = endc; - Parse_Error(PARSE_FATAL, "Could not find %s", file); + if (!sinclude) + Parse_Error(PARSE_FATAL, "Could not find %s", file); free(file); return; } @@ -2195,6 +2198,18 @@ parse_include(char *file, int code __unused, int lineno __unused) ParsePushInput(fullname, NULL, NULL, 0); } +static void +parse_include(char *file, int code __unused, int lineno __unused) +{ + xparse_include(file, 0); +} + +static void +parse_sinclude(char *file, int code __unused, int lineno __unused) +{ + xparse_include(file, 1); +} + /** * parse_message * Parse a .warning or .error directive |
