gpt4 book ai didi

makefile - 如何在 Makefile 中打印消息?

转载 作者:行者123 更新时间:2023-12-03 05:42:20 28 4
gpt4 key购买 nike

我想在使用 makefile 进行构建过程时打印一些消息。下面的代码可以打印消息,但不会执行后面的脚本。我该如何解决这个问题?

ifeq (yes, ${TEST})
CXXFLAGS := ${CXXFLAGS} -DDESKTOP_TEST
test:
@echo '************ TEST VERSION ************'
else
release:
@echo "************ RELEASE VERSIOIN **********"
endif

最佳答案

$(info your_text) : Information. This doesn't stop the execution.

$(warning your_text) : Warning. This shows the text as a warning.

$(error your_text) : Fatal Error. This will stop the execution.

参见GNU make: 8.13 Functions That Control Make了解详情。

关于makefile - 如何在 Makefile 中打印消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11775733/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com