ifeq ("$(origin O)", "command line")
OUT_DIR := $(O)
$(shell echo "Makefile_log:var O is in the command line" >&2;)
else
$(shell echo "Makefile_log:var O is in the current dir" >&2;)
endif
OUT_DIR := $(O)
$(shell echo "Makefile_log:var O is in the command line" >&2;)
else
$(shell echo "Makefile_log:var O is in the current dir" >&2;)
endif
本文介绍了一个Makefile中的条件编译示例,展示了如何根据变量originO的来源不同执行不同的操作。通过ifeq条件语句判断变量是否来自命令行,并据此改变输出目录。
1340

被折叠的 条评论
为什么被折叠?



