We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fca2673 commit 71cab72Copy full SHA for 71cab72
multifile/Makefile
@@ -1,5 +1,5 @@
1
obj-m += startstop.o
2
-startstop-objs := start.o stop.o
+startstop-objs := hogefunc.o start.o stop.o
3
4
all:
5
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
multifile/hogefunc.c
@@ -0,0 +1,7 @@
+#include <linux/module.h>
+#include <linux/kernel.h>
+
+void print_hello(void)
+{
6
+ printk(KERN_INFO "Hello World!!!!!!!\n");
7
+}
multifile/hogefunc.h
@@ -0,0 +1 @@
+void print_hello(void);
multifile/start.c
@@ -1,9 +1,10 @@
#include <linux/module.h>
#include <linux/kernel.h>
+#include "hogefunc.h"
int init_module(void)
{
- printk(KERN_INFO "Hello world!\n");
8
+ print_hello();
9
return 0;
10
}
0 commit comments