簡體   English   中英

如何為program.c創建makefile以及如何在實時應用程序界面中編譯和執行

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM