[15676] in Athena Bugs

home help back first fref pref prev next nref lref last post

sun4 8.1.11: recursive make bashes MAKEFLAGS

daemon@ATHENA.MIT.EDU (Bruce R. Lewis)
Tue Nov 18 16:00:38 1997

To: bugs@MIT.EDU
Date: Tue, 18 Nov 1997 16:00:33 EST
From: "Bruce R. Lewis" <brlewis@MIT.EDU>

System name:		marathon
Type and version:	SPARC/4 8.1.11 (with mkserv)
Display type:		cgthree

What were you trying to do?
	Use Solaris 2.5 make as documented

What's wrong:

_______________________________________________________________________________
  ( setenv MAKEFLAGS "CC=$COMPILER CC2=$COMPILER" ; make -f makefile.test test1 )
echo gcc gcc
gcc gcc
echo MAKEFLAGS=$MAKEFLAGS
MAKEFLAGS=

  ( setenv MAKEFLAGS "CC=$COMPILER CC2=$COMPILER" ; make -f makefile.test )
make -f makefile.test test1
echo cc cc
cc cc
echo MAKEFLAGS=$MAKEFLAGS
MAKEFLAGS=
echo MAKEFLAGS=$MAKEFLAGS
MAKEFLAGS=
_______________________________________________________________________________
makefile.test:

CC= cc
CC2= cc

all:
	$(MAKE) -f makefile.test test1
	echo MAKEFLAGS=$$MAKEFLAGS

test1:
	echo $(CC) $(CC2)
	echo MAKEFLAGS=$$MAKEFLAGS
_______________________________________________________________________________

What should have happened:
	In both cases, "gcc gcc" should have been printed,
	and the MAKEFLAGS environment variable should have been
	preserved.

Please describe any relevant documentation references:

the man page:

     The MAKEFLAGS variable will be accessed from the environment
     before  the  makefile  is  read.   At  that time, all of the
     options (except -f and  - p)  and  command-line  macros  not
     already  included  in  MAKEFLAGS  are added to the MAKEFLAGS
     macro.  The MAKEFLAGS macro will be passed into the environ-
     ment as an environment variable for all child processes.  If
     the MAKEFLAGS macro is subsequently set by the makefile,  it
     replaces  the  MAKEFLAGS  variable  currently  found  in the
     environment.

home help back first fref pref prev next nref lref last post