【问题标题】:I faced problem while compiling kernel module编译内核模块时遇到问题
【发布时间】:2022-04-07 01:16:10
【问题描述】:

错误:*** No rule to make target 'Home' Stop

我是如何编写 Makefile 的:

obj-m += hello-1.o

all:
                make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
                make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

【问题讨论】:

  • 我在提供的 Makefile 中看不到任何内容,这可能会导致有关 Home 目标的错误。你在命令行中输入什么命令来编译模块?
  • 终端中的命令'make'
  • 请在问题后添加更多输出部分。也就是说,错误消息之前的一些行和它之后的行。
  • 请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。
  • 我尝试在 linux 版本 5.11.0-38 上通过命令 'make' 运行和编译 Makefile,但文件未执行时遇到问题。有问题的截图 - i.imgur.com/OjknU5k.pngmake make -C /lib/modules/5.11.0-38-generic/build M=/home/ash/MyProjects/OS Home Assignment/HA3/Code/Test modules make[1]: Entering directory '/usr/src/linux-headers-5.11.0-38-generic' make[1]: *** No rule to make target 'Home'. Stop. make[1]: Leaving directory '/usr/src/linux-headers-5.11.0-38-generic' make: *** [Makefile:4: all] Error 2

标签: kernel-module


【解决方案1】:

问题在于你的文件夹命名,而不是命名文件夹OS Home Assignment,用下划线命名os_home_assigmnet。 更多详情可查看here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-08-15
    • 2011-04-12
    • 2011-05-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多