mirror of
https://github.com/Waujito/youtubeUnblock.git
synced 2024-12-22 06:15:31 +00:00
b14abda600
Special thanks to https://github.com/drivenets/iptables_extensions repository with detailed explanations of iptables userspace interaction with the kernel module.
43 lines
840 B
Makefile
43 lines
840 B
Makefile
#Kernel module makes here
|
|
PWD := $(CURDIR)
|
|
|
|
CC := gcc
|
|
CCLD := $(CC)
|
|
LD := ld
|
|
CFLAGS :=
|
|
LDFLAGS :=
|
|
|
|
IPT_CFLAGS := -Wall -Wpedantic -O2
|
|
|
|
.PHONY: kmake kload kunload kreload kclean kmclean xclean
|
|
kmake: kmod xmod
|
|
|
|
kmod:
|
|
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
|
|
|
|
xmod: libipt_YTUNBLOCK.so
|
|
|
|
libipt_YTUNBLOCK.so: libipt_YTUNBLOCK.o
|
|
$(CCLD) -shared -fPIC ${IPT_CFLAGS} -o $@ $^;
|
|
|
|
libipt_YTUNBLOCK.o: libipt_YTUNBLOCK.c
|
|
$(CC) ${IPT_CFLAGS} -D_INIT=lib$*_init -fPIC -c -o $@ $<;
|
|
|
|
kload:
|
|
insmod ipt_YTUNBLOCK.ko
|
|
cp ./libipt_YTUNBLOCK.so /usr/lib/xtables/
|
|
|
|
kunload:
|
|
-rmmod ipt_YTUNBLOCK
|
|
-/bin/rm /usr/lib/xtables/libipt_YTUNBLOCK.so
|
|
|
|
kreload: kunload kload
|
|
|
|
kclean: xtclean kmclean
|
|
|
|
kmclean:
|
|
-$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
|
|
|
|
xtclean:
|
|
-/bin/rm -f libipt_YTUNBLOCK.so libipt_YTUNBLOCK.o
|