GNU make manual 翻译(五十九)

本文介绍了条件性指令在构建过程中的工作原理。此类指令会被立即解析,因此无法直接使用自动化变量。若要在条件判断中利用自动化变量,则需要将条件置于规则的片段中并采用shell条件语法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

继续翻译

Conditional Directives                        
----------------------                        
                        
Conditional directives are parsed immediately.  This means, for example, that automatic variables cannot be used in conditional directives, as automatic variables are not set until the recipe for  that rule is invoked.  If you need to use automatic variables in a  conditional directive you _must_ move the condition into the recipe and use shell conditional syntax instead.                        
                        

条件性指令

条件性指令会被立即解析。这意味着,例如,自动化变量不能在 条件性指令中使用,因为自动化变量是要知道规则的片段被执行时才会被设置的。如果你需要在条件性指令中使用一个自动化变量,你必须把这个条件移动到片断中,并且用 shell 的条件语法来代替。

后文待续

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值