System: centos7
The kernel version: 3.10
Installed GCC version: 4.8.5
Installed make version: the GNU make 3.82
Had been set test files in the same directory cs. C:
Static int __init hello_init (void)
{
Printk (KERN_EMERG "hello, init \ n");
return 0;
}
The static void __exit hello_exit (void)
{
Printk (KERN_EMERG "hello, exit \ n");
}
The module_init (hello_init);
Module_exit (hello_exit);
MODULE_AUTHOR (" 123 ");
MODULE_LICENSE (" 123 ");
MODULE_DESCRIPTION (" 123 ");
MODULE_VERSION (" 123 ");
///////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
I then vim makefile a file and add a compiled code: obj - y:=cs. O I finally saved after executing commands make results hint:
Make: * * * no targets, stop
Behind I've seen a lot of Makefile data is also a few times online written make template but suggested the same mistake I don't know whether I need to go to kernel.org to download standard code installed
Also please predecessors taught me what problem is this under lead to give some advice
CodePudding user response:
Have any predecessors know tutorial build on centos driven development environment, information, books can give some advice bossesCodePudding user response:
I get my points has been solved to individualsCodePudding user response:
Is the kernel header files are not correctCodePudding user response:
Kernel module MAKEFILE is not just to add a line, have to find the kernel source code path, and then the MAKE - M=the current path to C modulesIn addition, the MAKEFILE should have at least one goal,