Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Aug 2004 17:36:24 +0300
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        Harti Brandt <harti@FreeBSD.org>
Cc:        cvs-src@FreeBSD.org
Subject:   Re: cvs commit: src/usr.bin/make Makefile main.c nonints.h var.c
Message-ID:  <20040804143624.GA26422@ip.net.ua>
In-Reply-To: <20040804122057.V96634@beagle.kn.op.dlr.de>
References:  <200408031856.i73IuV8c082723@repoman.freebsd.org> <20040804121452.51ca6d98@Magellan.Leidinger.net> <20040804122057.V96634@beagle.kn.op.dlr.de>

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

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

On Wed, Aug 04, 2004 at 12:25:10PM +0200, Harti Brandt wrote:
[...]
> Note also that you cannot do 'cd /usr/src/usr.bin ;
> make SUBDIR=3D"last leave"' anymore.
>=20
What do you mean?  AFAIK, this never worked because SUBDIR
was put as an environment variable into sub-makes, and
{last,leave}/Makefile would be confused by thinking they
have a non-empty SUBDIR (and then the ${PROG}: target and
a subdir:: target from bsd.subdir.mk come to a conflict):

$ /old/make SUBDIR=3D"last leave" regress
=3D=3D=3D> last
"/usr/share/mk/bsd.subdir.mk", line 60: Inconsistent operator for last
make: fatal errors encountered -- cannot continue
*** Error code 1

Stop in /usr/src/usr.bin.
$ /new/make SUBDIR=3D"last leave" regress
=3D=3D=3D> last
"/usr/share/mk/bsd.subdir.mk", line 60: Inconsistent operator for last
"/usr/share/mk/bsd.subdir.mk", line 66: warning: duplicate script for targe=
t "last" ignored
make: fatal errors encountered -- cannot continue
*** Error code 1

Stop in /usr/src/usr.bin.

> AL>Does this also apply to environment variables (CFLAGS=3D"foo bar" make=
)?
>=20
> No. Environment variables have lowest priority - command line variables
> and makefiles override them. But you should be able to say
> CFLAGS=3D"foo bar" make -E CFLAGS to move up CFLAGS in the priority list.
>=20
Uh no.  ``make CFLAGS=3D"foo bar"'' won't *work* because CFLAGS+=3D's won't
DTRT, since command-line variables still take precedence over globals:

$ cat makefile
FOO=3D	foo
FOO+=3D	bar
all:
=2Eif ${FOO} !=3D "foo bar"
	@echo impossible
=2Eendif
$ make FOO=3Dick
impossible

This commit isn't changing much, and the change is really natural.
All it does it to ensure that once FOO is specified as a command
line variable, it stays the command-line type variable in sub-makes.
The other semantics is not touched.


Cheers,
--=20
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer

--tKW2IUtsqtDRztdT
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQFBEPRoqRfpzJluFF4RAtHbAJ9gr2BBxVEU0Mwio6rfJRkBry7RLACdEFDf
p5QtVpu5CK8QwkKPJDcCuIU=
=AnAL
-----END PGP SIGNATURE-----

--tKW2IUtsqtDRztdT--



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