Import source code for dummynet innode emulation.
[ipfw.git] / ipfw / Makefile
diff --git a/ipfw/Makefile b/ipfw/Makefile
new file mode 100644 (file)
index 0000000..5c3ba6a
--- /dev/null
@@ -0,0 +1,45 @@
+#
+# $Id$
+#
+# GNUMakefile to build the userland part of ipfw on Linux
+#
+# enable extra debugging information
+# Do not set with = or := so we can inherit from the caller
+$(warning Building userland ipfw for $(VER))
+EXTRA_CFLAGS += 
+EXTRA_CFLAGS += -O0 
+EXTRA_CFLAGS += -include ../glue.h
+
+LDFLAGS=
+
+EXTRA_CFLAGS += -I ./include
+
+ifneq ($(VER),openwrt)
+OSARCH := $(shell uname)
+ifeq ($(OSARCH),Linux)
+    EXTRA_CFLAGS += -D__BSD_VISIBLE
+else
+    HAVE_NAT := $(shell grep O_NAT /usr/include/netinet/ip_fw.h)
+    # EXTRA_CFLAGS += ...
+endif
+endif # !openwrt
+
+CFLAGS += $(EXTRA_CFLAGS)
+
+OBJS = ipfw2.o dummynet.o main.o ipv6.o altq.o
+ifneq ($(HAVE_NAT),)
+    OBJS += nat.o
+    EXTRA_CFLAGS += -DHAVE_NAT
+endif
+OBJS += glue.o
+
+all: ipfw
+       echo "VER is $(VER)"
+
+ipfw: $(OBJS)
+       $(CC) $(LDFLAGS) -o $@ $^
+
+$(OBJS) : ipfw2.h ../glue.h
+
+clean distclean:
+       -rm -f $(OBJS) ipfw