From owner-freebsd-hackers Sat Apr 13 10:12:37 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from snark.ratmir.ru (snark.ratmir.ru [213.24.248.177]) by hub.freebsd.org (Postfix) with ESMTP id A791037B404 for ; Sat, 13 Apr 2002 10:12:29 -0700 (PDT) Received: from snark.ratmir.ru (alexs@localhost [127.0.0.1]) by snark.ratmir.ru (8.12.2/8.12.2) with ESMTP id g3DHCRF8018724; Sat, 13 Apr 2002 21:12:27 +0400 (MSD) (envelope-from alexs@snark.ratmir.ru) Received: (from alexs@localhost) by snark.ratmir.ru (8.12.2/8.12.2/Submit) id g3DHCQJe018723; Sat, 13 Apr 2002 21:12:26 +0400 (MSD) Date: Sat, 13 Apr 2002 21:12:26 +0400 From: Alex Semenyaka To: Matthew Emmerton Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: make(1) command-line variables Message-ID: <20020413171226.GD18143@snark.ratmir.ru> References: <20020413141834.GA16339@snark.ratmir.ru> <001901c1e2fe$2b64c740$1200a8c0@gsicomp.on.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001901c1e2fe$2b64c740$1200a8c0@gsicomp.on.ca> User-Agent: Mutt/1.3.28i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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