GNU Make 使用手册(中译版)
http://www.eifr.com/linkfiles/file/gnumake.htm
Makefile常用函数表
http://blog.163.com/muren20062094@yeah/blog/static/161844416201151922730312/
1.Makefile中判断目录是否存在
1). 调用shell的函数进行判断
exist = $(shell if [ -f $(FILE) ]; then echo "exist"; else echo "notexist"; fi;)
ifeq (exist, "exist")
#do something here
endif
当然,这个方法很土,但是能够工作
2). 使用makefile的函数进行判断
ifeq ($(FILE), $(wildcard $(FILE)))
#do something here
endif
eg:
ifeq (/com/myproject/bin_image, $(wildcard /com/myproject/bin_image))
#目录存在
DG_DIR_TARGET_CRAMFS = /com/myproject/bin_image
else
#目录不存在
DG_DIR_TARGET_CRAMFS = /home/bin_image
endif
GNUMake使用手册与Makefile技巧
1万+

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



