新闻中心

EEPW首页>嵌入式系统>设计应用> Linux内核驱动程序的配置

Linux内核驱动程序的配置

作者: 时间:2016-10-08 来源:网络 收藏

在新增的 test 目录下,应该包含如下 Makefile 文件:#drivers/test/Makefile # Makefile for the TEST # obj-$(CONFIG_TEST) +=test.o test_queue.o test_client.o obj-$(CONFIG_TEST_USER) += test_ioctl.o obj-$(CONFIG_PROC_FS) += test_proc.o obj-¥(CONFIG_TEST_CPU) +=cpu/该脚本根据配置变量的取值构建 obj-* 列表。由于 test 目录中包含一个子目录 cpu,当 CONFIG_TEST_CPU=y 时,需要将 cpu 目录加入列表。

test 目录中 cpu 子目录也需要包含如下的 Makefile 文件:#drivers/test/test/Makefile #Makefile for the TEST CPU obj-$(CONFIG_TEST_CPU) +=cpu.o为了使得整个 test 目录能够被编译命令作用到,test 目录父目录中的 Makefile 文件也需要新增如下脚本:obj-$(CONFIG_TEST) +=test/在 drivers/Makefile 中加入 obj-$(CONFIG_TEST) +=test/,使得用户在进行内核编译时能够进入 test 目录。

增加了 Kconfig 和 Makefile 文件之后的新的 test 树型目录如下所示:|——test |——cpu |——cpu.c |——test.c |——test_client.c |——test_ioctl.c |——test_proc.c |——test_queue.c |——Makefile |——Kconfig


上一页 1 2 3 下一页

关键词:

评论


相关推荐

技术专区

关闭