summaryrefslogtreecommitdiffstats
path: root/usr.bin/make
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2002-05-23 12:01:54 +0000
committerjmallett <jmallett@FreeBSD.org>2002-05-23 12:01:54 +0000
commit64477eb2ea400392901ee296fe0c4623812197b2 (patch)
tree071600c279603f89466b551874848a0cbfa92551 /usr.bin/make
parent43293f1c75ffcde0b4ef23ecf7101830ecf20e76 (diff)
downloadFreeBSD-src-64477eb2ea400392901ee296fe0c4623812197b2.zip
FreeBSD-src-64477eb2ea400392901ee296fe0c4623812197b2.tar.gz
Set the MAKEFILE variable to the value passed to ReadMakefile(), not the full
path to it. Use the full path only for parsing it.
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/main.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index fca2a6b..e0616ae 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -911,6 +911,7 @@ ReadMakefile(p, q)
extern Lst parseIncPath;
FILE *stream;
char *name, path[MAXPATHLEN];
+ char *MAKEFILE;
int setMAKEFILE;
if (!strcmp(fname, "-")) {
@@ -924,10 +925,12 @@ ReadMakefile(p, q)
(void)snprintf(path, MAXPATHLEN, "%s/%s", curdir, fname);
if (realpath(path, path) != NULL &&
(stream = fopen(path, "r")) != NULL) {
+ MAKEFILE = fname;
fname = path;
goto found;
}
} else if (realpath(fname, path) != NULL) {
+ MAKEFILE = fname;
fname = path;
if ((stream = fopen(fname, "r")) != NULL)
goto found;
@@ -938,7 +941,7 @@ ReadMakefile(p, q)
name = Dir_FindFile(fname, sysIncPath);
if (!name || !(stream = fopen(name, "r")))
return(FALSE);
- fname = name;
+ MAKEFILE = fname = name;
/*
* set the MAKEFILE variable desired by System V fans -- the
* placement of the setting here means it gets set to the last
@@ -946,7 +949,7 @@ ReadMakefile(p, q)
*/
found:
if (setMAKEFILE)
- Var_Set("MAKEFILE", fname, VAR_GLOBAL);
+ Var_Set("MAKEFILE", MAKEFILE, VAR_GLOBAL);
Parse_File(fname, stream);
(void)fclose(stream);
}
OpenPOWER on IntegriCloud