make 出了什么问题?
C
#include <linux/module.h>
#include <linux/kernel.h>
int init_module(void)
{
printk(KERN_INFO "Hello world 1.\n");
return 0;
}
void cleanup_module(void)
{
printk(KERN_INFO "Goodbye world 1.\n");
}
/* makefile */
/* uname -r = 2.6.32-5-686 */
obj-m += hello.o
all :
make -C /lib/modules/2.6.32-5-686/build /home/mgh/Documents modules
clean :
make -C /lib/modules/2.6.32-5-686/build /home/mgh/Documents clean
root@localhost:/home/mgh/Documents# make
make -C /lib/modules/2.6.32-5-686/build /home/mgh/Documents modules
make[1]: Entering directory /usr/src/linux-headers-2.6.32-5-686'
/usr/src/linux-headers-2.6.32-5-common/scripts/Makefile.build:44: /usr/src/linux-headers-``2.6.32-5-common/scripts/basic/Makefile: No such file or directory
make[5]: *** No rule to make target `/usr/src/linux-headers-2.6.32-5-common/scripts/basic``/Makefile'. Stop.
make[4]: *** [scripts_basic] Error 2
make[3]: Nothing to be done for `/home/mgh/Documents'.
make[3]: *** No rule to make target `include/config/auto.conf', needed by `include/config``/kernel.release'. Stop.
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-5-686'
make: *** [all] Error 2
C
#include <linux/module.h>
#include <linux/kernel.h>
int init_module(void)
{
printk(KERN_INFO "Hello world 1.\n");
return 0;
}
void cleanup_module(void)
{
printk(KERN_INFO "Goodbye world 1.\n");
}
/* makefile */
/* uname -r = 2.6.32-5-686 */
obj-m += hello.o
all :
make -C /lib/modules/2.6.32-5-686/build /home/mgh/Documents modules
clean :
make -C /lib/modules/2.6.32-5-686/build /home/mgh/Documents clean
root@localhost:/home/mgh/Documents# make
make -C /lib/modules/2.6.32-5-686/build /home/mgh/Documents modules
make[1]: Entering directory /usr/src/linux-headers-2.6.32-5-686'
/usr/src/linux-headers-2.6.32-5-common/scripts/Makefile.build:44: /usr/src/linux-headers-``2.6.32-5-common/scripts/basic/Makefile: No such file or directory
make[5]: *** No rule to make target `/usr/src/linux-headers-2.6.32-5-common/scripts/basic``/Makefile'. Stop.
make[4]: *** [scripts_basic] Error 2
make[3]: Nothing to be done for `/home/mgh/Documents'.
make[3]: *** No rule to make target `include/config/auto.conf', needed by `include/config``/kernel.release'. Stop.
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-5-686'
make: *** [all] Error 2
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
猜测:您没有在自定义 Makefile 中设置 M 环境变量。请参阅http://tldp.org/LDP/lkmpg/2.6/html/x181。 html
下次,请确实问一个比“出了什么问题?”更具体的问题。
Guesswork: You did not set the M environment variable in your custom Makefile. See http://tldp.org/LDP/lkmpg/2.6/html/x181.html
And the next time, please do indeed ask a more specific question than 'What is wrong?'
我认为
make
有什么问题。不过,我非常确定您的 Makefile 有问题。根据一些随机的互联网搜索,尝试如下操作:假设您的 Makefile 位于
/home/mgh/Documents
中。I dispute that anything is wrong with
make
. I am very certain, though, that something is wrong with your Makefile. According to some random internet searching, try something like this:This is assuming that your Makefile resides in
/home/mgh/Documents
.