我正在尝试修改 AOSP 构建系统以在“make dist”之后运行脚本
我有代码可以做我想做的事......但我并不真正理解它,并且希望得到解释和正在发生的事情。我正在查看的文件是:
https://android.googlesource.com/platform/build.git/+/master/core/distdir.mk
.PHONY: dist
dist: ;
dist_goal := $(strip $(filter dist,$(MAKECMDGOALS)))
MAKECMDGOALS := $(strip $(filter-out dist,$(MAKECMDGOALS)))
ifeq (,$(strip $(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS))))
# The commandline was something like "make dist" or "make dist showcommands".
# Add a dependency on a real target.
dist: $(DEFAULT_GOAL)
endif
令我困惑的部分是 dist 有两个定义:但没有警告。如果我对第二个 dist: 目标有一个配方,它将生成有关重新定义 dist 的警告。第二个目标的意义何在?