define recursive-makefiles
$(eval RECURSIVE_MAKEFILES := $(shell find $(1)/ -type f -name Android.mk))
$(eval EXCLUSIVE_LIST := $(1)/Android.mk)
$(filter-out $(EXCLUSIVE_LIST),$(RECURSIVE_MAKEFILES))
endef
LOCAL_PATH := $(call my-dir)
include $(call recursive-makefiles,$(LOCAL_PATH))
(1)LOCAL_PATH := $(call my-dir)
call my-dir调用my-dir命令返回当前目录
(2)
call recursive-makefiles,$(LOCAL_PATH)
调用
recursive-makefiles,$(1)为
$(LOCAL_PATH)
(3)
$(eval RECURSIVE_MAKEFILES := $(shell find $(1)/ -type f -name Android.mk))
在当前目录(包含子目录)下找出名为"
Android.mk
"的字符串赋值给RECURSIVE_MAKEFILES
(4)
$(eval EXCLUSIVE_LIST := $(1)/Android.mk)
当前目录下的Android.mk排除掉
(5)
$(filter-out $(EXCLUSIVE_LIST),$(RECURSIVE_MAKEFILES))
从
RECURSIVE_MAKEFILES排除掉
EXCLUSIVE_LIST
(6)
include
$(call recursive-makefiles,$(LOCAL_PATH))
include找到的makefile文件,找到一个包含一个!!!
makefile打印:
$(info $(LOCAL_PATH))
$(warning $(LOCAL_PATH))
$(error $(LOCAL_PATH)) //这个打印会直接返回错误
$(info $(LOCAL_PATH))
$(warning $(LOCAL_PATH))
$(error $(LOCAL_PATH)) //这个打印会直接返回错误