关于makefile 中的一个问题
我在查看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 ‘...’) 就要报错