[英]how create a makefile for program.c and how to compile and execute in Real Time Application Interface
我有一个hollowworld.c
:
/* hello.c */
#include <linux/kernel.h>
#include <linux/module.h>
MODULE_LICENSE("GPL");
int init_module(void)
{
printk("Hello world!\n"); /* printk = kernel printf, to the console */
return 0;
}
void cleanup_module(void)
{
printk("Goodbye world!\n");
return;
}
如何为program.c创建makefile以及如何在实时应用程序界面中编译和执行?
要编译内核模块,请参考内核源代码树中的其他驱动程序。 在您的示例中,您会发现它的Makefile非常简单:
obj-M += hollowworld.o
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.