# cc compile template, generate rule for dep, obj: (file, cc[, flags, dir])
define cc_template
# todep 的作用是生成对应的.d 文件 :后面的 $(1) | $$$$(dir $$$$@)如何解释,特别是这个 | ??
$$(call todep,$(1),$(4)): $(1) | $$$$(dir $$$$@)
@$(2) -I$$(dir $(1)) $(3) -MM $$< -MT "$$(patsubst %.d,%.o,$$@) $$@"> $$@
$$(call toobj,$(1),$(4)): $(1) | $$$$(dir $$$$@)
@echo + cc $$<
$(V)$(2) -I$$(dir $(1)) $(3) -c $$< -o $$@
ALLOBJS += $$(call toobj,$(1),$(4))
endef
todep 的作用是生成对应的.d 文件 :后面的 $(1) | $$$$(dir $$$$@)如何解释??
建议看手册,搜索一下
Because dollar signs are used to start make variable references, if you really want a dollar sign in a target or prerequisite you must write two of them, ‘$$’ (see How to Use Variables). If you have enabled secondary expansion (see Secondary Expansion) and you want a literal dollar sign in the prerequisites list, you must actually write four dollar signs (‘$$$$’).
|后面的是叫做order-only的依赖,就是只要求其存在,而不要求target要比它新(一般是目录什么的)