manpagez: man pages & more
info make
Home | html | info | man

File: make.info,  Node: Conditional Assignment,  Prev: Immediate Assignment,  Up: Flavors

6.2.4 Conditional Variable Assignment
-------------------------------------

There is another assignment operator for variables, '?='.  This is
called a conditional variable assignment operator, because it only has
an effect if the variable is not yet defined.  This statement:

     FOO ?= bar

is exactly equivalent to this (*note The 'origin' Function: Origin
Function.):

     ifeq ($(origin FOO), undefined)
       FOO = bar
     endif

   Note that a variable set to an empty value is still defined, so '?='
will not set that variable.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.