diff options
author | ru <ru@FreeBSD.org> | 2005-10-17 15:56:26 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2005-10-17 15:56:26 +0000 |
commit | 45aa064bf8d261aca3d55ab54c4a9adccb08c2cd (patch) | |
tree | 4c69c46ddbaee75befca3d235c118c7269a00d4f /usr.bin | |
parent | d5f4317ec64ec55bfd40290d261405592303b808 (diff) | |
download | FreeBSD-src-45aa064bf8d261aca3d55ab54c4a9adccb08c2cd.zip FreeBSD-src-45aa064bf8d261aca3d55ab54c4a9adccb08c2cd.tar.gz |
Make sure that files included using ".include <foo>" are really
looked for in the system make file directory or in the specified
-m paths instead of always looking in the other -I and .PATH
specified paths. (Commit log shamelessly stolen from NetBSD.)
Reviewed by: yar
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/make/parse.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index dda7afd..ae9db06 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -2130,7 +2130,7 @@ xparse_include(char *file, int sinclude) * Include files contained in double-quotes are first searched * for relative to the including file's location. We don't want * to cd there, of course, so we just tack on the old file's - * leading path components and call Dir_FindFile to see if + * leading path components and call Path_FindFile to see if * we can locate the beast. */ @@ -2155,28 +2155,27 @@ xparse_include(char *file, int sinclude) fullname = NULL; } free(Fname); - } else { - fullname = NULL; - } - - if (fullname == NULL) { - /* - * System makefile or makefile wasn't found in same directory as - * included makefile. Search for it first on the -I search path, - * then on the .PATH search path, if not found in a -I - * directory. - * XXX: Suffix specific? - */ - fullname = Path_FindFile(file, &parseIncPath); if (fullname == NULL) { - fullname = Path_FindFile(file, &dirSearchPath); + /* + * Makefile wasn't found in same directory as included + * makefile. Search for it first on the -I search path, + * then on the .PATH search path, if not found in a -I + * directory. + * XXX: Suffix specific? + */ + fullname = Path_FindFile(file, &parseIncPath); + if (fullname == NULL) { + fullname = Path_FindFile(file, &dirSearchPath); + } } + } else { + fullname = NULL; } if (fullname == NULL) { /* - * Still haven't found the makefile. Look for it on the system - * path as a last resort. + * System makefile or still haven't found the makefile. + * Look for it on the system path. */ fullname = Path_FindFile(file, &sysIncPath); } |