1.在mod-subdirs 中加入模块文件夹名
2.按照如下模式添加子目录配置项
subdir-$(CONFIG_MMC) += mmc
注:CONFIG_MMC在Config.in文件中被定义,且当你配置内核时会给其赋值。
3.模块文夹中的Config.in文件简单范例
#
# MMC subsystem configuration
#
mainmenu_option next_comment
comment 'MMC/SD Card support'
tristate 'MMC support' CONFIG_MMC
if [ "$CONFIG_MMC" = "y" -o "$CONFIG_MMC" = "m" ]; then
bool ' MMC debugging' CONFIG_MMC_DEBUG
if [ "$CONFIG_MMC_DEBUG" = "y" ]; then
int ' MMC debugging verbosity (0=quiet, 3=noisy)' CONFIG_MMC_DEBUG_VERBOSE 0
fi
if [ "$CONFIG_MMC_S3C2410" = "y" -o "$CONFIG_ARCH_H5400" = "y" -o "$CONFIG_ARCH_H2200" = "y" ] ; then
tristate ' Samsung MMC ASIC Support' CONFIG_MMC_SAMSUNG_ASIC
dep_tristate ' S3C2410 SD/MMC Support&