我正在使用 GNU Make 3.80。在我的 Makefile 中,我使用自动变量 $@ 来引用当前目标。
@echo current target is ... [$@]
ifeq ($@,sms)
@echo yep, they are equal
else
@echo no, they are not equal
endif
Run Code Online (Sandbox Code Playgroud)
似乎 $@ 扩展为 sms,如下面的输出所示。
输出是:
current target is ... [sms]
no, they are not equal
Run Code Online (Sandbox Code Playgroud)
我的问题:由于 $@(显然)扩展为 sms,不应该执行 ifeq 条件的“true”分支(结果输出应该是 yep,它们是相等的)?[我不知道为什么输出不是,它们不相等。]
我正在使用GNU Make 3.80.
在我的Makefile_1中,我正在调用Makefile_2.在某些情况下,Makefile_2"抛出"错误.
有没有办法让我"捕获"和"处理"(在Makefile_1中)Makefile_2可能抛出的错误?