【linux】 Makefile之make menuconfig /uImage
歡迎轉載,轉載時請保留作者信息,謝謝。
博客園地址:http://www.rzrgm.cn/embedded-tzp
Csdn博客地址:http://blog.csdn.net/xiayulewa
config文件生成
Make menuconfig: 在src/Makefile中
%config: scripts_basic outputmakefile FORCE
$(Q)mkdir -p include/linux include/config
$(Q)$(MAKE) $(build)=scripts/kconfig $@
上面最后一句話是會跳轉到scripts/kconfig目錄,然后執行其目錄下的Makefile
在src\scripts\kconfig\Makefile中定義
menuconfig: $(obj)/mconf
$< $(Kconfig)
在scripts\kconfig下的確有mconf文件,是二進制可執行的,$< $(Kconfig)意思為 執行mconf, 其參數為$(Kconfig)
mconf二進制文件的源代碼在src\scripts\kconfig\mconf.c
入口就是這樣了,更加詳細的見如下文章:
linux make menuconfig\Makefile\Kconfig 詳解: http://blog.csdn.net/codectq/article/details/9797031
當執行make menuconfig后,會生成.config文件。
.config轉換成auto.conf
include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
auto.conf依賴于$(KCONFIG_CONFIG),而KCONFIG_CONFIG ?= .config (src/Makefile中)
見如下文章,該文章未細看。
auto.conf, auto.conf.cmd, autoconf.h:http://blog.csdn.net/lcw_202/article/details/6661364
大概流程就是 .config→auto.conf(在src/Makefile中被包含 -include include/config/auto.conf)→ include/generated/autoconf.h(被 linux源代碼包含)
Make uImage:
uImage目標:/src/arch/arm/boot/Makefile
src\scripts\Kbuild.include中定義了if_changed
src\scripts\Makefile.lib:完整mkimage命令定義cmd_uimage
src\scripts\mkuboot.sh 給MKIMAGE賦值
src\arch\arm\boot\Makefile:UIMAGE_LOADADDR加載地址定義
src\arch\arm\mach-s3c24xx\Makefile.boot:加載地址具體定義
要修改加載地址等,找到相關文件并修改就可以了。
下面圖片是拷貝的,忘了出處了。

posted on 2015-04-21 15:01 embedded_linux 閱讀(491) 評論(0) 收藏 舉報
浙公網安備 33010602011771號