Makefile.build
来源:互联网 发布:linux 串口can总线驱动 编辑:程序博客网 时间:2024/05/17 09:08
1 make -f scripts/Makefile.buildobj=scripts/basic
gcc -Wp,-MD,scripts/basic/.fixdep.d-Wall -Wmissing-prototypes -Wstrict-prototypes -O2-fomit-frame-pointer -o scripts/basic/fixdepscripts/basic/fixdep.c
gcc -Wp,-MD,scripts/basic/.docproc.d-Wall -Wmissing-prototypes -Wstrict-prototypes -O2-fomit-frame-pointer -o scripts/basic/docprocscripts/basic/docproc.c
rm -f .tmp_quiet_recordmcount
2 在makefile.build中
__build: $(if$(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \
$(if $(KBUILD_MODULES),$(obj-m)$(modorder-target)) \
$(subdir-ym) $(always)
@:
在scripts/basic/Makefile中定义
hostprogs-y := fixdep docproc
always := $(hostprogs-y)
而生成fixdepdocproc的规则在Makefile.host中定义。
3 分析Makefile.host
此文件中定义了一些规则在hostsystem上生成二进制文件,在内核编译过程中会用到这些二进制文件,如文件的预处理。
hostprogs-y=fixdep docproc
__hostprogs := $(sort $(hostprogs-y)$(hostprogs-m))
host-cmulti := $(foreachm,$(__hostprogs),$(if $($(m)-cxxobjs),,$(if $($(m)-objs),$(m))))
若$($(m)-cxxobjs)为非空则返回空,若为空则返回$(if$($(m)-objs),$(m)),$($(m)-objs)为空返回空,因此host-cmulti为空的。
$($(m)-objs),并没有定义fixdep-objs或hostprogs-objs因此为空。
Targets什么用????
接下来它会执行这条规则:
quiet_cmd_host-csingle = HOSTCC $@
cmd_host-csingle = $(HOSTCC)$(hostc_flags) -o $@ $< \
$(HOST_LOADLIBES)$(HOSTLOADLIBES_$(@F))
$(host-csingle): $(obj)/%: $(src)/%.cFORCE
$(call if_changed_dep,host-csingle)
其规则是在cmd_host-csingle中定义的,在调用的if_changed_dep函数中最终是调用了cmd_host-csingle生成目标文件fixdep和docproc
if_changed_dep在scripts/Kbuild.include中
# Execute the command and alsopostprocess generated .d dependencies file.
if_changed_dep = $(if $(strip$(any-prereq) $(arg-check) ), \
@set -e; \
$(echo-cmd) $(cmd_$(1)); \
scripts/basic/fixdep $(depfile) $@'$(make-cmd)' > $(dot-target).tmp;\
rm -f $(depfile); \
mv -f $(dot-target).tmp$(dot-target).cmd)
# if_changed - execute command ifany prerequisite is newer than
# target, or commandline has changed
# if_changed_dep - as if_changed, butuses fixdep to reveal dependencies
# including usedconfig symbols
# if_changed_rule - as if_changed butexecute rule instead
fixdep docproc 二者分别什么作用???
- Makefile.build
- makefile.build(ZT)
- Android Makefile and build system
- Android Makefile & build system 概述
- system build folder Makefile & config
- build makefile for my coding!!
- Makefile中的build构建机制
- makefile的彩色build脚本
- 修改makefile,为程序添加 build号和build日期
- Android Makefile and build system 分析
- Android Makefile and build system 分析
- Android Makefile and build system 分析
- Android MAKEFILE System (1) -- BUILD VERSION INFO
- Android Makefile 分析之 (build/envsetup.sh)
- Android Makefile 分析之 (build/envsetup.sh)
- Android Makefile and build system 分析
- android makefile分析及build( 转载)
- Android Makefile and build system 分析
- uboot1.3.1移植到TQ2440笔记
- 跟我一起写 Makefile
- android 自定义view组件
- 网站发布后存放图片修改的文件夹访问被拒
- 关于ffmpeg的几点使用体会
- Makefile.build
- 程序员面试题精选题-C++
- 按PID枚举模块
- 忘记mysql的用户名和密码是如何处理
- 在使用directshow中一些认识
- php限制IP和IP段的代码(白名单)
- sql 2005提示未能加载包"Microsoft SQL Management Studio Package "
- 我的数据库的用户名和密码备忘录
- HDU 3920