summaryrefslogtreecommitdiffstats
path: root/usr.bin/make
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2002-04-18 12:04:34 +0000
committerru <ru@FreeBSD.org>2002-04-18 12:04:34 +0000
commitea1a822782225ef9ed41d50bca1727b8afc1d156 (patch)
treeb8b19358a42d42685811a3f2e92ec154d7431c2e /usr.bin/make
parentd28f5d490f4eb5dc4a05eeb42304317e79a585a8 (diff)
downloadFreeBSD-src-ea1a822782225ef9ed41d50bca1727b8afc1d156.zip
FreeBSD-src-ea1a822782225ef9ed41d50bca1727b8afc1d156.tar.gz
Do not reset MAKEFILE when reading ".depend" as this rather
eliminates the usefulness of ${MAKEFILE}. Obtained from: NetBSD MFC after: 1 week
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/main.c7
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);
}
OpenPOWER on IntegriCloud