Makefile revision 255332
1223519Shselasky#
2223519Shselasky# Copyright (C) 2012 by Darren Reed.
3223519Shselasky#
4223519Shselasky# Redistribution and use in source and binary forms are permitted
5223519Shselasky# provided that this notice is preserved and due credit is given
6223519Shselasky# to the original author and the contributors.
7223519Shselasky#
8223519Shselasky# $FreeBSD: head/contrib/ipfilter/Makefile 255332 2013-09-06 23:11:19Z cy $
9223519Shselasky# Id: Makefile,v 2.76.2.24 2007/09/26 10:04:03 darrenr Exp $
10223519Shselasky#
11223519ShselaskySHELL=/bin/sh
12223519ShselaskyBINDEST=/usr/local/bin
13223519ShselaskySBINDEST=/sbin
14223519ShselaskyMANDIR=/usr/local/man
15223519Shselasky#To test prototyping
16233562ShselaskyCC=gcc -Wstrict-prototypes -Wmissing-prototypes -Wunused -Wuninitialized
17223519Shselasky#CC=gcc
18223519Shselasky#CC=cc -Dconst=
19223519ShselaskyDEBUG=-g
20223519Shselasky# -O
21223519ShselaskyCFLAGS=-I$$(TOP) -D_BSD_SOURCE
22223519ShselaskyCPU=`uname -m`
23223519ShselaskyCPUDIR=`uname -s|sed -e 's@/@@g'`-`uname -r`-`uname -m`
24223519ShselaskyOBJ=.
25223519Shselasky#
26223519Shselasky# To enable this to work as a Loadable Kernel Module...
27233562Shselasky#
28223519ShselaskyIPFLKM=-DIPFILTER_LKM
29223519Shselasky#
30223519Shselasky# To enable logging of blocked/passed packets...
31223519Shselasky#
32223519ShselaskyIPFLOG=-DIPFILTER_LOG
33223519Shselasky#
34223519Shselasky# To enable loading filter rules compiled to C code...
35223519Shselasky#
36223519Shselasky#COMPIPF=-DIPFILTER_COMPILED
37223519Shselasky#
38233562Shselasky# To enable IPFilter compatibility with older CLI utilities
39223519Shselasky#
40223519Shselasky#COMPATIPF=-DIPFILTER_COMPAT
41223519Shselasky#
42223519Shselasky# To enable synchronisation between IPFilter hosts
43223519Shselasky#
44223519Shselasky#SYNC=-DIPFILTER_SYNC
45223519Shselasky#
46223519Shselasky# The facility you wish to log messages from ipmon to syslogd with.
47223519Shselasky#
48223519ShselaskyLOGFAC=-DLOGFAC=LOG_SECURITY
49233562Shselasky#
50223519Shselasky# To enable rules to be written with BPF syntax, uncomment these two lines.
51223519Shselasky#
52223519Shselasky# WARNING: If you're building a commercial product based on IPFilter, using
53223519Shselasky#          this options *may* infringe at least one patent held by CheckPoint
54223519Shselasky#          (5,606,668.)
55223519Shselasky#
56223519Shselasky#IPFBPF=-DIPFILTER_BPF -I/usr/local/include
57233562Shselasky#LIBBPF=-L/usr/local/lib -lpcap
58223519Shselasky#
59223519Shselasky# HP-UX and Solaris require this uncommented for BPF.
60223519Shselasky#
61223519Shselasky#BPFILTER=bpf_filter.o
62223519Shselasky#
63223521Shselasky# LINUXKERNEL is the path to the top of your Linux kernel source tree.
64223521Shselasky# By default IPFilter looks for /usr/src/linux, but you may have to change
65233562Shselasky# it to /usr/src/linux-2.4 or similar.
66223521Shselasky#
67223521ShselaskyLINUXKERNEL=/usr/src/kernels/2.6.29.5-191.fc11.i586
68223521ShselaskyLINUX=`uname -r | awk -F. ' { printf"%d",$$1;for(i=1;i<NF&&i<3;i++){printf("%02d",$$(i+1));}}'`
69223521Shselasky#
70223521Shselasky#
71223519Shselasky#
72223519Shselasky#BUILDROOT=/usr/src/redhat/BUILD/ipfilter
73233562ShselaskyBUILDROOT=${HOME}/rpmbuild/BUILDROOT/ipfilter-4.1.32-1.i386
74223519Shselasky
75223519Shselasky#
76223519Shselasky# All of the compile-time options are here, used for compiling the userland
77223519Shselasky# tools for regression testing.  Well, all except for IPFILTER_LKM, of course.
78223519Shselasky#
79223519ShselaskyALLOPTS=-DIPFILTER_LOG -DIPFILTER_LOOKUP \
80223519Shselasky        -DIPFILTER_SYNC -DIPFILTER_CKSUM
81233562Shselasky
82223519Shselasky#
83223519Shselasky# Uncomment the next 3 lines if you want to view the state table a la top(1)
84223519Shselasky# (requires that you have installed ncurses).
85223519Shselasky#STATETOP_CFLAGS=-DSTATETOP
86223519Shselasky#
87223519Shselasky# Where to find the ncurses include files (if not in default path),
88223536Shselasky#
89233562Shselasky#STATETOP_INC=
90223519Shselasky#STATETOP_INC=-I/usr/local/include
91223519Shselasky#
92223519Shselasky# How to link the ncurses library
93223519Shselasky#
94223519Shselasky#STATETOP_LIB=-lncurses
95223536Shselasky#STATETOP_LIB=-L/usr/local/lib -lncurses
96223536Shselasky
97233562Shselasky#
98223536Shselasky# Uncomment this when building IPv6 capability.
99223536Shselasky#
100223536ShselaskyINET6=-DUSE_INET6
101223536Shselasky#
102223536Shselasky# For packets which don't match any pass rules or any block rules, set either
103223536Shselasky# FR_PASS or FR_BLOCK (respectively).  It defaults to FR_PASS if left
104223536Shselasky# undefined.  This is ignored for ipftest, which can thus return three
105233562Shselasky# results: pass, block and nomatch.  This is the sort of "block unless
106223536Shselasky# explicitly allowed" type #define switch.
107223536Shselasky#
108223536ShselaskyPOLICY=-DIPF_DEFAULT_PASS=FR_PASS
109223536Shselasky#
110223536ShselaskyMFLAGS1='CFLAGS=$(CFLAGS) $(ARCHINC) $(SOLARIS2) $(SGIREV) $(INET6)' \
111223536Shselasky	"IPFLOG=$(IPFLOG)" "LOGFAC=$(LOGFAC)" "POLICY=$(POLICY)" \
112223536Shselasky	"SOLARIS2=$(SOLARIS2)" "DEBUG=$(DEBUG)" "DCPU=$(CPU)" \
113233562Shselasky        "LIBBPF=$(LIBBPF)" "CPUDIR=$(CPUDIR)" "IPFBPF=$(IPFBPF)" \
114223536Shselasky        'STATETOP_CFLAGS=$(STATETOP_CFLAGS)' "BPFILTER=$(BPFILTER)" \
115223536Shselasky        'STATETOP_INC=$(STATETOP_INC)' 'STATETOP_LIB=$(STATETOP_LIB)' \
116223536Shselasky	"BITS=$(BITS)" "OBJ=$(OBJ)" "LOOKUP=$(LOOKUP)" "COMPIPF=$(COMPIPF)" \
117223536Shselasky	"COMPATIPF=$(COMPATIPF)" \
118223536Shselasky	'SYNC=$(SYNC)' 'ALLOPTS=$(ALLOPTS)' 'LIBBPF=$(LIBBPF)'
119223536ShselaskyMFLAGS=$(MFLAGS1) "IPFLKM=$(IPFLKM)"
120223536ShselaskyMACHASSERT=`/bin/ls -1 /usr/sys/*/mach_assert.h | head -1`
121233562Shselasky#
122223536ShselaskySHELL=/bin/sh
123223536Shselasky#
124223536Shselasky########## ########## ########## ########## ########## ########## ##########
125223536Shselasky#
126223536ShselaskyCP=/bin/cp
127223536ShselaskyRM=/bin/rm
128223536ShselaskyCHMOD=/bin/chmod
129233562ShselaskyINSTALL=install
130223536Shselasky#
131223536Shselasky
132223536Shselaskyall:
133223536Shselasky	@echo "Chose one of the following targets for making IP filter:"
134223536Shselasky	@echo ""
135223536Shselasky	@echo "solaris	- auto-selects SunOS4.1.x/Solaris 2.3-6/Solaris2.4-6x86"
136223536Shselasky	@echo "netbsd	- compile for NetBSD"
137233562Shselasky	@echo "openbsd	- compile for OpenBSD"
138223536Shselasky	@echo "freebsd20	- compile for FreeBSD 2.0, 2.1 or earlier"
139223536Shselasky	@echo "freebsd22	- compile for FreeBSD-2.2 or greater"
140223536Shselasky	@echo "freebsd  - compile for all other versions of FreeBSD"
141223536Shselasky	@echo "bsd	- compile for generic 4.4BSD systems"
142223536Shselasky	@echo "bsdi	- compile for BSD/OS"
143223536Shselasky	@echo "irix	- compile for SGI IRIX"
144223536Shselasky	@echo "hpux	- compile for HP-UX 11.00"
145233562Shselasky	@echo "osf	- compile for OSF/Tru64 5.1"
146223536Shselasky	@echo ""
147223536Shselasky
148223536Shselaskytests:
149223536Shselasky	@if [ -d test ]; then (cd test; make) \
150223536Shselasky	else echo test directory not present, sorry; fi
151223519Shselasky
152223519Shselaskyretest:
153233562Shselasky	@if [ -d test ]; then (cd test; make clean && make) \
154223519Shselasky	else echo test directory not present, sorry; fi
155223519Shselasky
156223519Shselaskyinclude:
157223519Shselasky	-mkdir -p net netinet
158223519Shselasky	if [ ! -f netinet/done ] ; then \
159223519Shselasky		(cd netinet; ln -s ../*.h .; ln -s ../ip_*_pxy.c .;); \
160231638Shselasky		(cd netinet; ln -s ../ipsend/tcpip.h tcpip.h); \
161233562Shselasky		touch netinet/done; \
162223519Shselasky	fi
163223519Shselasky	-(cd netinet; ln -s ../ip_rules.h ip_rules.h)
164223519Shselasky
165223519Shselaskysunos solaris: include
166223519Shselasky	MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" BPFILTER=$(BPFILTER) \
167223519Shselasky		CC="$(CC)" DEBUG="$(DEBUG)" ./buildsunos
168223536Shselasky
169233562Shselaskyfreebsd:
170223519Shselasky	make freebsd`uname -r|cut -c1`
171223519Shselasky
172223519Shselaskyfreebsd22: include
173223519Shselasky	make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
174223519Shselasky	-rm -f BSD/$(CPUDIR)/ioconf.h
175223536Shselasky	-if [ x$(IPFILKERN) != x ] ; then \
176223536Shselasky		if [ -f /sys/compile/$(IPFILKERN)/ioconf.h ] ; then \
177233562Shselasky			ln -s /sys/compile/$(IPFILKERN)/ioconf.h BSD/$$y; \
178223536Shselasky		else \
179223536Shselasky			ln -s /sys/$(IPFILKERN)/ioconf.h BSD/$$y; \
180223536Shselasky		fi \
181223536Shselasky	else \
182223536Shselasky		x=`uname -v|sed -e 's@^.*:\(/[^: ]*\).*$$@\1/ioconf.h@'`; \
183223519Shselasky		y=`uname -s|sed -e 's@/@@g'`-`uname -r`-`uname -m`; \
184223519Shselasky		if [ ! -f $$x ] ; then \
185233562Shselasky			echo -n "Can't find ioconf.h at $$x "; \
186223519Shselasky			exit 1;\
187223519Shselasky		else \
188223519Shselasky			ln -s $$x BSD/$$y ; \
189223519Shselasky		fi \
190223519Shselasky	fi
191223519Shselasky	make freebsd20
192223536Shselasky
193233562Shselaskyfreebsd5 freebsd6 freebsd7 freebsd8: include
194223519Shselasky	if [ x$(INET6) = x ] ; then \
195223519Shselasky		echo "#undef INET6" > opt_inet6.h; \
196223519Shselasky	else \
197223519Shselasky		echo "#define INET6" > opt_inet6.h; \
198223519Shselasky	fi
199223536Shselasky	if [ "x$(IPFBPF)" = "x" ] ; then \
200223536Shselasky		echo "#undef NBPF" > opt_bpf.h; \
201233562Shselasky		echo "#undef NBPFILTER" > opt_bpf.h; \
202223536Shselasky		echo "#undef DEV_BPF" > opt_bpf.h; \
203223536Shselasky	else \
204223536Shselasky		echo "#define NBPF" > opt_bpf.h; \
205223536Shselasky		echo "#define NBPFILTER" > opt_bpf.h; \
206223536Shselasky		echo "#define DEV_BPF" > opt_bpf.h; \
207223536Shselasky	fi
208223536Shselasky	if [ x$(ENABLE_PFIL) = x ] ; then \
209233562Shselasky		echo "#undef PFIL_HOOKS" > opt_pfil.h; \
210223536Shselasky	else \
211223536Shselasky		echo "#define PFIL_HOOKS" > opt_pfil.h; \
212223536Shselasky	fi
213223536Shselasky
214223536Shselasky	make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
215223536Shselasky	(cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS) "ML=mlfk_ipl.c" "MLD=mlfk_ipl.c" "LKM=ipf.ko.5" "LKMR=ipfrule.ko.5" "DLKM=-DKLD_MODULE" "MLR=mlfk_rule.o"; cd ..)
216223536Shselasky#	(cd BSD/$(CPUDIR); make -f Makefile.ipsend build TOP=../.. $(MFLAGS1); cd ..)
217233562Shselasky
218223536Shselaskyfreebsd4 : include
219223536Shselasky	if [ x$(INET6) = x ] ; then \
220223536Shselasky		echo "#undef INET6" > opt_inet6.h; \
221223536Shselasky	else \
222223536Shselasky		echo "#define INET6" > opt_inet6.h; \
223223536Shselasky	fi
224223536Shselasky	make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
225233562Shselasky	(cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS) "ML=mlfk_ipl.c" "MLD=mlfk_ipl.c" "LKM=ipf.ko" "LKMR=ipfrule.ko" "DLKM=-DKLD_MODULE" "MLR=mlfk_rule.o"; cd ..)
226223536Shselasky	(cd BSD/$(CPUDIR); make -f Makefile.ipsend build TOP=../.. $(MFLAGS1); cd ..)
227223536Shselasky
228223536Shselaskyfreebsd3 freebsd30: include
229223536Shselasky	make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
230223536Shselasky	(cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS1) "ML=mlf_ipl.c" "MLR=mlf_rule.o" LKM= LKMR=; cd ..)
231223536Shselasky	(cd BSD/$(CPUDIR); make -f Makefile.ipsend build TOP=../.. $(MFLAGS1); cd ..)
232223536Shselasky
233233562Shselaskynetbsd: include
234223536Shselasky	make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
235223536Shselasky	@if [ ! -d /sys -o ! -d /sys/arch ] ; then \
236223536Shselasky		echo "*****************************************************"; \
237223536Shselasky		echo "*                                                   *"; \
238223536Shselasky		echo "* Please extract source code to create /sys and     *";\
239223536Shselasky		echo "* /sys/arch and run 'config GENERIC'                *"; \
240223536Shselasky		echo "*                                                   *"; \
241233562Shselasky		echo "*****************************************************"; \
242223536Shselasky		exit 1; \
243223536Shselasky	fi
244223536Shselasky	(cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS) 'DLKM=-D_LKM' "ML=mln_ipl.c" LKMR= "MLR=mln_rule.o"; cd ..)
245223536Shselasky#	(cd BSD/$(CPUDIR); make -f Makefile.ipsend build TOP=../.. $(MFLAGS); cd ..)
246223536Shselasky
247223536Shselaskyopenbsd: include
248223536Shselasky	make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
249233562Shselasky	(cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS) 'DLKM=-D_LKM' "ML=mlo_ipl.c" LKMR= "MLR=mlo_rule.o"; cd ..)
250223536Shselasky	(cd BSD/$(CPUDIR); make -f Makefile.ipsend build TOP=../.. $(MFLAGS); cd ..)
251223536Shselasky
252223536Shselaskyfreebsd20 freebsd21: include
253223536Shselasky	make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
254223536Shselasky	(cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS) "ML=mlf_ipl.c" "MLR=mlf_rule.o"; cd ..)
255223536Shselasky	(cd BSD/$(CPUDIR); make -f Makefile.ipsend build TOP=../.. $(MFLAGS); cd ..)
256223536Shselasky
257233562Shselaskyosf tru64: null include
258223536Shselasky	make setup "TARGOS=OSF" "CPUDIR=`OSF/cpurev`"
259223536Shselasky	(cd OSF/`OSF/cpurev`; make build TRU64=`uname -v` TOP=../.. "DEBUG=-g" $(MFLAGS) "MACHASSERT=$(MACHASSERT)" "OSREV=`../cpurev`"; cd ..)
260223536Shselasky	(cd OSF/`OSF/cpurev`; make -f Makefile.ipsend build TRU64=`uname -v` TOP=../.. $(MFLAGS) "OSREV=`../cpurev`"; cd ..)
261223536Shselasky
262223536Shselaskyaix: null include
263223536Shselasky	make setup "TARGOS=AIX" "CPUDIR=`AIX/cpurev`"
264223536Shselasky	(cd AIX/`AIX/cpurev`; make build AIX=`uname -v` TOP=../.. "DEBUG=-g" $(MFLAGS) "OSREV=`../cpurev`" BITS=`../bootbits.sh`; cd ..)
265233562Shselasky#	(cd AIX/`AIX/cpurev`; make -f Makefile.ipsend build AIX=`uname -v` TOP=../.. $(MFLAGS) "OSREV=`../cpurev`"; cd ..)
266223536Shselasky
267223536Shselaskybsd: include
268223536Shselasky	make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
269223536Shselasky	(cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS) 'DLKM=-D_LKM' "ML=mln_ipl.c" "MLR=mln_rule.o"; cd ..)
270223536Shselasky	(cd BSD/$(CPUDIR); make -f Makefile.ipsend build TOP=../.. $(MFLAGS); cd ..)
271223536Shselasky
272223536Shselaskybsdi bsdos: include
273233562Shselasky	make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
274223536Shselasky	(cd BSD/$(CPUDIR); make build "CC=$(CC)" TOP=../.. $(MFLAGS) LKM= LKMR= ; cd ..)
275223536Shselasky	(cd BSD/$(CPUDIR); make -f Makefile.ipsend build "CC=$(CC)" TOP=../.. $(MFLAGS); cd ..)
276223536Shselasky
277223536Shselaskyirix IRIX: include
278223536Shselasky	make setup TARGOS=IRIX CPUDIR=`IRIX/cpurev`
279223536Shselasky	if [ "x${SGIREV}" = "x" ] ; then \
280223536Shselasky		make irix "SGIREV=-D_KMEMUSER -DIRIX=`IRIX/getrev`"; \
281233562Shselasky	else \
282223536Shselasky		(cd IRIX/`IRIX/cpurev`; smake -l -J 1 build TOP=../.. $(DEST) $(MFLAGS) IRIX=`../getrev` SGI=$$(IRIX) CPUDIR=`../cpurev`; cd ..); \
283223536Shselasky		(cd IRIX/`IRIX/cpurev`; make -f Makefile.ipsend build TOP=../.. $(DEST) $(MFLAGS) IRIX=`../getrev` SGI=$$(IRIX) CPUDIR=`../cpurev`; cd ..); \
284223536Shselasky	fi
285223536Shselasky
286223536Shselaskysetup:
287223536Shselasky	-if [ ! -d $(TARGOS)/$(CPUDIR) ] ; then mkdir $(TARGOS)/$(CPUDIR); fi
288223536Shselasky	-rm -f $(TARGOS)/$(CPUDIR)/Makefile $(TARGOS)/$(CPUDIR)/Makefile.ipsend
289233562Shselasky	-ln -s ../Makefile $(TARGOS)/$(CPUDIR)/Makefile
290223536Shselasky	-ln -s ../Makefile.ipsend $(TARGOS)/$(CPUDIR)/Makefile.ipsend
291223536Shselasky	-if [ -f $(TARGOS)/Makefile.common ] ; then \
292223536Shselasky		rm -f $(TARGOS)/$(CPUDIR)/Makefile.common; \
293223536Shselasky		ln -s ../Makefile.common $(TARGOS)/$(CPUDIR)/Makefile.common;\
294223536Shselasky	fi
295223536Shselasky
296231638Shselaskyclean: clean-include
297233562Shselasky	/bin/rm -rf h y.output
298223536Shselasky	${RM} -f core *.o ipt fils ipf ipfstat ipftest ipmon if_ipl ipflkm \
299223536Shselasky	vnode_if.h $(LKM) *~
300223536Shselasky	/bin/rm -rf sparcv7 sparcv9 mdbgen_build
301223536Shselasky	(cd SunOS4; $(MAKE) TOP=.. clean)
302223536Shselasky	-(cd SunOS5; $(MAKE) TOP=.. clean)
303223519Shselasky	(cd BSD; $(MAKE) TOP=.. clean)
304223519Shselasky	(cd HPUX; $(MAKE) BITS=32 TOP=.. clean)
305233562Shselasky	(cd Linux; $(MAKE) TOP=.. clean)
306223519Shselasky	(cd OSF; $(MAKE) TOP=.. clean)
307223519Shselasky	(cd AIX; $(MAKE) TOP=.. clean)
308223519Shselasky	if [ "`uname -s`" = "IRIX" ]; then (cd IRIX; $(MAKE) clean); fi
309223519Shselasky	[ -d test ] && (cd test; $(MAKE) clean)
310223519Shselasky	(cd ipsend; $(MAKE) clean)
311223519Shselasky
312223519Shselaskyclean-include:
313233562Shselasky	sh -c 'if [ -d netinet ] ; then cd netinet; for i in *; do if [ -h $$i ] ; then /bin/rm -f $$i; fi; done fi'
314223519Shselasky	sh -c 'if [ -d net ] ; then cd net; for i in *; do if [ -h $$i ] ; then /bin/rm -f $$i; fi; done fi'
315223519Shselasky	${RM} -f netinet/done net/done
316223519Shselasky
317223519Shselaskyclean-bsd: clean-include
318223519Shselasky	(cd BSD; make TOP=.. clean)
319223519Shselasky
320223519Shselaskyclean-hpux: clean-include
321233562Shselasky	(cd HPUX; $(MAKE) BITS=32 clean)
322223519Shselasky
323223519Shselaskyclean-osf: clean-include
324223519Shselasky	(cd OSF; make clean)
325223519Shselasky
326223519Shselaskyclean-aix: clean-include
327223519Shselasky	(cd AIX; make clean)
328223519Shselasky
329233562Shselaskyclean-linux: clean-include
330223519Shselasky	(cd Linux; make clean)
331223519Shselasky
332223519Shselaskyclean-sunos4: clean-include
333223519Shselasky	(cd SunOS4; make clean)
334223519Shselasky
335223519Shselaskyclean-sunos5: clean-include
336223519Shselasky	(cd SunOS5; $(MAKE) clean)
337233562Shselasky	/bin/rm -rf sparcv?
338223519Shselasky
339223519Shselaskyclean-irix: clean-include
340223519Shselasky	(cd IRIX; $(MAKE) clean)
341223519Shselasky
342223519Shselaskyh/xti.h:
343223519Shselasky	mkdir -p h
344223536Shselasky	ln -s /usr/include/sys/xti.h h
345233562Shselasky
346223519Shselaskyhpux: include h/xti.h
347223519Shselasky	make setup CPUDIR=`HPUX/cpurev` TARGOS=HPUX
348223519Shselasky	(cd HPUX/`HPUX/cpurev`; $(MAKE) build TOP=../.. $(DEST) $(MFLAGS) "BITS=`getconf KERNEL_BITS`" `../makeargs`; cd ..)
349223519Shselasky	(cd HPUX/`HPUX/cpurev`; $(MAKE) -f Makefile.ipsend build TOP=../.. $(DEST) $(MFLAGS) "BITS=`getconf KERNEL_BITS`" `../makeargs`; cd ..)
350223519Shselasky
351223536Shselaskysunos4 solaris1:
352223536Shselasky	(cd SunOS4; make build TOP=.. "CC=$(CC)" $(DEST) $(MFLAGS); cd ..)
353233562Shselasky	(cd SunOS4; make -f Makefile.ipsend build "CC=$(CC)" TOP=.. $(DEST) $(MFLAGS); cd ..)
354223536Shselasky
355223536Shselaskysunos5 solaris2: null
356223536Shselasky	(cd SunOS5/$(CPUDIR); $(MAKE) build TOP=../.. "CC=$(CC)" $(DEST) $(MFLAGS) "SOLARIS2=$(SOLARIS2)" INSTANCE=$(INSTANCE); cd ..)
357223536Shselasky	(cd SunOS5/$(CPUDIR); $(MAKE) -f Makefile.ipsend build TOP=../.. "CC=$(CC)" $(DEST) $(MFLAGS); cd ..)
358223536Shselasky
359223536Shselaskylinux: include
360223536Shselasky	(cd Linux; make build LINUX=$(LINUX) TOP=.. "DEBUG=-g" "CC=$(CC)" $(MFLAGS) OBJ=$(CPUDIR) LINUXKERNEL=$(LINUXKERNEL); cd ..)
361233562Shselasky	(cd Linux; make ipflkm LINUX=$(LINUX) TOP=.. "DEBUG=-g" "CC=$(CC)" $(MFLAGS) OBJ=$(CPUDIR) LINUXKERNEL=$(LINUXKERNEL) WORKDIR=`pwd`; cd ..)
362223536Shselasky#	(cd Linux; make -f Makefile.ipsend build LINUX=$(LINUX) TOP=.. "CC=$(CC)" $(MFLAGS); cd ..)
363223536Shselasky
364223536Shselaskyinstall-linux: linux
365223536Shselasky	(cd Linux/; make LINUX=$(LINUX) TOP=.. "DEBUG=-g" "CC=$(CC)" $(MFLAGS) OBJ=$(CPUDIR) ROOTDIR=$(BUILDROOT) install ; cd ..)
366223536Shselasky
367223519Shselaskyinstall-bsd:
368223536Shselasky	(cd BSD/$(CPUDIR); make install "TOP=../.." $(MFLAGS); cd ..)
369233562Shselasky	(cd BSD/$(CPUDIR); make -f Makefile.ipsend INSTALL=$(INSTALL) install "TOP=../.." $(MFLAGS); cd ..)
370223519Shselasky
371223519Shselaskyinstall-sunos4: solaris
372223519Shselasky	(cd SunOS4; $(MAKE) CPU=$(CPU) TOP=.. install)
373223519Shselasky
374223519Shselaskyinstall-sunos5: solaris null
375223536Shselasky	(cd SunOS5; $(MAKE) TOP=.. install)
376223536Shselasky
377233562Shselaskyinstall-aix:
378223536Shselasky	(cd AIX/`AIX/cpurev`; make install "TOP=../.." $(MFLAGS); cd ..)
379223536Shselasky#	(cd AIX/`AIX/cpurev`; make -f Makefile.ipsend INSTALL=$(INSTALL) install "TOP=../.." $(MFLAGS); cd ..)
380223536Shselasky
381223536Shselaskyinstall-hpux: hpux
382223536Shselasky	(cd HPUX/`HPUX/cpurev`; $(MAKE) CPU=$(CPU) TOP=../.. "BITS=`getconf KERNEL_BITS`" install)
383223536Shselasky
384223536Shselaskyinstall-irix: irix
385233562Shselasky	(cd IRIX; smake install CPU=$(CPU) TOP=.. $(DEST) $(MFLAGS) CPUDIR=`./cpurev`)
386223536Shselasky
387223536Shselaskyinstall-osf install-tru64:
388223536Shselasky	(cd OSF/`OSF/cpurev`; make install "TOP=../.." $(MFLAGS); cd ..)
389223536Shselasky
390223536Shselaskydo-cvs:
391223519Shselasky	find . -type d -name CVS -print | xargs /bin/rm -rf
392223519Shselasky	find . -type f -name .cvsignore -print | xargs /bin/rm -f
393233562Shselasky	/bin/rm -f ip_msnrpc_pxy.c ip_sunrpc_pxy.c
394223519Shselasky
395223519Shselaskyip_rules.c ip_rules.h: rules/ip_rules tools/ipfcomp.c
396223519Shselasky	-./ipf -n -cc -f rules/ip_rules 2>/dev/null 1>&2
397223519Shselasky
398223519Shselaskynull:
399223519Shselasky	@if [ "`$(MAKE) -v 2>&1 | sed -ne 's/GNU.*/GNU/p'`" = "GNU" ] ; then \
400223519Shselasky		echo 'Do not use GNU make (gmake) to compile IPFilter'; \
401233562Shselasky		exit 1; \
402223519Shselasky	fi
403223519Shselasky	-@echo make ok
404223519Shselasky
405223519Shselaskymdb:
406223519Shselasky	/bin/rm -rf mdbgen_build
407223519Shselasky	mdbgen -D_KERNEL -DIPFILTER_LOG -DIPFILTER_LOOKUP -DSUNDDI \
408223536Shselasky	       -DIPFILTER_SCAN -DIPFILTER_LKM -DSOLARIS2=10 -n ipf_mdb -k \
409233562Shselasky	       -I/home/dr146992/pfil -I/home/dr146992/ipf -f \
410223519Shselasky	       /usr/include/netinet/in_systm.h,/usr/include/sys/ethernet.h,/usr/include/netinet/in.h,/usr/include/netinet/ip.h,/usr/include/netinet/ip_var.h,/usr/include/netinet/tcp.h,/usr/include/netinet/tcpip.h,/usr/include/netinet/ip_icmp.h,/usr/include/netinet/udp.h,ip_compat.h,ip_fil.h,ip_nat.h,ip_state.h,ip_proxy.h,ip_scan.h
411223519Shselasky