Do not reset MAKEFILE when reading ".depend" as this rather

eliminates the usefulness of ${MAKEFILE}.

Obtained from:	NetBSD
MFC after:	1 week
This commit is contained in:
Ruslan Ermilov 2002-04-18 12:04:34 +00:00
parent 5b3e868df5
commit 78257b6288

View File

@ -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);
}