⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makefile

📁 通过linux操作系统限制P2P的流量的源代码
💻
字号:
ifneq ($(KERNELRELEASE),)obj-m := ipt_ipp2p.oelseKERNEL_SRC ?= $(firstword $(wildcard /lib/modules/$(shell uname -r)/build /usr/src/linux))ifeq ($(KERNEL_SRC),)$(error You need to define KERNEL_SRC)endififneq ($wildcard $(KERNEL_SRC)/include/linux/modversions.h),)MODVERSIONS = -DMODVERSIONSendif_KVER = $(strip $(shell cat $(KERNEL_SRC)/Makefile | grep -e '^VERSION' | cut -d"=" -f2))_KPL = $(strip $(shell cat $(KERNEL_SRC)/Makefile | grep -e '^PATCHLEVEL' | cut -d"=" -f2))_KSUB = $(strip $(shell cat $(KERNEL_SRC)/Makefile | grep -e '^SUBLEVEL' | cut -d"=" -f2))KERNEL_SERIES=$(_KVER).$(_KPL)ifeq ($(KERNEL_SERIES), 2.6)	TARGET=ipt_ipp2p.koelse	TARGET=ipt_ipp2p.oendifSED = sedIPTABLES_BIN = iptablesifndef $(IPTABLES_SRC)IPTVER ?= \	$(shell $(IPTABLES_BIN) --version | $(SED) -e 's/^iptables v//')IPTABLES_SRC = $(wildcard /usr/src/iptables-$(IPTVER))endififeq ($(IPTABLES_SRC),)IPTABLES_SRC = /usr/src/iptables-1.2.9endifIPTABLES_INCLUDE = -I$(IPTABLES_SRC)/includeIPTABLES_VERSION = $(shell cat $(IPTABLES_SRC)/Makefile | grep -e '^IPTABLES_VERSION:=' | cut -d"=" -f2)IPTABLES_OPTION = -DIPTABLES_VERSION=\"$(IPTABLES_VERSION)\"CC = gccCFLAGS = -O3 -Wallall: modules libipt_ipp2p.somodules: $(TARGET)ipt_ipp2p.o: ipt_ipp2p.h ipt_ipp2p.c	$(CC) $(CFLAGS) -I$(KERNEL_SRC)/include -c ipt_ipp2p.c -D__KERNEL__ -DMODULE $(MODVERSIONS)ipt_ipp2p.ko: ipt_ipp2p.h ipt_ipp2p.c	$(MAKE) -C $(KERNEL_SRC) SUBDIRS=$(PWD) moduleslibipt_ipp2p.so: libipt_ipp2p.c ipt_ipp2p.h	$(CC) $(CFLAGS) $(IPTABLES_OPTION) $(IPTABLES_INCLUDE) -fPIC -c libipt_ipp2p.c	ld -shared -o libipt_ipp2p.so libipt_ipp2p.oclean:	-rm -f *.o *.so *.ko .*.cmd *.mod.cendif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -