From owner-cvs-all@FreeBSD.ORG Wed Mar 5 20:11:05 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 388AD106566B; Wed, 5 Mar 2008 20:11:05 +0000 (UTC) (envelope-from yar@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 2D55A8FC2D; Wed, 5 Mar 2008 20:11:05 +0000 (UTC) (envelope-from yar@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m25KB5SY088259; Wed, 5 Mar 2008 20:11:05 GMT (envelope-from yar@repoman.freebsd.org) Received: (from yar@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m25KB5kB088258; Wed, 5 Mar 2008 20:11:05 GMT (envelope-from yar) Message-Id: <200803052011.m25KB5kB088258@repoman.freebsd.org> From: Yar Tikhiy Date: Wed, 5 Mar 2008 20:11:05 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/usr.bin/make main.c make.1 X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Mar 2008 20:11:05 -0000 yar 2008-03-05 20:11:05 UTC FreeBSD src repository Modified files: usr.bin/make main.c make.1 Log: Don't forget to set MAKEFLAGS in the childs' environment from the .MAKEFLAGS global variable even if it's empty or unset. This means setting MAKEFLAGS to just an empty string in the latter case. If not doing so, make(1) behaved inconsistently WRT MAKEFLAGS. In particular, it would let a `-f foo' option down to sub-makes if .MAKEFLAGS was unset. E.g., env MAKEFLAGS="-f mymakefile" make would pass `-f mymakefile' down to sub-makes via their environment (unless mymakefile added something to .MAKEFLAGS). But any additional options appearing would change this behaviour to not passing `-f mymakefile' to sub-makes, as in: env MAKEFLAGS="-f mymakefile" make -D DUMMY or env MAKEFLAGS="-f mymakefile -D DUMMY" make (unless mymakefile cleared .MAKEFLAGS). Also make(1) would leave MAKEFLAGS at its initial value if the makefile set .MAKEFLAGS to an empty value. I.e., it was impossible to override MAKEFLAGS with an empty value. (Note well that makefiles are not to touch MAKEFLAGS directly, they alter .MAKEFLAGS instead. So make(1) can filter out things such as -f when copying MAKEFLAGS to .MAKEFLAGS at startup. Direct modifications to MAKEFLAGS just go nowhere.) While the original intentions of the BSD make authors are somewhat unclear here, the bug proves that NOT passing -f options down is the settled behaviour because the opposite behaviour is totally unreliable in the presence of any other options. In addition, not passing down -f's found in the environment is consistent with doing so WRT the command line. Update the manpage accordingly and make the whole description of MAKEFLAGS and .MAKEFLAGS more consistent as this change indeed brings more consistency into the reliable behaviour of make(1). Submitted by: ru (main.c) Tested with: make world Revision Changes Path 1.166 +2 -0 src/usr.bin/make/main.c 1.108 +33 -31 src/usr.bin/make/make.1