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

[-- Attachment #1 --]
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="last leave"' anymore.
> 
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="last leave" regress
===> 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="last leave" regress
===> 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 target "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="foo bar" make)?
> 
> No. Environment variables have lowest priority - command line variables
> and makefiles override them. But you should be able to say
> CFLAGS="foo bar" make -E CFLAGS to move up CFLAGS in the priority list.
> 
Uh no.  ``make CFLAGS="foo bar"'' won't *work* because CFLAGS+='s won't
DTRT, since command-line variables still take precedence over globals:

$ cat makefile
FOO=	foo
FOO+=	bar
all:
.if ${FOO} != "foo bar"
	@echo impossible
.endif
$ make FOO=ick
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,
-- 
Ruslan Ermilov
ru@FreeBSD.org
FreeBSD committer

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)

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

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