OpenWRT Makefile流程记录

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
$(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=""

 

posted on   sudochen  阅读(351)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示