-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
39 lines (27 loc) · 779 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
ifeq ($(KERNELRELEASE),)
#outside the kernel make file
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
all: modules
modules:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
modules_install:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
TESTS_SOURCES = tests/ff_tests.c tests/tests_main.c
ff.tests: $(TESTS_SOURCES)
gcc $(TESTS_SOURCES) -o ff.tests -lcheck
check: ff.tests
./ff.tests
clean:
rm -rf *.o *~ core .depend .*.cmd *.ko *.ko.unsigned *.mod.c .tmp_versions Module.symvers modules.order ff.tests
load:
ln -s `pwd`/ff.rules /etc/udev/rules.d/70-ff.rules
insmod ff.ko
unload:
rmmod ff.ko
rm /etc/udev/rules.d/70-ff.rules
.PHONY: all modules moduels_install clean check load unload
else
#inside the kernel make
obj-m := ff.o
endif