简体   繁体   English

echo 在 Makefile 中不起作用

[英]echo not working from Makefile

I have added code to Makefile something like:我已经在 Makefile 中添加了如下代码:

ifeq "$var" "1"
    var_1 := 1\
    echo "g++ version OK"\
    $(info $(var_1))
else
    echo "needs to be updated"
endif

I am using tabs everywhere in this part of code.我在这部分代码中到处都使用选项卡。 It does not seem to work, nothing echoes at all when I run make, Makefile already contains the object files and flags etc. Does it have something to with the position of the code?它似乎不起作用,当我运行 make 时根本没有任何回声,Makefile 已经包含目标文件和标志等。它与代码的位置有关吗? I'm unable to identify.我无法识别。 Please help.请帮忙。

echo is a shell command, it only works from within a recipe or $(shell ...) function. echo是一个 shell 命令,它只能在一个 recipe 或$(shell ...)函数中工作。

Anywhere else use $(info ...) function.在其他任何地方使用$(info ...)函数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM