cvs commit: src/usr.bin/make Makefile main.c nonints.h var.c

Ruslan Ermilov ru at FreeBSD.org
Wed Aug 4 07:36:46 PDT 2004


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 at FreeBSD.org
FreeBSD committer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-src/attachments/20040804/db5b803f/attachment.bin


More information about the cvs-src mailing list