-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
25 lines (20 loc) · 682 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
CONFIG_MODULE_SIG=n
obj-m += modreveal.o
ccflags-y := -std=gnu99 -Wno-declaration-after-statement
PWD := $(CURDIR)/build
all:
mkdir -p build
cp $(CURDIR)/Makefile $(CURDIR)/build/.
cp $(CURDIR)/kernel/modreveal.c $(CURDIR)/build/.
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
gcc $(CURDIR)/user/modreveal.c -I/usr/include/libnl3 -lnl-3 -lnl-genl-3 -o $(CURDIR)/build/modreveal
cp $(CURDIR)/build/modreveal $(CURDIR)/.
cp $(CURDIR)/build/modreveal.ko $(CURDIR)/.
clean:
-make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
-rm -rf build
-rm modreveal
-rm modreveal.ko
cycle: clean all
-sudo rmmod modreveal
sudo insmod ./build/modreveal.ko