cvs commit: src/usr.bin/make Makefile main.c nonints.h var.c

M. Warner Losh imp at bsdimp.com
Mon Aug 9 09:08:26 PDT 2004


In message: <20040809174540.U32590 at beagle.kn.op.dlr.de>
            Harti Brandt <harti at freebsd.org> writes:
: On Mon, 9 Aug 2004, M. Warner Losh wrote:
: 
: MWL>In message: <20040809.092824.11587387.imp at bsdimp.com>
: MWL>            "M. Warner Losh" <imp at bsdimp.com> writes:
: MWL>: In message: <20040809061817.GA53369 at numeri.campus.luth.se>
: MWL>:             Johan Karlsson <johan at FreeBSD.org> writes:
: MWL>: : On Mon, Aug 09, 2004 at 14:12 (+0900), Jun Kuriyama wrote:
: MWL>: : > At Tue, 3 Aug 2004 18:56:31 +0000 (UTC),
: MWL>: : > Hartmut Brandt wrote:
: MWL>: : > >   Log:
: MWL>: : > >   Put variable assignments from the command line into the MAKEFLAGS
: MWL>: : > >   variable as required by POSIX. This causes such variables to be
: MWL>: : > >   pushed into all sub-makes called by the make (except when the MAKEFLAGS
: MWL>: : > >   variable is explicitely changed in the sub-make's environment).
: MWL>: : > >   This makes them also mostly un-overrideable in sub-makes except on the
: MWL>: : > >   sub-make's command line. Therefor specifying 'make CC=icc' will cause
: MWL>: : > >   icc to be used as C compiler in all sub-makes no matter what the Makefiles
: MWL>: : > >   itself try to do to the CC variable.
: MWL>: : > >   
: MWL>: : > >   This patch also corrects the handling of the MFLAGS variable. MFLAGS
: MWL>: : > >   contains all the command line flags but not the command line variable
: MWL>: : > >   assignments. The evaluation of the .MFLAGS or .MAKEFLAGS target now
: MWL>: : > >   changes both MFLAGS and MAKEFLAGS (they used to change MAKEFLAGS only).
: MWL>: : > >   Makefiles can use MFLAGS for their own purposes given that they do not
: MWL>: : > >   except MFLAGS to be undefined at the beginning and that they don't evaluate
: MWL>: : > >   .MFLAGS or .MAKEFLAGS. MFLAGS should be removed for POSIX compliance,
: MWL>: : > >   but it is unfortunately heavily used by the X makefiles.
: MWL>: : > 
: MWL>: : > I'm using MAKEOBJDIRPREFIX as a make argument to build the world.
: MWL>: : 
: MWL>: : Don't.
: MWL>: : According to make(1) it is an environment variable.
: MWL>: 
: MWL>: The current man page is stunningly vague about this.  It says that it
: MWL>: respects these environment variables, but it doesn't say they have to
: MWL>: be set in the enviornment to the exclusion of setting them on the
: MWL>: command line.
: MWL>
: MWL>So either we can make it work, or document that the variables listed
: MWL>in the environment section must be set as environment variables only.
: 
: There is nothing to be made work. Both variables are intended to be used
: as environment variables. That they happend to work from the command line
: was a side effect of make putting its variables into the environment.
: Does the following clarify things enough?

Yes.  That's great!

Warner


More information about the cvs-src mailing list