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

M. Warner Losh imp at bsdimp.com
Mon Aug 9 08:44:20 PDT 2004


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

So either we can make it work, or document that the variables listed
in the environment section must be set as environment variables only.

Warner


More information about the cvs-src mailing list