Question

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

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

Was it helpful?

Solution

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

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

The rationale for this can be found in the comment for this commit and this one, where the symbol was introduced:

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).
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top