On Sat, Apr 13, 2002 at 09:12:26PM +0400, Alex Semenyaka wrote: > Hi there, > > On Sat, Apr 13, 2002 at 11:16:20AM -0400, Matthew Emmerton wrote: > >> .MAKEFLAGS > >> The environment variable MAKEFLAGS may contain anything > > that > >> may be specified on make's command line. Its contents are > >> stored in make's .MAKEFLAGS variable. > >> > >> That is wrong, .MAKEFLAGS does not contain anything. > > It won't contain anything unless you set MAKEFLAGS in the calling > > environment. > > Argh! Sorry, that was my fault: MAKEFLASG (env var) will be copied to > .MAKEFLAGS (make's var) and it can contain anything. Absolutely correct - > here. But I've asked a little bit different question. Suppose, I wrote > > make VAR=VAL # .MAKEFLAGS is empty > > There is no way to trace this parameter inside Makefile. I mean you cannot > put something in your Makefile that will tell you 'for this build we have > value VAL assined to the variable VAR'. However you can easily do such > things with definitions of that style: > > make -DVAR # .MAKEFLAGS is '-D VAR' > > which logically should be equivalent to > > make VAR=1 # .MAKEFLAGS is empty again > > Moreover, in the last case there is NO ANY MAKE'S VARIABLE containing VAR, see: > > bash-2.05a$ make -DUUU -V .MAKEFLAGS > -D UUU -V .MAKEFLAGS > bash-2.05a$ make UUU=1 -V .MAKEFLAGS > -V .MAKEFLAGS > bash-2.05a$ make UUU=1 -dv -r | grep UUU > bash-2.05a$ > > Hope now I was more careful and clear... But sure I might miss sothing > again, so will wait for replys. > Heh, was looking at this NetBSD commitlog today looking for another thing. They apparently have this bug fixed as well, in the step 3 below:
: revision 1.67
: date: 2001/06/01 20:33:37; author: sjg; state: Exp; lines: +42 -6
:
: A number of semi-related changes.
: 1. make -dx turns on DEBUG_SHELL which causes sh -x to be used where
: possible.
: 2. PrintOnError() is now called when make is stopping due to an error.
: This routine reports the curdir and the value of any variables listed
: in MAKE_PRINT_VAR_ON_ERROR.
: 3. Variables set via command line, are propagated to child-makes via
: MAKEFLAGS. This behaviour appears to be necessary for POSIX (according
: to the GNU folk anyway).
: 4. Do not reset MAKEFILE when reading ".depend" as this rather eliminates the
: usefulness of ${MAKEFILE}.
: 5. Added ${.newline} as a simple means of being able to include \n in the
: result of a :@ loop expansion.
: 6. Set ${MAKE_VERSION} if defined. Need to come up with a useful value.
:
: Reviewed: christos
Cheers,
--
Ruslan Ermilov Sysadmin and DBA,
[EMAIL PROTECTED] Sunbay Software AG,
[EMAIL PROTECTED] FreeBSD committer,
+380.652.512.251 Simferopol, Ukraine
http://www.FreeBSD.org The Power To Serve
http://www.oracle.com Enabling The Information Age
msg33644/pgp00000.pgp
Description: PGP signature

