-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
39 lines (29 loc) · 982 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
KBUILD_CFLAGS += -w
# Specify the path for the modules relative to the src/ directory
obj-m += src/kernel_birthday_list_module.o src/kernel_timer_module.o src/kernel_workqueue_module.o
# Default target to compile the kernel modules
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
# Target to clean up build artifacts
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
# Targets to unload the kernel modules
unload_birthday_list:
sudo rmmod kernel_birthday_list_module
unload_timer:
sudo rmmod kernel_timer_module
unload_workqueue:
sudo rmmod kernel_workqueue_module
# Targets to load the kernel modules. Adjust the path for the ko files.
load_birthday_list:
sudo insmod src/kernel_birthday_list_module.ko
load_timer:
sudo insmod src/kernel_timer_module.ko
load_workqueue:
sudo insmod src/kernel_workqueue_module.ko
# Target to clear the kernel log buffer
clear:
sudo dmesg -c
# Target to view the kernel log buffer
view:
dmesg