关于makefile 中的一个问题

jack_ooneil jack_ooneil 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我在查看uboot 的makefile时,看到一个这样的用法,无法理解。

ifneq ($(BUILD_DIR),)
saved-output := $(BUILD_DIR)

# Attempt to create a output directory.
$(shell [ -d ${BUILD_DIR} ] || mkdir -p ${BUILD_DIR})


# Verify if it was successful.
BUILD_DIR := $(shell cd $(BUILD_DIR) && /bin/pwd)
$(if $(BUILD_DIR),,$(error output directory "$(saved-output)" does not exist))
endif # ifneq ($(BUILD_DIR),)

其中红色部分, 这里没有目标,没有依赖,而且这条规则没有以TAB键开头,真奇怪?
我在下面添加类似的一句 $(shell echo ‘...’) 就要报错
...全文
评论 2
收藏 已收藏
分享
返回顶部