在Makefile中做什么?

在Makefile中做什么?,makefile,Makefile,通过查看我的Makefile,我看到了SOMEVAR?=somestuff,我不确定这是什么意思 任何帮助都将不胜感激 谢谢 根据,仅当当前未使用其他值定义时,才会设置SOMEVAR。根据,仅当当前未使用其他值定义时,才会设置SOMEVAR。如果尚未定义,则将值分配给SOMEVAR。如果尚未定义,则将值分配给SOMEVAR。请参阅make的手册页: 变量赋值 make中的变量与shell中的变量非常相似,而且,tradi- 字符,由所有大写字母组成 变量赋值修饰符 可用于为变量赋值的五个运算符如

通过查看我的
Makefile
,我看到了
SOMEVAR?=somestuff
,我不确定这是什么意思

任何帮助都将不胜感激


谢谢

根据,仅当当前未使用其他值定义时,才会设置
SOMEVAR

根据,仅当当前未使用其他值定义时,才会设置
SOMEVAR

如果尚未定义,则将值分配给
SOMEVAR

如果尚未定义,则将值分配给
SOMEVAR

请参阅
make
的手册页:

变量赋值 make中的变量与shell中的变量非常相似,而且,tradi- 字符,由所有大写字母组成

变量赋值修饰符 可用于为变量赋值的五个运算符如下 如下:

 =       Assign the value to the variable.  Any previous value is overrid-
         den.

 +=      Append the value to the current value of the variable.

 ?=      Assign the value to the variable if it is not already defined.

 :=      Assign with expansion, i.e. expand the value before assigning it
         to the variable.  Normally, expansion is not done until the vari-
         able is referenced.  NOTE: References to undefined variables are
         not expanded.  This can cause problems when variable modifiers
         are used.

 !=      Expand the value and pass it to the shell for execution and
         assign the result to the variable.  Any newlines in the result
         are replaced with spaces.

请参阅
make
的手册页:

变量赋值 make中的变量与shell中的变量非常相似,而且,tradi- 字符,由所有大写字母组成

变量赋值修饰符 可用于为变量赋值的五个运算符如下 如下:

 =       Assign the value to the variable.  Any previous value is overrid-
         den.

 +=      Append the value to the current value of the variable.

 ?=      Assign the value to the variable if it is not already defined.

 :=      Assign with expansion, i.e. expand the value before assigning it
         to the variable.  Normally, expansion is not done until the vari-
         able is referenced.  NOTE: References to undefined variables are
         not expanded.  This can cause problems when variable modifiers
         are used.

 !=      Expand the value and pass it to the shell for execution and
         assign the result to the variable.  Any newlines in the result
         are replaced with spaces.