关于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 ‘...’) 就要报错
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 ‘...’) 就要报错
...全文
相关推荐
Makefile 多目录编译Demo
多目录编译、Makefile 三种用法 一定要会的
makefile嵌套
参考链接: https://www.cnblogs.com/hzijone/p/9940935.html, 通过makefile调用另外的makefile, makefile嵌套
makefile报错
Fatal error: Don't know how to make target `client.h
Makefile手册_中文版.pdf
这是Makefile的中文版本使用手册,很齐全,而且是中文中翻译的比较好的。
linux 下makefile教程
作为Linux下的程序开发人员,大家一定都遇到过Linux Makefile,用make命令来编译自己写的程序确实是很方便。


驱动开发/核心开发
