unifdef -UWANT_ENV_PWD.
No one ever going to use this bugfeature.
This commit is contained in:
parent
43403d166a
commit
73295d34c7
@ -455,10 +455,6 @@ main(argc, argv)
|
||||
Boolean outOfDate = TRUE; /* FALSE if all targets up to date */
|
||||
struct stat sa;
|
||||
char *p, *p1, *path, *pathp;
|
||||
#ifdef WANT_ENV_PWD
|
||||
struct stat sb;
|
||||
char *pwd;
|
||||
#endif
|
||||
char mdpath[MAXPATHLEN];
|
||||
char obpath[MAXPATHLEN];
|
||||
char cdpath[MAXPATHLEN];
|
||||
@ -491,7 +487,7 @@ main(argc, argv)
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Find where we are and take care of PWD for the automounter...
|
||||
* Find where we are...
|
||||
* All this code is so that we know where we are when we start up
|
||||
* on a different machine with pmake.
|
||||
*/
|
||||
@ -502,14 +498,6 @@ main(argc, argv)
|
||||
if (stat(curdir, &sa) == -1)
|
||||
err(2, "%s", curdir);
|
||||
|
||||
#ifdef WANT_ENV_PWD
|
||||
if ((pwd = getenv("PWD")) != NULL) {
|
||||
if (stat(pwd, &sb) == 0 && sa.st_ino == sb.st_ino &&
|
||||
sa.st_dev == sb.st_dev)
|
||||
(void) strcpy(curdir, pwd);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__i386__) && defined(__FreeBSD_version) && \
|
||||
__FreeBSD_version > 300003
|
||||
/*
|
||||
@ -618,10 +606,6 @@ main(argc, argv)
|
||||
objdir = curdir;
|
||||
}
|
||||
|
||||
#ifdef WANT_ENV_PWD
|
||||
setenv("PWD", objdir, 1);
|
||||
#endif
|
||||
|
||||
create = Lst_Init(FALSE);
|
||||
makefiles = Lst_Init(FALSE);
|
||||
envFirstVars = Lst_Init(FALSE);
|
||||
|
@ -462,6 +462,11 @@ was executed with
|
||||
A path to the directory where
|
||||
.Nm
|
||||
was executed.
|
||||
.Nm
|
||||
sets
|
||||
.Va .CURDIR
|
||||
to the canonical path given by
|
||||
.Xr getcwd 3 .
|
||||
.It Va .OBJDIR
|
||||
A path to the directory where the targets are built.
|
||||
At startup,
|
||||
@ -501,6 +506,12 @@ If they are undefined and
|
||||
.Nm
|
||||
is unable to change into any of the remaining three directories,
|
||||
then the current directory is used.
|
||||
.Pp
|
||||
.Nm
|
||||
sets
|
||||
.Va .OBJDIR
|
||||
to the canonical path given by
|
||||
.Xr getcwd 3 .
|
||||
.It Va .MAKEFLAGS
|
||||
The environment variable
|
||||
.Ev MAKEFLAGS
|
||||
@ -526,29 +537,6 @@ executes.
|
||||
A synonym for
|
||||
.Va .MAKEFLAGS
|
||||
provided for backward compatibility.
|
||||
.It Ev PWD
|
||||
Alternate path to the current directory.
|
||||
Supported if built with WANT_ENV_PWD defined.
|
||||
.Nm
|
||||
normally sets
|
||||
.Ql Va .CURDIR
|
||||
to the canonical path given by
|
||||
.Xr getcwd 3 .
|
||||
However, if the environment variable
|
||||
.Ev PWD
|
||||
is set and gives a path to the current directory, then
|
||||
.Nm
|
||||
sets
|
||||
.Ql Va .CURDIR
|
||||
to the value of
|
||||
.Ev PWD
|
||||
instead.
|
||||
.Ev PWD
|
||||
is always set to the value of
|
||||
.Ql Va .OBJDIR
|
||||
for all programs which
|
||||
.Nm
|
||||
executes.
|
||||
.It Va .TARGETS
|
||||
List of targets
|
||||
.Nm
|
||||
@ -1172,9 +1160,8 @@ uses the following environment variables, if they exist:
|
||||
.Ev MAKE ,
|
||||
.Ev MAKEFLAGS ,
|
||||
.Ev MAKEOBJDIR ,
|
||||
.Ev MAKEOBJDIRPREFIX ,
|
||||
and
|
||||
.Ev PWD .
|
||||
.Ev MAKEOBJDIRPREFIX .
|
||||
.Sh FILES
|
||||
.Bl -tag -width /usr/share/doc/psd/12.make -compact
|
||||
.It Pa .depend
|
||||
|
Loading…
Reference in New Issue
Block a user