Skip to content

Commit 7d0774d

Browse files
committed
xmake framework
1 parent d82a806 commit 7d0774d

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

src/main.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include <linux/init.h>
2+
#include <linux/module.h>
3+
4+
5+
MODULE_VERSION("1.0.0");
6+
MODULE_LICENSE("Dual BSD/GPL");
7+
MODULE_AUTHOR("DavidingPlus");
8+
MODULE_DESCRIPTION("A Linux Kernel Module");
9+
10+
11+
static int __init linuxKernelModuleInit(void)
12+
{
13+
pr_info("linux-kernel-module: Hello Linux Kernel Module\n");
14+
15+
return 0;
16+
}
17+
18+
static void __exit linuxKernelModuleExit(void)
19+
{
20+
pr_info("linux-kernel-module: Goodbye Linux Kernel Module\n");
21+
}
22+
23+
24+
module_init(linuxKernelModuleInit);
25+
module_exit(linuxKernelModuleExit);

xmake.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
option ("linux-headers", {showmenu = true, description = "Set linux-headers path."})
2+
3+
4+
target ("linux-kernel-module")
5+
add_rules ("platform.linux.module")
6+
add_files ("src/*.c")
7+
set_values ("linux.driver.linux-headers", "$(linux-headers)")
8+
9+
add_cflags ("-O1")

0 commit comments

Comments
 (0)