Hi..

Let me preference by saying right or wrong, my experience with make comes
from Irix on SGI and the book "Managing Projects with Make", Feb 93
printing, by Andrew Oram and Steve Talbott from O'Reilly & Associates, Inc.

When doing a recursive make with the GNU 3.79.1 make, I ran into a surprise
with the way command line variables are handled.  It seems with GNU that
once a variable is set on a command line it is passed automatically to the
sub makes.  With SGI, command line variables must be set each time for them
to be passed to the sub makes.  Oram and Talbott's book on page 73 documents
make as working like the SGI implementation.  After rooting around "info
make" on my Linux box, I did find a discussion about setting MAKEOVERRIDES
in the make command line.  If I set "MAKEOVERRIDES=" in the first recursive
make call in my attached example, then the GNU make does work as I would
expect.

Please at least document MAKEOVERRIDES at
http://www.gnu.org/manual/make-3.79.1/html_node/make_toc.html and/or better
yet add a command line option to have make not automatically pass variables
to sub makes.

Attached is a simple makefile with output from Red Hat 7.2 and SGI Irix
6.5.4

 <<GNUmakeOutput.txt>>  <<Makefile>>  <<SGImakeOutput.txt>> 

Keith Stanley
Flight Simulation
System of Systems Assessment
Voice: (314) 233-8209
Fax:    (314) 233-5125
The Boeing Company
P.O. Box 516. MC: S0642233
St. Louis, Missouri 63166


In build
MyVar is here
Makeflags is 
Makeoverrides is 
make clean MYVAR=gone
make[1]: Entering directory `/sgi/ids1c/swdev/cme/clouseau/misc/tyt'
In clean
MyVar is gone
Makeflags is w -- MYVAR=gone
Makeoverrides is MYVAR=gone
make final
make[2]: Entering directory `/sgi/ids1c/swdev/cme/clouseau/misc/tyt'
In final
MyVar is gone
Makeflags is w -- MYVAR=gone
Makeoverrides is MYVAR=gone
make[2]: Leaving directory `/sgi/ids1c/swdev/cme/clouseau/misc/tyt'
make[1]: Leaving directory `/sgi/ids1c/swdev/cme/clouseau/misc/tyt'

Attachment: Makefile
Description: Binary data

In build
MyVar is here
Makeflags is 
Makeoverrides is 
        make clean MYVAR=gone
In clean
MyVar is gone
Makeflags is 
Makeoverrides is 
        make final
In final
MyVar is here
Makeflags is 
Makeoverrides is 

Reply via email to