-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (34 loc) · 729 Bytes
/
Makefile
File metadata and controls
46 lines (34 loc) · 729 Bytes
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
40
41
42
43
44
45
46
obj-m += sort.o
sort-objs := \
sort_mod.o \
sort_impl.o
obj-m += xoro.o
xoro-objs := \
xoro_mod.o
CFLAGS = -Wall -Werror
GIT_HOOKS := .git/hooks/applied
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
all: $(GIT_HOOKS) user test_xoro
$(MAKE) -C $(KDIR) M=$(PWD) modules
$(GIT_HOOKS):
@scripts/install-git-hooks
@echo
user: user.c
$(CC) $(CFLAGS) -o $@ $^
test_xoro: test_xoro.c
$(CC) $(CFLAGS) -o $@ $^
insmod: all rmmod
sudo insmod sort.ko
sudo insmod xoro.ko
rmmod:
@sudo rmmod sort 2>/dev/null || echo
@sudo rmmod xoro 2>/dev/null || echo
check: all
$(MAKE) insmod
sudo ./user
sudo ./test_xoro
$(MAKE) rmmod
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
$(RM) user test_xoro