diff --git a/share/mk/sys.mk b/share/mk/sys.mk index 04294ac60d1..c534cea748c 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -95,7 +95,13 @@ ECHODIR ?= true .endif .endif -.if !empty(.MAKEFLAGS:M-n) && ${.MAKEFLAGS:M-n} == "-n" +.if defined(.PARSEDIR) +# _+_ appears to be a workaround for the special src .MAKE not working. +# setting it to + interferes with -N +_+_ ?= +.elif !empty(.MAKEFLAGS:M-n) && ${.MAKEFLAGS:M-n} == "-n" +# the check above matches only a single -n, so -n -n will result +# in _+_ = + _+_ ?= .else _+_ ?= +