3 # Top level makefile for building ipfw kernel and userspace.
4 # You can run it manually or also under the Planetlab build.
5 # Planetlab wants also the 'install' target.
7 # To build on system with non standard Kernel sources or userland files,
8 # you should run this with
10 # make KERNELPATH=/path/to/linux-2.x.y.z USRDIR=/path/to/usr
12 # We assume that $(USRDIR) contains include/ and lib/ used to build userland.
14 DATE ?= $(shell date +%Y%m%d)
15 SNAPSHOT_NAME=$(DATE)-ipfw3.tgz
16 BINDIST=$(DATE)-dummynet-linux.tgz
17 WINDIST=$(DATE)-dummynet-windows.zip
19 ###########################################
20 # windows x86 and x64 specific variables #
21 ###########################################
22 # DRIVE must be the hard drive letter where DDK is installed
23 # DDKDIR must be the path to the DDK root directory, without drive letter
24 # TARGETOS (x64 only) must be one of the following:
25 # wnet -> windows server 2003
26 # wlh -> windows vista and windows server 2008
28 # future version must be added here
33 DDKDIR = /WinDDK/7600.16385.1
34 DDK = $(DRIVE)$(DDKDIR)
42 (cd ipfw && $(MAKE) $(@) )
43 (cd dummynet2 && $(MAKE) $(@) )
51 (cd ipfw && $(MAKE) $(@) )
52 (cd dummynet2 && $(MAKE) $(@) )
54 - [ -f ipfw/ipfw.exe ] && cp ipfw/ipfw.exe binary/ipfw.exe
55 - [ -f dummynet2/objchk_wxp_x86/i386/ipfw.sys ] && \
56 cp dummynet2/objchk_wxp_x86/i386/ipfw.sys binary/ipfw.sys
60 (cd ..; tar cvzhf /tmp/$(SNAPSHOT_NAME) --exclude .svn \
61 --exclude README.openwrt --exclude tags --exclude NOTES \
62 --exclude tcc-0.9.25-bsd \
63 --exclude original_passthru \
64 --exclude ipfw3.diff --exclude add_rules \
70 tar cvzf /tmp/$(BINDIST) ipfw/ipfw ipfw/ipfw.8 dummynet2/ipfw_mod.ko
76 zip -r /tmp/$(WINDIST) binary -x \*.svn\*
79 (cd dummynet2 && $(MAKE) include_e)
81 echo "EXTRA_CFLAGS += -D_X64EMU" >> ipfw-64/Makefile
82 (cd ipfw-64 && $(MAKE) all)
83 cp -r dummynet2 dummynet2-64
84 rm -f dummynet2-64/Makefile
85 cp win64/sources dummynet2-64/sources
86 mkdir dummynet2-64/tmpbuild
88 win64/mysetenv.sh $(DRIVE) $(DDKDIR) $(TARGETOS)
89 cp binary/cygwin1.dll binary64/cygwin1.dll
90 cp ipfw-64/ipfw.exe binary64/ipfw.exe
91 cp win64/*.inf binary64
92 cp binary/testme.bat binary64/testme.bat
93 cp binary/wget.exe binary64/wget.exe
96 # clean and create a local working directory
98 mkdir -p /tmp/pl-tmp/pl
99 mkdir -p /tmp/pl-tmp/ol2
100 # get the trunk version of the PlanetLab repository
101 # to specify the sshkey use the .ssh/config file
102 (cd /tmp/pl-tmp/pl; \
103 svn co svn+ssh://svn.planet-lab.org/svn/ipfw/trunk)
104 # get an updated copy of the main ipfw repository
105 (cd /tmp/pl-tmp/ol2; \
106 svn export svn+ssh://onelab2.iet.unipi.it/home/svn/ports-luigi/dummynet-branches/ipfw3)
107 # copy the new version over the old one
108 (cd /tmp/pl-tmp; cp -rP ol2/ipfw3/* pl/trunk)
109 # files cleanup in the old version
110 (cd /tmp/pl-tmp; diff -r ol2/ipfw3 pl/trunk | \
111 grep -v "svn" | awk '{print $$3 $$4}' | \
112 sed 's/:/\//' | xargs rm -rf)
113 # local adjustmens here
114 rm -rf /tmp/pl-tmp/pl/trunk/planetlab/check_planetlab_sync
115 # commit to the remote repo
116 @echo "Please, revise the update with the commands:"
117 @echo "(cd /tmp/pl-tmp/pl/trunk; svn diff)"
118 @echo "(cd /tmp/pl-tmp/pl/trunk; svn status)"
119 @echo "and commit with:"
120 @echo "(cd /tmp/pl-tmp/pl/trunk; svn ci -m 'Update from the mail ipfw repo.')"