Return the last argument if all are non-empty.

Section: Conditional and boolean-like functions

and function

makefile
makefile
READY := $(and $(DB_URL),$(API_KEY),yes)
Explanation

Handy for gating optional behavior.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Conditional and boolean-like functions
if function
Select one of two expansions based on non-empty condition text.
OpenIn sheetmakefilesame section
or function
Return the first non-empty argument.
OpenIn sheetmakefilesame section
intcmp function
Compare integers in GNU make 4.4+.
OpenIn sheetmakefilesame section
subst replace text
Replace every occurrence of one string with another.
OpenIn sheetmakefile1 tag match
shell function
Capture shell command output at parse time.
OpenIn sheetmakefile1 tag match
patsubst pattern replacement
Replace words matching a `%` pattern.
OpenIn sheetmakefile1 tag match