BuildRoot - Understanding how to rebuild packages(try know why)
来源:互联网 发布:淘宝电商运营方案 编辑:程序博客网 时间:2024/06/06 00:49
In BuildRoot document 3.5.2 Understanding how to rebuild packages, there are statements:
Internally, to keep track of which steps have been done andwhich steps remain to be done, Buildroot maintains stamp files (emptyfiles that just tell whether this or that action has been done):
output/build/<package>-<version>/.stamp_configured
.If removed, Buildroot will trigger the recompilation of the package from the configuration step (execution of./configure
).output/build/<package>-<version>/.stamp_built
. If removed, Buildroot will trigger the recompilation of the package from the compilation step (execution ofmake
).
Look at build/package/pkg-generic.c
$(BUILD_DIR)/%/.stamp_configured: $(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep)) @$(call MESSAGE,"Configuring") $($(PKG)_CONFIGURE_CMDS) $(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep)) $(Q)touch $@$(2)_TARGET_CONFIGURE = $$($(2)_DIR)/.stamp_configured$(1)-configure: $(1)-patch $(1)-depends \ $$($(2)_TARGET_CONFIGURE)$(1)-build: $(1)-configure \ $$($(2)_TARGET_BUILD)$(1)-install-target: $(1)-build \ $$($(2)_TARGET_INSTALL_TARGET)$(1)-install: $(1)-install-staging $(1)-install-target $(1)-install-images $(1): $(1)-install
every package/<package>/<package>.mk, there will be one statement:
$(eval $(autotools-package))or
$(eval $(generic-package))
It owns dependency on each other:
if .stamp_configured file be removed, then $(1)-configure can't find its prerequisite it will call $$($(2)_TARGET_CONFIGURE)'s recipe, that is do the configure work.
if .stamp_configured file is not removed and not changed, then $(1)-configure find its prerequisite have existed, so it will not call $$($(2)_TARGET_CONFIGURE)'s recipe.
The reason why make works like this, can refer to cmake's manual 4.3 Types of prerequisite:
There are actually two different types of prerequisites understood byGNU make
: normal prerequisites such as described in theprevious section, and order-only prerequisites. A normalprerequisite makes two statements: first, it imposes an order in whichrecipes will be invoked: the recipes for all prerequisites of a targetwill be completed before the recipe for the target is run. Second, itimposes a dependency relationship: if any prerequisite is newer thanthe target, then the target is considered out-of-date and must berebuilt.
that while .stamp_configured file not removed, it is same new as its target $(2)_TARGET_CONFIGURE, so not need rebuild. but if .stamp_configured file removed, it will be created and it is newer than its target $(2)_TARGET_CONFIGURE, so $$($(2)_TARGET_CONFIGURE)'s recipe will be executed.
- BuildRoot - Understanding how to rebuild packages(try know why)
- Android - How-to Rebuild gdbserver
- Android - How-to Rebuild gdbserver
- Developers should know How, What and Why
- Do Know How But Do Not Know Why
- How to install python packages
- Why Cisco users need to know Tcl
- How to know firmware version
- How to extract RPM or DEB packages
- How to install deb packages on Ubuntu
- How to extract RPM or DEB packages
- How to export Oracle Database and packages
- How to install packages in Bioconductor
- Several questions need to know for understanding Binder
- #include---I know how to use
- how to know the type of browser
- How To Learn What Great People Know
- don’t know how to make ‘TargetCompilePass’
- 开源网站地址汇总
- [LeetCode] Palindrome Partition
- poj 2139--Six Degrees of Cowvin Bacon
- 第一章大型网站架构演化
- activiti 笔记
- BuildRoot - Understanding how to rebuild packages(try know why)
- 数据库事务隔离级别
- tomcat优化
- 学校oj平台上不去
- 使用Xcode和Instruments调试解决iOS内存泄露
- MapReduce中实现对HBase中表的操作一
- 查看centos物理配置
- STL排序算法的分析
- hdu 1715 大菲波数