NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/53136: bmake evaluates MAKEFLAGS like command line argument



The following reply was made to PR bin/53136; it has been noted by GNATS.

From: Valery Ushakov <uwe%stderr.spb.ru@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/53136: bmake evaluates MAKEFLAGS like command line argument
Date: Wed, 28 Mar 2018 16:43:12 +0300

 On Tue, Mar 27, 2018 at 21:30:00 +0000, steffen%sdaoden.eu@localhost wrote:
 
 > POSIX says for MAKEFLAGS
 > 
 > The difference between the contents of MAKEFLAGS and the make
 > utility command line is that the contents of the variable shall not
 > be subjected to the word expansions
 
 This paragraph is probably not pertinent here.  See below.
 
 
 > #?1[steffen@essex tmp]$ cat xxx.mk
 > all: setup
 >         $(MAKE) -f xxx.mk stage2
 > setup:
 >         @echo 'MAKEFLAGS=" .MAKE.LEVEL.ENV=MAKELEVEL VAL_RANDOM=ssl\ arc4\ builtin";export MAKEFLAGS;' > xxx.dat
 > stage2:
 >         @$(_prestop); LC_ALL=C $(MAKE) -f xxx.mk stage3
 > stage3:
 >         @$(_prestop); LC_ALL=C; echo "stage 3: $${MAKEFLAGS},VAL_RANDOM=$${VAL_RANDOM}"; rm -f xxx.dat
 > __prestop = true
 > _prestop = $(__prestop);\
 >         < ./xxx.dat read __ev__; eval $${__ev__}; unset __ev__
 > #?0[steffen@essex tmp]$ MAKE=bmake bmake -f xxx.mk 
 > bmake -f xxx.mk stage2
 > bmake[2]: don't know how to make arc4. Stop
 
 I wonder if you realize that your backslashes do not survive
 
     read __ev__
 
 so you end up with MAKEFLAGS that contains
 
     .MAKE.LEVEL.ENV=MAKELEVEL VAL_RANDOM=ssl arc4 builtin
 
 it's just gmake treats those "arc4" and "builtin" differently, not
 VAL_RANDOM assignment.
 
 As an experiment, try adding --debug=a to what you consider to be
 VAL_RANDOM assignment and then run it with gmake to observe gmake
 obeying that --debug flag.
 
 setup:
 	echo 'MAKEFLAGS=" .MAKE.LEVEL.ENV=MAKELEVEL VAL_RANDOM=ssl\ --debug=a\ arc4\ builtin";export MAKEFLAGS;' > xxx.dat
 
 
 -uwe
 


Home | Main Index | Thread Index | Old Index