From owner-freebsd-hackers Sat Apr 13 8:16:40 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from tomts12-srv.bellnexxia.net (tomts12.bellnexxia.net [209.226.175.56]) by hub.freebsd.org (Postfix) with ESMTP id 8F52F37B405 for ; Sat, 13 Apr 2002 08:16:27 -0700 (PDT) Received: from xena.gsicomp.on.ca ([65.95.179.11]) by tomts12-srv.bellnexxia.net (InterMail vM.4.01.03.23 201-229-121-123-20010418) with ESMTP id <20020413151622.ENZU28359.tomts12-srv.bellnexxia.net@xena.gsicomp.on.ca>; Sat, 13 Apr 2002 11:16:22 -0400 Received: from hermes (hermes.gsicomp.on.ca [192.168.0.18]) by xena.gsicomp.on.ca (8.11.3/8.11.3) with SMTP id g3DF4q711230; Sat, 13 Apr 2002 11:04:52 -0400 (EDT) (envelope-from matt@gsicomp.on.ca) Message-ID: <001901c1e2fe$2b64c740$1200a8c0@gsicomp.on.ca> From: "Matthew Emmerton" To: "Alex Semenyaka" , References: <20020413141834.GA16339@snark.ratmir.ru> Subject: Re: make(1) command-line variables Date: Sat, 13 Apr 2002 11:16:20 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 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 > Dear Colleagues, > > I need some help. Consider I have a Makefile for > application that can be build with different > options. Some of them I need just to define > via -D flag of the ``make'', but other need > to be set to some specific values (for example, > it can be path to my temporary dir). So I > use > > make -DFIRST MYTMPDIR=/special/tmp > > And I want just to keep track of the parameters > used to build that application. Nothing difficult > to obtain the name of Makefile from .MAKEFILE, as well > as make flags of make (including those -D, defining > some variables) from the .MAKEFLAGS var. But I did > NOT found the normal way to obtain the list of > variables defined in the command line through the > VAR=VAL construction. Strange, right? > > Man says that > > .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. [ Makefile ] all: @echo "MAKEFLAGS: ${.MAKEFLAGS}" gabby$ export MAKEFLAGS="-Dfirst -Dsecond"; make MAKEFLAGS: -Dfirst -Dsecond gabby$ -- Matt Emmerton To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message