【问题标题】:Error when compiling using 'make' command in fedora 17在 Fedora 17 中使用“make”命令编译时出错
【发布时间】:2012-09-06 16:23:30
【问题描述】:

我正在尝试构建一个新的内核并向该构建的内核添加一个新的系统调用,当我在创建新的系统调用后尝试使用“make”命令重新编译时,我收到了这个错误。

scripts/Makefile.build:44: /usr/src/linux-3.0.42/block/helloworld/Makefile: No such file or directory
make[1]: *** No rule to make target `/usr/src/linux-3.0.42/block/helloworld/Makefile'.  Stop.
make: *** [block/helloworld] Error 2

如果有人可以帮助我,我将不胜感激:)

【问题讨论】:

  • helloworld 目录是什么?里面是什么?我认为错误信息很清楚
  • helloworld 是我创建新系统调用和生成文件的地方

标签: makefile compiler-errors linux-kernel fedora system-calls


【解决方案1】:

内核模块使用的 make 版本可能与您可能习惯的不同。它极大地简化了事情,但一开始可能会有点混乱。这是内核制作的文档:http://lwn.net/Articles/21835/

这是一个 hello world 模块的教程:

c码:http://tldp.org/LDP/lkmpg/2.6/html/x121.html

对应的makefile:http://tldp.org/LDP/lkmpg/2.6/html/x181.html

【讨论】:

    【解决方案2】:

    不要带回旧帖子,但我遇到了类似的问题,我很惊讶没有人提出这个建议。

    编辑 linux3-x-x/Makefile 时

    您想通过修改以下行来包含您的目录:

    core-y += kernel/mm/fs/ipc/security/crypto/block/

    core-y += kernel/mm/fs/ipc/security/crypto/block/helloworld/

    一个简单的错误是在每个目录 block/_helloworld/ 之后忘记 THE SPACE 下划线代表空格

    如果您没有该空间,那么无论如何您都会收到上述错误。

    只是想我会添加这个以防其他人正在寻找回复

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-09-08
      • 1970-01-01
      • 1970-01-01
      • 2015-12-11
      • 1970-01-01
      • 2021-01-12
      • 1970-01-01
      相关资源
      最近更新 更多