# $Id$
+#
# Top level makefile for building ipfw kernel and userspace.
# You can run it manually or also under the Planetlab build.
# Planetlab wants also the 'install' target.
+#
+# To build on system with non standard Kernel sources or userland files,
+# you should run this with
+#
+# make KERNELPATH=/path/to/linux-2.x.y.z USRDIR=/path/to/usr
+#
+# We assume that $(USRDIR) contains include/ and lib/ used to build userland.
+
+DATE ?= $(shell date +%Y%m%d)
+SNAPSHOT_NAME=$(DATE)-ipfw3.tgz
+BINDIST=$(DATE)-dummynet-linux.tgz
+WINDIST=$(DATE)-dummynet-windows.zip
+
+###########################################
+# windows x86 and x64 specific variables #
+###########################################
+# DRIVE must be the hard drive letter where DDK is installed
+# DDKDIR must be the path to the DDK root directory, without drive letter
+# TARGETOS (x64 only) must be one of the following:
+# wnet -> windows server 2003
+# wlh -> windows vista and windows server 2008
+# win7 -> windows 7
+# future version must be added here
+export DDK
+export DRIVE
+export DDKDIR
+DRIVE = C:
+DDKDIR = /WinDDK/7600.16385.1
+DDK = $(DRIVE)$(DDKDIR)
+
+TARGETOS=win7
_all: all
-all clean distclean:
+clean distclean:
+ echo target is $(@)
+ (cd ipfw && $(MAKE) $(@) )
+ (cd dummynet2 && $(MAKE) $(@) )
+ # -- windows x64 only
+ - rm -rf dummynet2-64
+ - rm -rf ipfw-64
+ - rm -rf binary64
+
+all:
echo target is $(@)
(cd ipfw && $(MAKE) $(@) )
- (cd dummynet && $(MAKE) $(@) )
+ (cd dummynet2 && $(MAKE) $(@) )
+ # -- windows only
+ - [ -f ipfw/ipfw.exe ] && cp ipfw/ipfw.exe binary/ipfw.exe
+ - [ -f dummynet2/objchk_wxp_x86/i386/ipfw.sys ] && \
+ cp dummynet2/objchk_wxp_x86/i386/ipfw.sys binary/ipfw.sys
+
+snapshot:
+ $(MAKE) distclean
+ (cd ..; tar cvzhf /tmp/$(SNAPSHOT_NAME) --exclude .svn \
+ --exclude README.openwrt --exclude tags --exclude NOTES \
+ --exclude tcc-0.9.25-bsd \
+ --exclude original_passthru \
+ --exclude ipfw3.diff --exclude add_rules \
+ ipfw3 )
+
+bindist:
+ $(MAKE) clean
+ $(MAKE) all
+ tar cvzf /tmp/$(BINDIST) ipfw/ipfw ipfw/ipfw.8 dummynet2/ipfw_mod.ko
+
+windist:
+ $(MAKE) clean
+ -$(MAKE) all
+ -rm /tmp/$(WINDIST)
+ zip -r /tmp/$(WINDIST) binary -x \*.svn\*
+
+win64: clean
+ (cd dummynet2 && $(MAKE) include_e)
+ cp -r ipfw ipfw-64
+ echo "EXTRA_CFLAGS += -D_X64EMU" >> ipfw-64/Makefile
+ (cd ipfw-64 && $(MAKE) all)
+ cp -r dummynet2 dummynet2-64
+ rm -f dummynet2-64/Makefile
+ cp win64/sources dummynet2-64/sources
+ mkdir dummynet2-64/tmpbuild
+ mkdir binary64
+ win64/mysetenv.sh $(DRIVE) $(DDKDIR) $(TARGETOS)
+ cp binary/cygwin1.dll binary64/cygwin1.dll
+ cp ipfw-64/ipfw.exe binary64/ipfw.exe
+ cp win64/*.inf binary64
+ cp binary/testme.bat binary64/testme.bat
+ cp binary/wget.exe binary64/wget.exe
+
+planetlab_update:
+ # clean and create a local working directory
+ rm -rf /tmp/pl-tmp
+ mkdir -p /tmp/pl-tmp/pl
+ mkdir -p /tmp/pl-tmp/ol2
+ # get the trunk version of the PlanetLab repository
+ # to specify the sshkey use the .ssh/config file
+ (cd /tmp/pl-tmp/pl; \
+ svn co svn+ssh://svn.planet-lab.org/svn/ipfw/trunk)
+ # get an updated copy of the main ipfw repository
+ (cd /tmp/pl-tmp/ol2; \
+ svn export svn+ssh://onelab2.iet.unipi.it/home/svn/ports-luigi/dummynet-branches/ipfw3)
+ # copy the new version over the old one
+ (cd /tmp/pl-tmp; cp -rP ol2/ipfw3/* pl/trunk)
+ # files cleanup in the old version
+ (cd /tmp/pl-tmp; diff -r ol2/ipfw3 pl/trunk | \
+ grep -v "svn" | awk '{print $$3 $$4}' | \
+ sed 's/:/\//' | xargs rm -rf)
+ # local adjustmens here
+ rm -rf /tmp/pl-tmp/pl/trunk/planetlab/check_planetlab_sync
+ # commit to the remote repo
+ @echo "Please, revise the update with the commands:"
+ @echo "(cd /tmp/pl-tmp/pl/trunk; svn diff)"
+ @echo "(cd /tmp/pl-tmp/pl/trunk; svn status)"
+ @echo "and commit with:"
+ @echo "(cd /tmp/pl-tmp/pl/trunk; svn ci -m 'Update from the mail ipfw repo.')"
install: