Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Apr 2002 21:12:26 +0400
From:      Alex Semenyaka <alexs@ratmir.ru>
To:        Matthew Emmerton <matt@gsicomp.on.ca>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: make(1) command-line variables
Message-ID:  <20020413171226.GD18143@snark.ratmir.ru>
In-Reply-To: <001901c1e2fe$2b64c740$1200a8c0@gsicomp.on.ca>
References:  <20020413141834.GA16339@snark.ratmir.ru> <001901c1e2fe$2b64c740$1200a8c0@gsicomp.on.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

Sincerely yours,
Alex Semenyaka

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020413171226.GD18143>