linux - echo 不能从 Makefile 工作

标签 linux makefile

我在 Makefile 中添加了如下代码:

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

我在这部分代码中到处都使用制表符。它似乎不起作用,当我运行 make 时没有任何回声,Makefile 已经包含目标文件和标志等。它与代码的位置有什么关系吗?我无法辨认。请帮忙。

最佳答案

echo 是一个 shell 命令,它只能在配方或 $(shell ...) 函数中使用。

在其他任何地方使用 $(info ...)功能。

关于linux - echo 不能从 Makefile 工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39974312/

相关文章:

c - 需要在C代码中运行 'read'命令

linux - 如何知道哪个进程正在更改 linux 中的文件

python - 如何在读取时不写入文件,反之亦然

linux - 通过 nghttp2 使用支持 HTTP\2 的 cURL 连接到 Apple 的 APNS

c - 构建文件(Rake 或 Make?)用于构建一些具有通用选项的简单库?

linux - docker : 'go.mod: permission denied' on go commands

installation - Janus WebRTC 安装问题

c++ - make clean 不会删除其他目录下的文件

qt - QMAKE 中的 GNU make --jobs 选项

python - 有没有办法在 Makefile 中自动生成依赖树?