From nnd@nnd.itfs.nsk.su  Sun Aug 24 05:39:41 1997
Received: from nnd.itfs.nsk.su (nnd.itfs.nsk.su [193.124.36.42])
          by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id FAA00584
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 24 Aug 1997 05:39:38 -0700 (PDT)
Received: (from root@localhost)
	by nnd.itfs.nsk.su (8.8.7/8.8.5) id TAA07347;
	Sun, 24 Aug 1997 19:45:08 +0700 (NSS)
Message-Id: <199708241245.TAA07347@nnd.itfs.nsk.su>
Date: Sun, 24 Aug 1997 19:45:08 +0700 (NSS)
From: "Nickolay N. Dudorov" <nnd@nnd.itfs.nsk.su>
Reply-To: nnd@nnd.itfs.nsk.su
To: FreeBSD-gnats-submit@freebsd.org
Subject: ${MAKE} ${.MAKEFLAGS} is superfluous
X-Send-Pr-Version: 3.2

>Number:         4368
>Category:       bin
>Synopsis:       ${MAKE} ${.MAKEFLAGS} is superfluous
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    peter
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Aug 24 05:40:01 PDT 1997
>Closed-Date:    Tue Aug 26 07:16:43 PDT 1997
>Last-Modified:  Tue Aug 26 07:17:30 PDT 1997
>Originator:     Nickolay N. Dudorov
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
NTP Infoteka
>Environment:

		FreeBSD 3.0-CURRENT i386

>Description:

	Current src/Makefile contains lines of the form:

	... ${MAKE} ${.MAKEFLAGS} ...

	This construct is not a bug but have no sense at all ;-(
because 'make'

	1) process all options from environment variable "MAKEFLAGS"
AND
	2) sets environment variable "MAKEFLAGS" to the value
	   of make's own variable ".MAKEFLAGS"

>How-To-Repeat:

	Observe this lines of code from src/usr.bin/make/main.c:

/* Next line - 109: */
#define MAKEFLAGS       ".MAKEFLAGS"

/* Next line - 590: */
	/*
	 * First snag any flags out of the MAKE environment variable.
	 * (Note this is *not* MAKEFLAGS since /bin/make uses that and it's
	 * in a different format).
	 */
#ifdef POSIX
	Main_ParseArgLine(getenv("MAKEFLAGS"));
#else
	Main_ParseArgLine(getenv("MAKE"));
#endif

/* Next line - 689: */
	/* Install all the flags into the MAKE envariable. */
	if (((p = Var_Value(MAKEFLAGS, VAR_GLOBAL, &p1)) != NULL) && *p)
#ifdef POSIX
		setenv("MAKEFLAGS", p, 1);
#else
		setenv("MAKE", p, 1);
#endif


>Fix:
	
	Change all "... ${MAKE} ${.MAKEFLAGS} ..." to just
"... ${MAKE} ..." all over the world :-)


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->peter 
Responsible-Changed-By: asami 
Responsible-Changed-When: Sun Aug 24 15:40:21 PDT 1997 
Responsible-Changed-Why:  
The person who added the last round of ${.MAKEFLAGS}.  I'm sure he'll 
fix make(1) before this one too. :) 
State-Changed-From-To: open->closed 
State-Changed-By: peter 
State-Changed-When: Tue Aug 26 07:16:43 PDT 1997 
State-Changed-Why:  
Fixed (${.MAKEFLAGS} removed) in rev 1.141 of Makefile 
>Unformatted:
