$ {_ + _} in the BSD Makefile

I found ${_+_} in the FreeBSD Makefile .

What is the meaning of ${_+_} in BSD Makefiles?

+4
source share
1 answer

${_+_} refers to a variable. It is defined in share / mk / sys.mk , which is read by the make process. Therefore, user Zack indicated the right direction in his comment; this variable in some cases expands to the + sign, depending on the flags set for make:

 .if !empty(.MAKEFLAGS:Mn) && ${.MAKEFLAGS:Mn} == "-n" _+_ ?= .else _+_ ?= + .endif 

The rationale for this can be found in the comments for this commit and this one where the symbol was entered:

 Make make recurse into sub-directories and sub-makes when given two -n flags. If only one -n flag is given the old behaviour is retained (POLA). 
+4
source

All Articles