diff options
-rw-r--r-- | usr.bin/make/main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index b336646..58b4e50 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -908,11 +908,14 @@ ReadMakefile(p, q) extern Lst parseIncPath; FILE *stream; char *name, path[MAXPATHLEN]; + int setMAKEFILE; if (!strcmp(fname, "-")) { Parse_File("(stdin)", stdin); Var_Set("MAKEFILE", "", VAR_GLOBAL); } else { + setMAKEFILE = strcmp(fname, ".depend"); + /* if we've chdir'd, rebuild the path name */ if (curdir != objdir && *fname != '/') { (void)snprintf(path, MAXPATHLEN, "%s/%s", curdir, fname); @@ -934,7 +937,9 @@ ReadMakefile(p, q) * placement of the setting here means it gets set to the last * makefile specified, as it is set by SysV make. */ -found: Var_Set("MAKEFILE", fname, VAR_GLOBAL); +found: + if (setMAKEFILE) + Var_Set("MAKEFILE", fname, VAR_GLOBAL); Parse_File(fname, stream); (void)fclose(stream); } |