Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Apr 2002 17:31:01 +0300
From:      Ruslan Ermilov <ru@FreeBSD.ORG>
To:        Alex Semenyaka <alexs@ratmir.ru>
Cc:        Matthew Emmerton <matt@gsicomp.on.ca>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: make(1) command-line variables
Message-ID:  <20020418143101.GC70982@sunbay.com>
In-Reply-To: <20020413171226.GD18143@snark.ratmir.ru>
References:  <20020413141834.GA16339@snark.ratmir.ru> <001901c1e2fe$2b64c740$1200a8c0@gsicomp.on.ca> <20020413171226.GD18143@snark.ratmir.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

--vEao7xgI/oilGqZ+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Apr 13, 2002 at 09:12:26PM +0400, Alex Semenyaka wrote:
> Hi there,=20
>=20
> 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.
>=20
> 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
>=20
> make VAR=3DVAL	# .MAKEFLAGS is empty
>=20
> 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:=20
>=20
> make -DVAR	# .MAKEFLAGS is '-D VAR'
>=20
> which logically should be equivalent to
>=20
> make VAR=3D1	# .MAKEFLAGS is empty again
>=20
> Moreover, in the last case there is NO ANY MAKE'S VARIABLE containing VAR=
, see:
>=20
> bash-2.05a$ make -DUUU -V .MAKEFLAGS
>  -D UUU -V .MAKEFLAGS
> bash-2.05a$ make UUU=3D1 -V .MAKEFLAGS
>  -V .MAKEFLAGS
> bash-2.05a$ make UUU=3D1 -dv -r | grep UUU
> bash-2.05a$
>=20
> Hope now I was more careful and clear... But sure I might miss sothing
> again, so will wait for replys.
>=20
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
:=20
: 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.
:=20
: Reviewed: christos


Cheers,
--=20
Ruslan Ermilov		Sysadmin and DBA,
ru@sunbay.com		Sunbay Software AG,
ru@FreeBSD.org		FreeBSD committer,
+380.652.512.251	Simferopol, Ukraine

http://www.FreeBSD.org	The Power To Serve
http://www.oracle.com	Enabling The Information Age

--vEao7xgI/oilGqZ+
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (FreeBSD)
Comment: For info see http://www.gnupg.org

iD8DBQE8vtilUkv4P6juNwoRAisPAJ9jVOUgK3ToBSDyObdruNwfYFUC1gCeITfM
fjQX52aaNeO+I6eEsn7p/lo=
=xL/k
-----END PGP SIGNATURE-----

--vEao7xgI/oilGqZ+--

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?20020418143101.GC70982>