【问题标题】:How to resolve the error "make[1]: *** No rule to make target `init/main.o', needed by ***" in Linux building process?如何解决Linux构建过程中出现的错误“make[1]: *** No rule to make target `init/main.o', required by ***”?
【发布时间】:2011-04-26 13:43:03
【问题描述】:

我尝试为“RHEL:2.6.18.128-el5”版本构建内核。我还使用 $rpm -ivh 2.6.18.128-el5.src.rpm 安装了源 rpm 文件 尽管它显示了一些警告,但我认为它已正确安装。然后我尝试了

$ cd /usr/src/redhat/SPECS ; rpmbuild -bp kernel*spec

它复制了源代码中的所有补丁文件。 然后,我开始了如下过程:

[root@localhost 2.6.18-128.el5-i686]# make menuconfig
scripts/kconfig/mconf arch/i386/Kconfig
#
# configuration written to .VVV
#
#
# configuration written to .config
#


*** End of Linux kernel configuration.
*** Execute 'make' to build the kernel or try 'make help'.

[root@localhost 2.6.18-128.el5-i686]# make
scripts/kconfig/conf -s arch/i386/Kconfig
  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h
make[1]: *** No rule to make target `init/main.o', needed by `init/built-in.o'.  Stop.
make: *** [init] Error 2

任何人都可以分享有关“程序中的错误在哪里以及如何纠正它的详细信息?

【问题讨论】:

    标签: linux build makefile


    【解决方案1】:

    这是因为缺少某些文件,并且在 makefile 中为该丢失的文件编写了规则。 它无法找到 built-in.o 所需的 main.o,这意味着缺少诸如 main.cpp 之类的文件,因此未执行 makefile 中 main.cpp 到 main.o 的规则。

    【讨论】:

      【解决方案2】:

      您不应该使用make bzImagemake modules 而不是纯make 吗?

      检查this post

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-01-01
        • 2016-11-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-06-07
        • 2019-09-15
        • 2015-06-23
        相关资源
        最近更新 更多