1. 程式人生 > 其它 >OpenWRT Makefile流程記錄

OpenWRT Makefile流程記錄

$(toolchain/stamp-install): $(tools/stamp-install)

通過subdir.mk的stampfile函式 $(eval $(call stampfile,$(curdir),tools,install,,_$(subst $(space),,$(tools_enabled)))) 展開 define stampfile $(1)/stamp-$(3):=$(if $(6),$(6),$(STAGING_DIR))/stamp/.$(2)_$(3)$(5) $$($(1)/stamp-$(3)): $(TMP_DIR)/.build $(4) @+$(SCRIPT_DIR)/timestamp.pl -n $$($(1)/stamp-$(3)) $(1) $(4) || \ $(MAKE) $(if $(QUIET),--no-print-directory) $$($(1)/flags-$(3)) $(1)/$(3) @mkdir -p $$$$(dirname $$($(1)/stamp-$(3))) @touch $$($(1)/stamp-$(3)) $$(if $(call debug,$(1),v),,.SILENT: $$($(1)/stamp-$(3))) .PRECIOUS: $$($(1)/stamp-$(3)) # work around a make bug $(1)//clean:=$(1)/stamp-$(3)/clean $(1)/stamp-$(3)/clean: FORCE @rm -f $$($(1)/stamp-$(3)) endef tools/stamp-install:= $(STAGING_DIR)/stamp/.tools_install_yyynnnyynnn $(tools/stamp-install)
: tmp/.build make $(tools/flags-install) tools/install #通過subdir.mk的subdir函式展開產生規則 tools/clean:=tools/stamp-install/clean tools/stamp-install/clean: FORCE rm -rf $(tools/stamp-install) subdir展開關於clean有一個,如果clean則同時要執行tools/stamp-install/clean刪除檔案,其他命令不影響 tools/clean: tools/stamp-install/clean @+ $(SUBMAKE) -r -C target/linux clean BUILD_VARIANT=""