1、在drivers下建立testzjl的文件夹,内含helloworld.c和Makefile:
# drivers/testzjl/Makefile
#
# Makefile for Helloworld. 2008/11/27 Zhang jinglei.
#
# drivers/testzjl/Makefile
#
# Makefile for Helloworld. 2008/11/27 Zhang jinglei.
#
obj-$(CONFIG_HELLOWORLD) += helloworld.o
;
2、将Kconfig写入该文件夹:
# drivers/testzjl/Kconfig
# 2008/11/27 Zhang jinglei
2、将Kconfig写入该文件夹:
# drivers/testzjl/Kconfig
# 2008/11/27 Zhang jinglei
menu "Test -- Zhang Jinglei"
comment "comment: Test of Helloworld"
comment "comment: Test of Helloworld"
config TEST_ZJL
bool "Test Helloworld Support"
---help---
For test only.
bool "Test Helloworld Support"
---help---
For test only.
config HELLOWORLD
bool "Helloworld module"
depends on TEST_ZJL
---help---
The helloworld module.
bool "Helloworld module"
depends on TEST_ZJL
---help---
The helloworld module.
endmenu
3、在上层的Kconfig中,加入source "drivers/testzjl/Kconfig",表示引用。
4、在上层的Makefile中,加入:
#testzjl
obj-$(CONFIG_TEST_ZJL) += testzjl/
4、在上层的Makefile中,加入:
#testzjl
obj-$(CONFIG_TEST_ZJL) += testzjl/
5、注意上面CONFIG_TEST_ZJL和TEST_ZJL的区别!因为会自动在TEST_ZJL前面加上“CONFIG_“。
6、make menuconfig, make。
6、make menuconfig, make。