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

Harti Brandt harti at freebsd.org
Mon Aug 9 08:55:16 PDT 2004


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?

harti

Index: make.1
===================================================================
RCS file: /local/cvs/freebsd/src/usr.bin/make/make.1,v
retrieving revision 1.77
diff -u -r1.77 make.1
--- make.1	4 Aug 2004 15:10:35 -0000	1.77
+++ make.1	9 Aug 2004 15:51:47 -0000
@@ -533,6 +533,13 @@
 .Nm
 is unable to change into any of the remaining three directories,
 then the current directory is used.
+Note, that
+.Ev MAKEOBJDIRPREFIX
+and
+.Ev MAKEOBJDIR
+must be environment variables and should not be set on
+.Nm Ns 's
+command line.
 .Pp
 The
 .Nm

harti


More information about the cvs-all mailing list