Kconfig和Makefile

来源:互联网 发布:tensorflow是做什么的 编辑:程序博客网 时间:2024/05/17 05:18

内核源码树的目录下都有Kconfig和Makefile。在内核配置make menuconfig时,从Kconfig中读出菜单,用户勾选后保存到.config中。在内核编译时,Makefile调用这个.config,即用户的选择

Kconfig

config RTC_HCTOSYS    bool "Set system time from RTC on startup and resume"    depends on RTC_CLASS = y     default y    help      If you say yes here, the system time (wall clock) will be set ...

congfig下方的那些bool、depends on、default、help等属性,分别为类型、依赖项、默认值、帮助信息

类型
类型分类:bool布尔、 tristate三态(内建、模块、移除)、string字符串、 hex十六进制、 integer整型

  • bool 类型的只能选中或不选中,显示为[ ]
  • tristate类型多了编译成内核模块的选项,显示为< >
  • hex类型,显示为( )

Makefile

obj-$(CONFIG_RTC_HCTOSYS) += hctosys.o

这样,您加的模块也可以编译了

1 0
原创粉丝点击