ifndef KERNEL_DIR
KERNEL_DIR=/usr/src/linux
endif
-NETFILTER_VERSION:=1.0.1
+NETFILTER_VERSION:=1.1.0
OLD_NETFILTER_VERSION:=1.0.0
LIBDIR:=/usr/local/lib
COPT_FLAGS:=-O #-O2
CFLAGS:=$(COPT_FLAGS) -Wall -Wunused -Iinclude/ -I$(KERNEL_DIR)/include -DNETFILTER_VERSION=\"$(NETFILTER_VERSION)\" -g #-pg # -DNDEBUG
-DEPFILES := $(SHARED_LIBS:%.so=%.d)
+DEPFILES = $(SHARED_LIBS:%.so=%.d)
SH_CFLAGS:=$(CFLAGS) -fPIC
-DEPFILES := $(SHARED_LIBS:%.so=%.d)
EXTRAS+=iptables iptables.o #iptables-save iptables-restore
EXTRA_INSTALLS+=$(DESTDIR)$(BINDIR)/iptables $(DESTDIR)$(MANDIR)/man8/iptables.8 #$(DESTDIR)$(BINDIR)/iptables-save $(DESTDIR)$(BINDIR)/iptables-restore
dep: $(DEPFILES) $(EXTRA_DEPENDS)
@echo Dependencies will be generated on next make.
- @rm -f $(DEPFILES) $(EXTRA_DEPENDS) .makefirst
+ rm -f $(DEPFILES) $(EXTRA_DEPENDS) .makefirst
$(SHARED_LIBS:%.so=%.d): %.d: %.c
@-$(CC) -M -MG $(CFLAGS) $< | \
- sed -e 's@^.*\.o:@$*.d $*.o:@' > $@
+ sed -e 's@^.*\.o:@$*.d $*_sh.o:@' > $@
$(SHARED_LIBS): %.so : %_sh.o
$(LD) -shared -o $@ $<
@echo Making dependencies: please wait...
@touch .makefirst
+# This is useful for when dependencies completely screwed
+%.h::
+ @echo Something wrong... deleting dependencies.
+ -rm -f $(DEPFILES) $(EXTRA_DEPENDS) .makefirst
+ @exit 1
+
-include $(DEPFILES) $(EXTRA_DEPENDS)
-include .makefirst