Lin Jui-Nan Eric
2010-Apr-11 08:40 UTC
Different behavior of make(1) between command line argument and .MAKEFLAGS special target
Hi listers, Recently I found that there's different behavior of specifying -j1 in command line argument and special target ".MAKEFLAGS". According to section "SPECIAL TARGETS" in manpage of make(1): .MAKEFLAGS This target provides a way to specify flags for make when the makefile is used. The flags are as if typed to the shell, though the -f option will have no effect. Flags (except for -f) and variable assignments specified as the source for this target are also appended to the .MAKEFLAGS internal variable. Please note the difference between this target and the .MAKEFLAGS internal variable: specifying an option or variable assignment as the source for this target will affect both the current makefile and all processes that make executes. The behavior should be same while specifying flags in Makefile and typed to the shell. But when I try to set "-j" in Makefile, the behavior is different. I have filed a PR and send a patch (http://www.freebsd.org/cgi/query-pr.cgi?pr=144388). Any suggestion is welcomed. Sincerely, Jui-Nan Eric Lin