diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 27 |
1 files changed, 18 insertions, 9 deletions
@@ -7,14 +7,20 @@ ifndef KERNEL_DIR KERNEL_DIR=/usr/src/linux endif +ifndef KBUILD_OUTPUT +KBUILD_OUTPUT=$(KERNEL_DIR) +endif ifndef IP_NF_SET_MAX IP_NF_SET_MAX=256 endif ifndef IP_NF_SET_HASHSIZE IP_NF_SET_HASHSIZE=1024 endif +ifndef V +V=0 +endif -IPSET_VERSION:=2.3.3 +IPSET_VERSION:=2.4 PREFIX:=/usr/local LIBDIR:=$(PREFIX)/lib @@ -29,7 +35,10 @@ RELEASE_DIR:=/tmp COPT_FLAGS:=-O2 CFLAGS:=$(COPT_FLAGS) -Wall -Wunused -Ikernel/include -I. # -g -DIPSET_DEBUG #-pg # -DIPTC_DEBUG SH_CFLAGS:=$(CFLAGS) -fPIC -SETTYPES:=ipmap portmap macipmap iphash nethash iptree iptreemap ipporthash +SETTYPES:=ipmap portmap macipmap +SETTYPES+=iptree iptreemap +SETTYPES+=iphash nethash ipporthash ipportiphash ipportnethash +SETTYPES+=setlist PROGRAMS=ipset SHARED_LIBS=$(foreach T, $(SETTYPES),libipset_$(T).so) @@ -53,12 +62,12 @@ patch_kernel: modules: @[ ! -f $(KERNEL_DIR)/net/ipv4/netfilter/Config.in ] || (echo "Error: The directory '$(KERNEL_DIR)' looks like a Linux 2.4.x kernel source tree, you have to patch it by 'make patch_kernel'." && exit 1) @[ -f $(KERNEL_DIR)/net/ipv4/netfilter/Kconfig ] || (echo "Error: The directory '$(KERNEL_DIR)' doesn't look like a Linux 2.6.x kernel source tree." && exit 1) - @[ -f $(KERNEL_DIR)/.config ] || (echo "Error: The kernel source in '$(KERNEL_DIR)' must be configured" && exit 1) - @[ -f $(KERNEL_DIR)/Module.symvers ] || echo "Warning: You should run 'make modules' in '$(KERNEL_DIR)' beforehand" - cd kernel; make -C $(KERNEL_DIR) M=`pwd` IP_NF_SET_MAX=$(IP_NF_SET_MAX) IP_NF_SET_HASHSIZE=$(IP_NF_SET_HASHSIZE) modules + @[ -f $(KBUILD_OUTPUT)/.config ] || (echo "Error: The kernel source in '$(KERNEL_DIR)' must be configured" && exit 1) + @[ -f $(KBUILD_OUTPUT)/Module.symvers ] || echo "Warning: You should run 'make modules' in '$(KERNEL_DIR)' beforehand" + cd kernel; make -C $(KBUILD_OUTPUT) M=`pwd` V=$V IP_NF_SET_MAX=$(IP_NF_SET_MAX) IP_NF_SET_HASHSIZE=$(IP_NF_SET_HASHSIZE) modules modules_install: modules - cd kernel; make -C $(KERNEL_DIR) M=`pwd` modules_install + cd kernel; make -C $(KBUILD_OUTPUT) M=`pwd` modules_install install: binaries_install modules_install @@ -67,14 +76,14 @@ clean: $(EXTRA_CLEANS) [ -f $(KERNEL_DIR)/net/ipv4/netfilter/Config.in ] || (cd kernel; make -C $(KERNEL_DIR) M=`pwd` clean) #The ipset(8) self -ipset.o: ipset.c +ipset.o: ipset.c ipset.h $(CC) $(CFLAGS) -DIPSET_VERSION=\"$(IPSET_VERSION)\" -DIPSET_LIB_DIR=\"$(IPSET_LIB_DIR)\" -c -o $@ $< ipset: ipset.o - $(CC) $(CFLAGS) -ldl -rdynamic -o $@ $^ + $(CC) $(CFLAGS) -rdynamic -o $@ $^ -ldl #Pooltypes -ipset_%.o: ipset_%.c +ipset_%.o: ipset_%.c ipset.h $(CC) $(SH_CFLAGS) -o $@ -c $< libipset_%.so: ipset_%.o |