freebsd-dev/usr.bin
Yaroslav Tykhiy 0c35219978 Don't forget to set MAKEFLAGS in the childs' environment
from the .MAKEFLAGS global variable even if it's empty or
unset.  This means setting MAKEFLAGS to just an empty string
in the latter case.

If not doing so, make(1) behaved inconsistently WRT MAKEFLAGS.
In particular, it would let a `-f foo' option down to sub-makes
if .MAKEFLAGS was unset.  E.g.,

	env MAKEFLAGS="-f mymakefile" make

would pass `-f mymakefile' down to sub-makes via their environment
(unless mymakefile added something to .MAKEFLAGS).
But any additional options appearing would change this behaviour to
not passing `-f mymakefile' to sub-makes, as in:

	env MAKEFLAGS="-f mymakefile" make -D DUMMY

or

	env MAKEFLAGS="-f mymakefile -D DUMMY" make

(unless mymakefile cleared .MAKEFLAGS).

Also make(1) would leave MAKEFLAGS at its initial value if the
makefile set .MAKEFLAGS to an empty value.  I.e., it was impossible
to override MAKEFLAGS with an empty value.  (Note well that makefiles
are not to touch MAKEFLAGS directly, they alter .MAKEFLAGS instead.
So make(1) can filter out things such as -f when copying MAKEFLAGS
to .MAKEFLAGS at startup.  Direct modifications to MAKEFLAGS just go
nowhere.)

While the original intentions of the BSD make authors are somewhat
unclear here, the bug proves that NOT passing -f options down is
the settled behaviour because the opposite behaviour is totally
unreliable in the presence of any other options.  In addition, not
passing down -f's found in the environment is consistent with doing
so WRT the command line.

Update the manpage accordingly and make the whole description of
MAKEFLAGS and .MAKEFLAGS more consistent as this change indeed
brings more consistency into the reliable behaviour of make(1).

Submitted by:	ru (main.c)
Tested with:	make world
2008-03-05 20:11:04 +00:00
..
alias
apply
ar - Do not malloc buffer for 0-size member when reading from archive. 2008-03-02 07:01:01 +00:00
asa
at Use NULL instead of 0 for the return value of fopen(). 2007-09-21 01:55:11 +00:00
atm
awk Now that we're way past our conversion from GNU awk to BWK awk, we don't 2008-02-28 16:41:51 +00:00
banner
basename
biff
bluetooth Check return value of listen(). 2007-09-11 01:59:00 +00:00
brandelf
bsdiff
bzip2
bzip2recover
c89
c99
calendar - Add my birthday. 2008-03-03 13:14:39 +00:00
cap_mkdb
catman
chat
checknr
chkey
chpass
cksum
cmp
col
colcrt
colldef follow style(9) more closely and list sys/types.h first after sys/defs.h. 2008-01-01 10:04:10 +00:00
colrm
column
comm
compile_et
compress
cpuset - Remove the -i argument when running a command to simplify things a 2008-03-05 02:10:43 +00:00
csplit
csup
ctags
cut
dig Update bmake glue for the BIND 9.4.1 import. 2007-06-02 23:19:58 +00:00
dirname
du Implement from scratch a -l option for du(1), to match the same option 2008-02-25 19:06:43 +00:00
ee
elf2aout
elfdump
enigma
env Significantly reduce the memory leak as noted in BUGS section for 2007-07-04 00:00:41 +00:00
expand
false
fetch List all environment variables supported by libfetch, along with a reference 2007-12-28 19:47:37 +00:00
file Christos decided to keep the manpages in mdoc(7) format, 2008-01-30 12:56:59 +00:00
file2c Apply style(9) to usage(), fix markup of the manpage. 2007-10-30 17:49:00 +00:00
find Fix SYNOPSIS and usage(). 2008-03-03 08:32:58 +00:00
finger
fmt Prevent strange crashes in fmt with absurd goal lengths introduced by the 2007-10-17 11:41:40 +00:00
fold
from
fstat Flag a hack. 2008-01-24 07:25:13 +00:00
fsync
ftp
gcore
gencat
getconf
getent
getopt
gprof
gzip Fix a few obvious errors in the znew(1) script. 2008-02-09 13:04:01 +00:00
head
hesinfo
hexdump
host Update bmake glue for the BIND 9.4.1 import. 2007-06-02 23:19:58 +00:00
id Fix id -A when the subject has an extended subject token associated with 2007-10-14 00:52:30 +00:00
indent
ipcrm Add the ability to clean up all shared memory segments which are 2007-12-25 00:52:24 +00:00
ipcs Add the ability to clean up all shared memory segments which are 2007-12-25 00:52:24 +00:00
join
jot
kdump This patch adds a new ktrace(2) record type, KTR_STRUCT, whose payload 2008-02-23 01:01:49 +00:00
keylogin
keylogout
killall Fix a typo. 2007-11-09 16:31:47 +00:00
ktrace This patch adds a new ktrace(2) record type, KTR_STRUCT, whose payload 2008-02-23 01:01:49 +00:00
ktrdump
lam
last
lastcomm Increase precision of time values in the process accounting 2007-05-22 06:51:38 +00:00
ldd Expand documentation of -f option 2007-05-12 12:23:40 +00:00
leave
less Resolve conflicts; Update defines.h to reflect latest change. 2007-11-16 22:24:31 +00:00
lessecho
lesskey
lex - Convert NO_INSTALLLIB option to a new syntax: makefiles should 2007-10-20 19:01:50 +00:00
limits Significantly reduce the memory leak as noted in BUGS section for 2007-07-04 00:00:41 +00:00
locale
locate The previous version included too many file system types in the scan, 2007-10-17 07:27:51 +00:00
lock
lockf Also fix a "blank line" issue that sneaked in from rev. 1.19. 2007-10-31 19:26:01 +00:00
logger Minor style(9) nit. 2008-02-05 17:34:44 +00:00
login Add a cross-reference to newgrp(1). 2007-11-30 11:02:36 +00:00
logins
logname
look
lorder
lsvfs Fix (uncritical) potential buffer overflow: the length of "buf" was not 2007-11-15 07:31:11 +00:00
m4 Use NULL instead of 0 for the return value of fopen(). 2007-09-21 01:55:11 +00:00
mail Use static storage-class specifier where appropriate. 2007-11-08 11:13:03 +00:00
make Don't forget to set MAKEFLAGS in the childs' environment 2008-03-05 20:11:04 +00:00
makewhatis Teach makewhatis.c to treat .SS with the same severity as .SH. 2007-10-18 12:53:11 +00:00
mesg
minigzip
ministat WARNS fixes: remove two unused variables and add some constness. 2008-02-08 10:58:50 +00:00
mkdep
mkfifo
mklocale Understand newly introduced "ASCII" encoding 2008-01-22 00:04:50 +00:00
mkstr
mktemp
mkuzip
msgs Never use getenv("HOME") without checking for NULL and non-zero 2007-10-30 03:44:10 +00:00
mt Note what options are only for DDS drives. 2008-01-21 22:08:05 +00:00
nc
ncal
ncplist
ncplogin getopt(3) returns -1, not EOF. 2008-02-19 07:09:19 +00:00
netstat Make netstat -rn more resilient to having the routing table change out from 2008-02-14 20:01:52 +00:00
newgrp
newkey
nfsstat Add a -z flag to nfsstat which zeros the NFS statistics after displaying 2007-10-18 16:38:07 +00:00
nice
nl
nohup
nslookup Update bmake glue for the BIND 9.4.1 import. 2007-06-02 23:19:58 +00:00
nsupdate Update bmake glue for the BIND 9.4.1 import. 2007-06-02 23:19:58 +00:00
objformat
opieinfo
opiekey
opiepasswd
pagesize
passwd Markup nits. 2007-11-07 07:59:38 +00:00
paste
pathchk
pkill
pr
printenv
printf
procstat Add support for displaying a process' current working directory, root 2008-02-09 05:16:26 +00:00
quota Make the human readable numbers printed with the -h option a bit 2008-02-18 01:36:40 +00:00
renice
rev
rlogin
rpcgen Generate code that doesn't fail gcc 4.2's strict aliasing test. 2007-11-20 01:46:12 +00:00
rpcinfo
rs
rsh
rup
ruptime
rusers
rwall
rwho
script
sed WARNS fixes: 2008-02-09 09:12:02 +00:00
setchannel
shar
showmount
smbutil
sockstat o Do not warn if the process exits before we get its name. 2007-06-16 20:24:55 +00:00
split
stat Add some more examples. It always takes me a long time to find the S 2007-04-27 18:23:32 +00:00
su The upper while loop has already recycled child process, so the if 2007-10-18 11:05:30 +00:00
systat ANSIfy and remove register. 2008-01-16 19:27:43 +00:00
tabs
tail Nuking the temporary pointer once it is properly tracked in local storage. 2007-11-22 01:51:46 +00:00
talk
tar Allow appending to archives on block devices as well as 2008-02-19 05:27:17 +00:00
tcopy
tee - Steal short description from POSIX; it's more technical and was 2007-11-13 11:34:20 +00:00
telnet Remove the -DFAST_IPSEC from Makefiles again. 2007-07-05 08:56:46 +00:00
tftp Fix markup. 2007-11-07 07:56:57 +00:00
time Cast to intmax_t to print tv_sec in struct timeval. 2007-05-07 12:23:23 +00:00
tip Reduce the WARNS levels in a couple of places so that we can enable 2007-11-18 00:29:36 +00:00
top Use calloc() when requesting zero'ed memory allocation rather than rolling 2008-01-29 00:06:44 +00:00
touch
tput
tr
true
truncate
truss Revert CLEANDEPFILES commit per ru@'s request; it does not really solve 2008-02-05 08:52:36 +00:00
tset
tsort
tty
ul
uname
unexpand
unifdef Typo in comment spotted by Hasso Tepper. 2008-03-02 22:27:49 +00:00
uniq Fix truncation of lines at LINE_MAX characters by dynamically 2008-02-08 23:04:13 +00:00
units
unvis
unzip Welcome unzip(1), a pure BSD drop-in replacement for ports/unzip. In its 2008-01-08 08:00:06 +00:00
usbhidaction Add support using an alternate table file to usbhidaction(1). 2007-06-30 03:58:01 +00:00
usbhidctl usbhidctl appears to not report features and write size correctly 2007-12-21 03:40:36 +00:00
users
uudecode
uuencode
uuidgen
vacation
vgrind
vi
vis
vmstat Fix some boolean logic errors. && vs & and other sillyness. *blush* 2008-01-18 22:09:44 +00:00
w
wall Fix some bugs in wall(1): 2008-01-15 07:40:30 +00:00
wc
what
whereis
which
who
whois
window
write write(1) needs to strip off the leading /dev/ from the tty name for the 2007-11-12 20:02:21 +00:00
xargs Revive '-opt' flags which I accidentally removed. 2008-01-27 16:20:36 +00:00
xinstall Give a better description when a install of multiple files fails 2007-12-14 08:46:57 +00:00
xlint
xstr Markup revision. 2007-11-02 12:07:07 +00:00
yacc
yes
ypcat
ypmatch
ypwhich
Makefile - Add cpuset to the build. 2008-03-02 07:52:26 +00:00
Makefile.inc