2020年3月23日 星期一

makefile 不重覆編譯

$(BUILD_DIR)/%/.stamp_built::
        @$(call step_start,build)
        @$(call MESSAGE,"Building")
        $(foreach hook,$($(PKG)_PRE_BUILD_HOOKS),$(call $(hook))$(sep))
        +$($(PKG)_BUILD_CMDS)
        $(foreach hook,$($(PKG)_POST_BUILD_HOOKS),$(call $(hook))$(sep))
        @$(call step_end,build)
        $(Q)touch $@

# Install to host dir
$(BUILD_DIR)/%/.stamp_host_installed:
        @$(call step_start,install-host)
        @$(call MESSAGE,"Installing to host directory")
        $(foreach hook,$($(PKG)_PRE_INSTALL_HOOKS),$(call $(hook))$(sep))
        +$($(PKG)_INSTALL_CMDS)
        $(foreach hook,$($(PKG)_POST_INSTALL_HOOKS),$(call $(hook))$(sep))
        @$(call step_end,install-host)
        $(Q)touch $@


在編譯的資料夾下, 發現有.stamp_built 則不會重複編譯

沒有留言:

張貼留言