3 IPSET_LIB_DIR:=$(LIBDIR)/ipset
5 IPSET_CFLAGS:=# -g -DIPSET_DEBUG #-pg # -DIPTC_DEBUG
6 SETTYPES:=ipmap portmap macipmap iphash nethash iptree iptreemap ipporthash
8 # for building on fedora 8
9 ifneq "$(shell ld --help | grep build-id)" ""
10 #not needed# CFLAGS += -Wl,--build-id
14 ifneq ($(wildcard $(KERNEL_DIR)/include/linux/netfilter_ipv4/ip_set.h),)
17 EXTRAS+=$(foreach T, $(SETTYPES),ipset/libipset_$(T).so)
18 EXTRA_INSTALLS+=$(DESTDIR)$(BINDIR)/ipset $(DESTDIR)$(MANDIR)/man8/ipset.8
19 EXTRA_INSTALLS+=$(foreach T, $(SETTYPES), $(DESTDIR)$(LIBDIR)/ipset/libipset_$(T).so)
22 ipset/libipset.d: $(foreach T, $(SETTYPES),ipset/ipset_$(T).c)
23 @-$(CC) -M -MG $(CFLAGS) $(IPSET_CFLAGS) $^ | sed -e 's@^.*\.o:@$*.d $*.a($*.o):@' > $@
26 ipset/ipset.o: ipset/ipset.c
27 $(CC) $(CFLAGS) $(IPSET_CFLAGS) -DIPSET_VERSION=\"$(IPSET_VERSION)\" -DIPSET_LIB_DIR=\"$(IPSET_LIB_DIR)\" -c -o $@ $<
29 ipset/ipset: ipset/ipset.o
30 $(CC) $(CFLAGS) $(IPSET_CFLAGS) -ldl -rdynamic -o $@ $^
33 ipset/ipset_%.o: ipset/ipset_%.c
34 $(CC) $(SH_CFLAGS) $(IPSET_CFLAGS) -o $@ -c $<
36 ipset/libipset_%.so: ipset/ipset_%.o
37 $(CC) -shared -o $@ $<
39 $(DESTDIR)$(LIBDIR)/ipset/libipset_%.so: ipset/libipset_%.so
40 @[ -d $(DESTDIR)$(LIBDIR)/ipset ] || mkdir -p $(DESTDIR)$(LIBDIR)/ipset
43 $(DESTDIR)$(BINDIR)/ipset: ipset/ipset
44 @[ -d $(DESTDIR)$(BINDIR) ] || mkdir -p $(DESTDIR)$(BINDIR)
47 $(DESTDIR)$(MANDIR)/man8/ipset.8: ipset/ipset.8
48 @[ -d $(DESTDIR)$(MANDIR)/man8 ] || mkdir -p $(DESTDIR)$(MANDIR)/man8