Date: Thu, 1 Jul 2004 00:40:21 GMT
From: Giorgos Keramidas <keramida@ceid.upatras.gr>
To: freebsd-bugs@FreeBSD.org
Subject: Re: bin/68534: make(1) - ${.MAKEFLAGS} does not contain cmd line args
Message-ID: <200407010040.i610eLpd020288@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/68534; it has been noted by GNATS.
From: Giorgos Keramidas <keramida@ceid.upatras.gr>
To: "John E. Hein" <jhein@timing.com>
Cc: bug-followup@freebsd.org
Subject: Re: bin/68534: make(1) - ${.MAKEFLAGS} does not contain cmd line args
Date: Thu, 1 Jul 2004 03:37:25 +0300
On 2004-06-30 17:36, "John E. Hein" <jhein@timing.com> wrote:
> MAKEFLAGS env variable & .MAKEFLAGS make variable does not contain command
> line args as specified in make(1).
This is not a bug.
The keyword is "may". If you set .MAKEFLAGS in your Makefile or MAKEFLAGS in
the environment than make(1) *will* *pass* these to child processes (as the
value of MAKEFLAGS in the environment).
Not setting MAKEFLAGS is not an error, but does not imply that something
related to make's invocation will get passed in the environment.
Here's an an example:
: giorgos@gothmog:/tmp/maketest$ cat Makefile
: SUBDIR= alpha
:
: .MAKEFLAGS= WITHOUT_X11=YES
:
: all:
: @echo "MFLAGS : ${MFLAGS}"
: @echo "MAKEFLAGS : ${MAKEFLAGS}"
: @echo ".MAKEFLAGS : ${.MAKEFLAGS}"
:
: .include <bsd.subdir.mk>
: giorgos@gothmog:/tmp/maketest$ cat alpha/Makefile
: all:
: @echo "MFLAGS : ${MFLAGS}"
: @echo "MAKEFLAGS : ${MAKEFLAGS}"
: @echo ".MAKEFLAGS : ${.MAKEFLAGS}"
:
: giorgos@gothmog:/tmp/maketest$ make WITHOUT_X11=NO
: MFLAGS : WITHOUT_X11=YES
: MAKEFLAGS : WITHOUT_X11=YES
: .MAKEFLAGS : WITHOUT_X11=YES
: ===> alpha
: MFLAGS :
: MAKEFLAGS : WITHOUT_X11=YES
: .MAKEFLAGS :
: giorgos@gothmog:/tmp/maketest$
Note how WITHOUT_X11=NO in the command line does not have any effect because
./Makefile sets .MAKEFLAGS to something different. But the correct value *is*
propagated as expected to alpha/Makefile.
If there is a bug here it's in what is described in the manpage as:
MFLAGS A synonym for .MAKEFLAGS provided for backward compatibility.
which isn't quite true AFAICT, since MFLAGS includes the value of .MAKEFLAGS
when the latter is set but not vice versa.
- Giorgos
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200407010040.i610eLpd020288>
