Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!seismo!elsie!ado
From: ado@elsie.UUCP (Arthur David Olson)
Newsgroups: comp.unix.questions
Subject: Summary of answers:  feeding CFLAGS of "make CFLAGS=-g" to sub-makes
Message-ID: <7309@elsie.UUCP>
Date: Mon, 5-Jan-87 19:05:32 EST
Article-I.D.: elsie.7309
Posted: Mon Jan  5 19:05:32 1987
Date-Received: Mon, 5-Jan-87 23:36:45 EST
Organization: NIH-LEC, Bethesda, MD
Lines: 50
Keywords: make

Thanks to everyone who replied to my question about how to ensure that
"arguments" such as "CFLAGS=-g" in a command line such as

	make CFLAGS=-g whatever ...

get fed to recursively-invoked makes.

The bad news:  you can't ensure that the "CFLAGS=-g" value gets fed to
sub-makes if you use a command line of the above form.

The good news:  if you're using a recent (System V) version of "make",
and you're a "sh" user, you can use a command such as

	CFLAGS=-g make whatever ...

to get the desired effect--since the
	
	CFLAGS=-g

precedes the word "make", it gets put in the environment; System V make
(and in particular, sub-makes) looks in the environment for variables.

More bad news:  4.xBSD systems come with a version of make that doesn't
look through the environment for variable values.

Mixed news:  MORE/bsd 4.3 systems come with /usr/5bin/make,
a version of make derived from System V that runs under BSD.
This version does pay attention to the environment.
But even with a MORE/bsd source license, you don't get /usr/5bin/make source.
Still, if you're willing to run an unmaintainable program, you can follow the
directions in the Mt. Xinu documentation and use /usr/5bin/make.

Final news:  if you're on a straight BSD system (or are on a MORE/bsd system
and are unwilling to run an unmaintainable program) and you're a "sh" user,
putting this script in your personal "bin" directory:

	#! /bin/csh -f

	exec /bin/make $*:q "`printenv`"

should allow you to use commands such as

	CFLAGS=-g make whatever ...

and get the desired effect.
--
UNIX is a registered trademark of AT&T.
--
	UUCP: ..decvax!seismo!elsie!ado   ARPA: elsie!ado@seismo.ARPA
	DEC, VAX, Elsie & Ado are Digital, Borden & Ampex trademarks.