linux config源码,linux源码“.config”文件分析

一、.config文件概述

.config文件是linux内核配置文件,当执行#make uImage编译生成内核时,顶层的Makefile会读取.config文件的内容,根据这个配置文件来编译所定制的内核。

二、.config文件关联

1 文件关联图

以CONFIG_DM9000为例进行说明。

linux config源码,linux源码“.config”文件分析_第1张图片

在#make menuconfig中选择使用CONFIG_DM9000,然后在配置文件.config中就会有对应的项设置成为y或者m。

在#make uImage编译内核时,顶层Makefile会根据.config的配置生成两个配置文件:

include/linux/autoconf.h

include/config/auto.conf

其中,autoconf.h是C语言头文件主要影响C文件的编译。

auto.conf会被顶层Makefile所包含,然后传递到底层Makefile中从而影响到底层文件的编译。

2 关联文件部分内容展示

1、.config

48304ba5e6f9fe08f3fa1abda7d326ab.png

# # Automatically generated make config: don'

你可能感兴趣的:(linux,config源码)