Subject: Re: make: putting command line vars in MAKEFLAGS
To: Simon J. Gerraty <sjg@quick.com.au>
From: Todd Vierling <tv@wasabisystems.com>
List: tech-toolchain
Date: 06/02/2001 19:48:28
On Wed, 30 May 2001, Simon J. Gerraty wrote:

: VAR=default
:
: all:
: 	@echo VAR=${VAR}
:
: rec:
: 	${MAKE} -f ${MAKEFILE} all
:
: with our current make (and no .depend file to be read):
:
: $ make
: VAR=default
: $ make VAR=foo
: VAR=foo
: $ make VAR=foo rec
: ...
: VAR=default

This is expected behavior, and I dare you to find a vendor make that does
this differently.  8-)  I've never seen a make(1) that propagates this way;
if you want to recursively override variables, you need to use something
like "-e".

(A sidenote on the topic of make(1):  It seems <bsd.pkg.mk> uses
"${MAKE} ${MAKEFLAGS}" to recurse.  That sound redundant to you?  Might
explain why recursive pkgsrc makes end up with a bazillion duplicate
flags in ps listings.)

-- 
-- Todd Vierling <tv@wasabisystems.com>  *  Wasabi NetBSD:  Run with it.
-- NetBSD 1.5 now available on CD-ROM  --  http://www.wasabisystems.com/