1997-02-09 22:50:16 +00:00
|
|
|
#
|
2001-07-28 11:59:33 +00:00
|
|
|
# Copyright (C) 1993-2001 by Darren Reed.
|
1997-02-09 22:50:16 +00:00
|
|
|
#
|
2005-04-25 18:20:15 +00:00
|
|
|
# Redistribution and use in source and binary forms are permitted
|
|
|
|
# provided that this notice is preserved and due credit is given
|
|
|
|
# to the original author and the contributors.
|
1997-02-09 22:50:16 +00:00
|
|
|
#
|
2003-04-05 09:25:19 +00:00
|
|
|
# $FreeBSD$
|
2007-10-18 21:52:14 +00:00
|
|
|
# Id: Makefile,v 2.76.2.24 2007/09/26 10:04:03 darrenr Exp $
|
1997-02-09 22:50:16 +00:00
|
|
|
#
|
2005-04-25 18:20:15 +00:00
|
|
|
SHELL=/bin/sh
|
1997-05-25 15:45:04 +00:00
|
|
|
BINDEST=/usr/local/bin
|
|
|
|
SBINDEST=/sbin
|
|
|
|
MANDIR=/usr/local/man
|
1997-04-03 10:22:02 +00:00
|
|
|
#To test prototyping
|
2005-04-25 18:20:15 +00:00
|
|
|
#CC=gcc -Wstrict-prototypes -Wmissing-prototypes
|
|
|
|
# -Wunused -Wuninitialized
|
1999-11-08 20:51:23 +00:00
|
|
|
#CC=gcc
|
1998-03-21 10:04:55 +00:00
|
|
|
#CC=cc -Dconst=
|
1997-02-09 22:50:16 +00:00
|
|
|
DEBUG=-g
|
2005-04-25 18:20:15 +00:00
|
|
|
# -O
|
|
|
|
CFLAGS=-I$$(TOP) -D_BSD_SOURCE
|
1997-04-03 10:22:02 +00:00
|
|
|
CPU=`uname -m`
|
1997-11-16 04:52:19 +00:00
|
|
|
CPUDIR=`uname -s|sed -e 's@/@@g'`-`uname -r`-`uname -m`
|
2005-04-25 18:20:15 +00:00
|
|
|
OBJ=.
|
1997-02-09 22:50:16 +00:00
|
|
|
#
|
|
|
|
# To enable this to work as a Loadable Kernel Module...
|
|
|
|
#
|
|
|
|
IPFLKM=-DIPFILTER_LKM
|
|
|
|
#
|
|
|
|
# To enable logging of blocked/passed packets...
|
|
|
|
#
|
|
|
|
IPFLOG=-DIPFILTER_LOG
|
|
|
|
#
|
2005-04-25 18:20:15 +00:00
|
|
|
# To enable loading filter rules compiled to C code...
|
|
|
|
#
|
|
|
|
#COMPIPF=-DIPFILTER_COMPILED
|
|
|
|
#
|
|
|
|
# To enable synchronisation between IPFilter hosts
|
|
|
|
#
|
|
|
|
#SYNC=-DIPFILTER_SYNC
|
|
|
|
#
|
|
|
|
# To enable extended IPFilter functionality
|
|
|
|
#
|
|
|
|
LOOKUP=-DIPFILTER_LOOKUP -DIPFILTER_SCAN
|
|
|
|
#
|
1997-02-09 22:50:16 +00:00
|
|
|
# The facility you wish to log messages from ipmon to syslogd with.
|
|
|
|
#
|
2003-04-05 09:25:19 +00:00
|
|
|
LOGFAC=-DLOGFAC=LOG_SECURITY
|
2005-04-25 18:20:15 +00:00
|
|
|
#
|
|
|
|
# To enable rules to be written with BPF syntax, uncomment these two lines.
|
|
|
|
#
|
|
|
|
# WARNING: If you're building a commercial product based on IPFilter, using
|
|
|
|
# this options *may* infringe at least one patent held by CheckPoint
|
|
|
|
# (5,606,668.)
|
|
|
|
#
|
|
|
|
#IPFBPF=-DIPFILTER_BPF -I/usr/local/include
|
|
|
|
#LIBBPF=-L/usr/local/lib -lpcap
|
|
|
|
#
|
|
|
|
# HP-UX and Solaris require this uncommented for BPF.
|
|
|
|
#
|
|
|
|
#BPFILTER=bpf_filter.o
|
|
|
|
#
|
|
|
|
# LINUXKERNEL is the path to the top of your Linux kernel source tree.
|
|
|
|
# By default IPFilter looks for /usr/src/linux, but you may have to change
|
|
|
|
# it to /usr/src/linux-2.4 or similar.
|
|
|
|
#
|
|
|
|
LINUXKERNEL=/usr/src/linux
|
|
|
|
LINUX=`uname -r | awk -F. ' { printf"%d",$$1;for(i=1;i<NF&&i<3;i++){printf("%02d",$$(i+1));}}'`
|
|
|
|
|
|
|
|
#
|
|
|
|
# All of the compile-time options are here, used for compiling the userland
|
|
|
|
# tools for regression testing. Well, all except for IPFILTER_LKM, of course.
|
|
|
|
#
|
|
|
|
ALLOPTS=-DIPFILTER_LOG -DIPFILTER_LOOKUP \
|
|
|
|
-DIPFILTER_SCAN -DIPFILTER_SYNC -DIPFILTER_CKSUM
|
2000-05-24 02:14:22 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Uncomment the next 3 lines if you want to view the state table a la top(1)
|
|
|
|
# (requires that you have installed ncurses).
|
2005-04-25 18:20:15 +00:00
|
|
|
#STATETOP_CFLAGS=-DSTATETOP
|
2000-05-24 02:14:22 +00:00
|
|
|
#
|
|
|
|
# Where to find the ncurses include files (if not in default path),
|
|
|
|
#
|
|
|
|
#STATETOP_INC=
|
|
|
|
#STATETOP_INC=-I/usr/local/include
|
|
|
|
#
|
|
|
|
# How to link the ncurses library
|
|
|
|
#
|
2005-04-25 18:20:15 +00:00
|
|
|
#STATETOP_LIB=-lncurses
|
2000-05-24 02:14:22 +00:00
|
|
|
#STATETOP_LIB=-L/usr/local/lib -lncurses
|
|
|
|
|
|
|
|
#
|
|
|
|
# Uncomment this when building IPv6 capability.
|
|
|
|
#
|
|
|
|
#INET6=-DUSE_INET6
|
1997-02-09 22:50:16 +00:00
|
|
|
#
|
|
|
|
# For packets which don't match any pass rules or any block rules, set either
|
|
|
|
# FR_PASS or FR_BLOCK (respectively). It defaults to FR_PASS if left
|
|
|
|
# undefined. This is ignored for ipftest, which can thus return three
|
|
|
|
# results: pass, block and nomatch. This is the sort of "block unless
|
|
|
|
# explicitly allowed" type #define switch.
|
|
|
|
#
|
1997-03-02 15:40:21 +00:00
|
|
|
POLICY=-DIPF_DEFAULT_PASS=FR_PASS
|
1997-02-09 22:50:16 +00:00
|
|
|
#
|
2005-04-25 18:20:15 +00:00
|
|
|
MFLAGS1='CFLAGS=$(CFLAGS) $(ARCHINC) $(SOLARIS2) $(SGIREV) $(INET6)' \
|
1997-02-09 22:50:16 +00:00
|
|
|
"IPFLOG=$(IPFLOG)" "LOGFAC=$(LOGFAC)" "POLICY=$(POLICY)" \
|
1997-11-16 04:52:19 +00:00
|
|
|
"SOLARIS2=$(SOLARIS2)" "DEBUG=$(DEBUG)" "DCPU=$(CPU)" \
|
2005-04-25 18:20:15 +00:00
|
|
|
"LIBBPF=$(LIBBPF)" "CPUDIR=$(CPUDIR)" "IPFBPF=$(IPFBPF)" \
|
|
|
|
'STATETOP_CFLAGS=$(STATETOP_CFLAGS)' "BPFILTER=$(BPFILTER)" \
|
2000-08-13 04:58:02 +00:00
|
|
|
'STATETOP_INC=$(STATETOP_INC)' 'STATETOP_LIB=$(STATETOP_LIB)' \
|
2005-04-25 18:20:15 +00:00
|
|
|
"BITS=$(BITS)" "OBJ=$(OBJ)" "LOOKUP=$(LOOKUP)" "COMPIPF=$(COMPIPF)" \
|
|
|
|
'SYNC=$(SYNC)' 'ALLOPTS=$(ALLOPTS)' 'LIBBPF=$(LIBBPF)'
|
1999-11-08 20:51:23 +00:00
|
|
|
MFLAGS=$(MFLAGS1) "IPFLKM=$(IPFLKM)"
|
2005-04-25 18:20:15 +00:00
|
|
|
MACHASSERT=`/bin/ls -1 /usr/sys/*/mach_assert.h | head -1`
|
1997-11-16 04:52:19 +00:00
|
|
|
#
|
|
|
|
SHELL=/bin/sh
|
1997-02-09 22:50:16 +00:00
|
|
|
#
|
|
|
|
########## ########## ########## ########## ########## ########## ##########
|
|
|
|
#
|
|
|
|
CP=/bin/cp
|
|
|
|
RM=/bin/rm
|
|
|
|
CHMOD=/bin/chmod
|
|
|
|
INSTALL=install
|
|
|
|
#
|
|
|
|
|
|
|
|
all:
|
|
|
|
@echo "Chose one of the following targets for making IP filter:"
|
|
|
|
@echo ""
|
1999-11-08 20:51:23 +00:00
|
|
|
@echo "solaris - auto-selects SunOS4.1.x/Solaris 2.3-6/Solaris2.4-6x86"
|
1997-11-16 04:52:19 +00:00
|
|
|
@echo "netbsd - compile for NetBSD"
|
|
|
|
@echo "openbsd - compile for OpenBSD"
|
2004-06-21 22:53:03 +00:00
|
|
|
@echo "freebsd20 - compile for FreeBSD 2.0, 2.1 or earlier"
|
1997-11-16 04:52:19 +00:00
|
|
|
@echo "freebsd22 - compile for FreeBSD-2.2 or greater"
|
2007-10-18 21:52:14 +00:00
|
|
|
@echo "freebsd - compile for all other versions of FreeBSD"
|
1997-11-16 04:52:19 +00:00
|
|
|
@echo "bsd - compile for generic 4.4BSD systems"
|
1997-02-09 22:50:16 +00:00
|
|
|
@echo "bsdi - compile for BSD/OS"
|
1997-11-16 04:52:19 +00:00
|
|
|
@echo "irix - compile for SGI IRIX"
|
2005-04-25 18:20:15 +00:00
|
|
|
@echo "hpux - compile for HP-UX 11.00"
|
|
|
|
@echo "osf - compile for OSF/Tru64 5.1"
|
1997-02-09 22:50:16 +00:00
|
|
|
@echo ""
|
|
|
|
|
|
|
|
tests:
|
|
|
|
@if [ -d test ]; then (cd test; make) \
|
|
|
|
else echo test directory not present, sorry; fi
|
|
|
|
|
2005-04-25 18:20:15 +00:00
|
|
|
retest:
|
|
|
|
@if [ -d test ]; then (cd test; make clean && make) \
|
|
|
|
else echo test directory not present, sorry; fi
|
|
|
|
|
1997-05-25 15:45:04 +00:00
|
|
|
include:
|
2007-10-18 21:52:14 +00:00
|
|
|
-mkdir -p net netinet
|
1999-11-08 20:51:23 +00:00
|
|
|
if [ ! -f netinet/done ] ; then \
|
2005-04-25 18:20:15 +00:00
|
|
|
(cd netinet; ln -s ../*.h .; ln -s ../ip_*_pxy.c .;); \
|
1997-11-16 04:52:19 +00:00
|
|
|
(cd netinet; ln -s ../ipsend/tcpip.h tcpip.h); \
|
|
|
|
touch netinet/done; \
|
|
|
|
fi
|
2005-04-25 18:20:15 +00:00
|
|
|
-(cd netinet; ln -s ../ip_rules.h ip_rules.h)
|
|
|
|
if [ ! -f net/done ] ; then \
|
|
|
|
(cd net; ln -s ../radix_ipf.h .; ); \
|
|
|
|
touch net/done; \
|
|
|
|
fi
|
1997-05-25 15:45:04 +00:00
|
|
|
|
|
|
|
sunos solaris: include
|
2005-04-25 18:20:15 +00:00
|
|
|
MAKE="$(MAKE)" MAKEFLAGS="$(MAKEFLAGS)" BPFILTER=$(BPFILTER) \
|
|
|
|
CC="$(CC)" DEBUG="$(DEBUG)" ./buildsunos
|
1997-02-09 22:50:16 +00:00
|
|
|
|
2007-10-18 21:52:14 +00:00
|
|
|
freebsd:
|
|
|
|
make freebsd`uname -r|cut -c1`
|
|
|
|
|
1999-11-08 20:51:23 +00:00
|
|
|
freebsd22: include
|
1997-11-16 04:52:19 +00:00
|
|
|
make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
|
|
|
|
-rm -f BSD/$(CPUDIR)/ioconf.h
|
2005-04-25 18:20:15 +00:00
|
|
|
-if [ x$(IPFILKERN) != x ] ; then \
|
1999-11-08 20:51:23 +00:00
|
|
|
if [ -f /sys/compile/$(IPFILKERN)/ioconf.h ] ; then \
|
2005-04-25 18:20:15 +00:00
|
|
|
ln -s /sys/compile/$(IPFILKERN)/ioconf.h BSD/$$y; \
|
1998-06-20 18:29:38 +00:00
|
|
|
else \
|
2005-04-25 18:20:15 +00:00
|
|
|
ln -s /sys/$(IPFILKERN)/ioconf.h BSD/$$y; \
|
1998-06-20 18:29:38 +00:00
|
|
|
fi \
|
1997-05-25 15:45:04 +00:00
|
|
|
else \
|
2005-04-25 18:20:15 +00:00
|
|
|
x=`uname -v|sed -e 's@^.*:\(/[^: ]*\).*$$@\1/ioconf.h@'`; \
|
|
|
|
y=`uname -s|sed -e 's@/@@g'`-`uname -r`-`uname -m`; \
|
|
|
|
if [ ! -f $$x ] ; then \
|
|
|
|
echo -n "Can't find ioconf.h at $$x "; \
|
|
|
|
exit 1;\
|
|
|
|
else \
|
|
|
|
ln -s $$x BSD/$$y ; \
|
|
|
|
fi \
|
1997-04-03 10:22:02 +00:00
|
|
|
fi
|
2004-06-21 22:53:03 +00:00
|
|
|
make freebsd20
|
1997-05-25 15:45:04 +00:00
|
|
|
|
2007-06-04 02:54:36 +00:00
|
|
|
freebsd5 freebsd6 freebsd7: include
|
2005-04-25 18:20:15 +00:00
|
|
|
if [ x$(INET6) = x ] ; then \
|
|
|
|
echo "#undef INET6" > opt_inet6.h; \
|
|
|
|
else \
|
|
|
|
echo "#define INET6" > opt_inet6.h; \
|
|
|
|
fi
|
2005-12-30 11:52:26 +00:00
|
|
|
if [ "x$(IPFBPF)" = "x" ] ; then \
|
|
|
|
echo "#undef NBPF" > opt_bpf.h; \
|
|
|
|
echo "#undef NBPFILTER" > opt_bpf.h; \
|
|
|
|
echo "#undef DEV_BPF" > opt_bpf.h; \
|
|
|
|
else \
|
|
|
|
echo "#define NBPF" > opt_bpf.h; \
|
|
|
|
echo "#define NBPFILTER" > opt_bpf.h; \
|
|
|
|
echo "#define DEV_BPF" > opt_bpf.h; \
|
|
|
|
fi
|
2005-04-25 18:20:15 +00:00
|
|
|
if [ x$(ENABLE_PFIL) = x ] ; then \
|
|
|
|
echo "#undef PFIL_HOOKS" > opt_pfil.h; \
|
|
|
|
else \
|
|
|
|
echo "#define PFIL_HOOKS" > opt_pfil.h; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
|
|
|
|
(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 ..)
|
|
|
|
(cd BSD/$(CPUDIR); make -f Makefile.ipsend build TOP=../.. $(MFLAGS1); cd ..)
|
|
|
|
|
|
|
|
freebsd4 : include
|
|
|
|
if [ x$(INET6) = x ] ; then \
|
2000-07-19 13:52:47 +00:00
|
|
|
echo "#undef INET6" > opt_inet6.h; \
|
|
|
|
else \
|
|
|
|
echo "#define INET6" > opt_inet6.h; \
|
|
|
|
fi
|
2000-05-24 02:14:22 +00:00
|
|
|
make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
|
2005-04-25 18:20:15 +00:00
|
|
|
(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 ..)
|
|
|
|
(cd BSD/$(CPUDIR); make -f Makefile.ipsend build TOP=../.. $(MFLAGS1); cd ..)
|
2000-05-24 02:14:22 +00:00
|
|
|
|
1999-11-08 20:51:23 +00:00
|
|
|
freebsd3 freebsd30: include
|
|
|
|
make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
|
2005-04-25 18:20:15 +00:00
|
|
|
(cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS1) "ML=mlf_ipl.c" "MLR=mlf_rule.o" LKM= LKMR=; cd ..)
|
|
|
|
(cd BSD/$(CPUDIR); make -f Makefile.ipsend build TOP=../.. $(MFLAGS1); cd ..)
|
1999-11-08 20:51:23 +00:00
|
|
|
|
1997-05-25 15:45:04 +00:00
|
|
|
netbsd: include
|
1997-11-16 04:52:19 +00:00
|
|
|
make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
|
2007-06-04 02:54:36 +00:00
|
|
|
@if [ ! -d /sys -o ! -d /sys/arch ] ; then \
|
|
|
|
echo "*****************************************************"; \
|
|
|
|
echo "* *"; \
|
|
|
|
echo "* Please extract source code to create /sys and *";\
|
|
|
|
echo "* /sys/arch and run 'config GENERIC' *"; \
|
|
|
|
echo "* *"; \
|
|
|
|
echo "*****************************************************"; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2005-04-25 18:20:15 +00:00
|
|
|
(cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS) 'DLKM=-D_LKM' "ML=mln_ipl.c" LKMR= "MLR=mln_rule.o"; cd ..)
|
|
|
|
(cd BSD/$(CPUDIR); make -f Makefile.ipsend build TOP=../.. $(MFLAGS); cd ..)
|
1997-11-16 04:52:19 +00:00
|
|
|
|
2005-04-25 18:20:15 +00:00
|
|
|
openbsd: include
|
1997-11-16 04:52:19 +00:00
|
|
|
make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
|
2005-04-25 18:20:15 +00:00
|
|
|
(cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS) 'DLKM=-D_LKM' "ML=mlo_ipl.c" LKMR= "MLR=mlo_rule.o"; cd ..)
|
|
|
|
(cd BSD/$(CPUDIR); make -f Makefile.ipsend build TOP=../.. $(MFLAGS); cd ..)
|
1997-05-25 15:45:04 +00:00
|
|
|
|
2004-06-21 22:53:03 +00:00
|
|
|
freebsd20 freebsd21: include
|
1997-11-16 04:52:19 +00:00
|
|
|
make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
|
2005-04-25 18:20:15 +00:00
|
|
|
(cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS) "ML=mlf_ipl.c" "MLR=mlf_rule.o"; cd ..)
|
|
|
|
(cd BSD/$(CPUDIR); make -f Makefile.ipsend build TOP=../.. $(MFLAGS); cd ..)
|
|
|
|
|
|
|
|
osf tru64: null include
|
|
|
|
make setup "TARGOS=OSF" "CPUDIR=`OSF/cpurev`"
|
|
|
|
(cd OSF/`OSF/cpurev`; make build TRU64=`uname -v` TOP=../.. "DEBUG=-g" $(MFLAGS) "MACHASSERT=$(MACHASSERT)" "OSREV=`../cpurev`"; cd ..)
|
|
|
|
(cd OSF/`OSF/cpurev`; make -f Makefile.ipsend build TRU64=`uname -v` TOP=../.. $(MFLAGS) "OSREV=`../cpurev`"; cd ..)
|
1997-04-03 10:22:02 +00:00
|
|
|
|
2005-12-30 11:52:26 +00:00
|
|
|
aix: null include
|
|
|
|
make setup "TARGOS=AIX" "CPUDIR=`AIX/cpurev`"
|
|
|
|
(cd AIX/`AIX/cpurev`; make build AIX=`uname -v` TOP=../.. "DEBUG=-g" $(MFLAGS) "OSREV=`../cpurev`" BITS=`../bootbits.sh`; cd ..)
|
|
|
|
# (cd AIX/`AIX/cpurev`; make -f Makefile.ipsend build AIX=`uname -v` TOP=../.. $(MFLAGS) "OSREV=`../cpurev`"; cd ..)
|
|
|
|
|
1997-05-25 15:45:04 +00:00
|
|
|
bsd: include
|
1997-11-16 04:52:19 +00:00
|
|
|
make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
|
2005-04-25 18:20:15 +00:00
|
|
|
(cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS) 'DLKM=-D_LKM' "ML=mln_ipl.c" "MLR=mln_rule.o"; cd ..)
|
|
|
|
(cd BSD/$(CPUDIR); make -f Makefile.ipsend build TOP=../.. $(MFLAGS); cd ..)
|
1997-02-09 22:50:16 +00:00
|
|
|
|
1997-05-25 15:45:04 +00:00
|
|
|
bsdi bsdos: include
|
1997-11-16 04:52:19 +00:00
|
|
|
make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
|
2005-04-25 18:20:15 +00:00
|
|
|
(cd BSD/$(CPUDIR); make build "CC=$(CC)" TOP=../.. $(MFLAGS) LKM= LKMR= ; cd ..)
|
|
|
|
(cd BSD/$(CPUDIR); make -f Makefile.ipsend build "CC=$(CC)" TOP=../.. $(MFLAGS); cd ..)
|
1997-11-16 04:52:19 +00:00
|
|
|
|
|
|
|
irix IRIX: include
|
2005-04-25 18:20:15 +00:00
|
|
|
make setup TARGOS=IRIX CPUDIR=`IRIX/cpurev`
|
|
|
|
if [ "x${SGIREV}" = "x" ] ; then \
|
|
|
|
make irix "SGIREV=-D_KMEMUSER -DIRIX=`IRIX/getrev`"; \
|
|
|
|
else \
|
|
|
|
(cd IRIX/`IRIX/cpurev`; smake -l -J 1 build TOP=../.. $(DEST) $(MFLAGS) IRIX=`../getrev` SGI=$$(IRIX) CPUDIR=`../cpurev`; cd ..); \
|
|
|
|
(cd IRIX/`IRIX/cpurev`; make -f Makefile.ipsend build TOP=../.. $(DEST) $(MFLAGS) IRIX=`../getrev` SGI=$$(IRIX) CPUDIR=`../cpurev`; cd ..); \
|
|
|
|
fi
|
1997-11-16 04:52:19 +00:00
|
|
|
|
|
|
|
setup:
|
|
|
|
-if [ ! -d $(TARGOS)/$(CPUDIR) ] ; then mkdir $(TARGOS)/$(CPUDIR); fi
|
|
|
|
-rm -f $(TARGOS)/$(CPUDIR)/Makefile $(TARGOS)/$(CPUDIR)/Makefile.ipsend
|
|
|
|
-ln -s ../Makefile $(TARGOS)/$(CPUDIR)/Makefile
|
|
|
|
-ln -s ../Makefile.ipsend $(TARGOS)/$(CPUDIR)/Makefile.ipsend
|
2005-04-25 18:20:15 +00:00
|
|
|
-if [ -f $(TARGOS)/Makefile.common ] ; then \
|
|
|
|
rm -f $(TARGOS)/$(CPUDIR)/Makefile.common; \
|
|
|
|
ln -s ../Makefile.common $(TARGOS)/$(CPUDIR)/Makefile.common;\
|
|
|
|
fi
|
1997-02-09 22:50:16 +00:00
|
|
|
|
1999-11-08 20:51:23 +00:00
|
|
|
clean: clean-include
|
2005-04-25 18:20:15 +00:00
|
|
|
/bin/rm -rf h y.output
|
1997-02-09 22:50:16 +00:00
|
|
|
${RM} -f core *.o ipt fils ipf ipfstat ipftest ipmon if_ipl \
|
2000-08-13 04:58:02 +00:00
|
|
|
vnode_if.h $(LKM) *~
|
2005-04-25 18:20:15 +00:00
|
|
|
/bin/rm -rf sparcv7 sparcv9 mdbgen_build
|
|
|
|
(cd SunOS4; $(MAKE) TOP=.. clean)
|
|
|
|
-(cd SunOS5; $(MAKE) TOP=.. clean)
|
|
|
|
(cd BSD; $(MAKE) TOP=.. clean)
|
|
|
|
(cd HPUX; $(MAKE) BITS=32 TOP=.. clean)
|
|
|
|
(cd Linux; $(MAKE) TOP=.. clean)
|
|
|
|
(cd OSF; $(MAKE) TOP=.. clean)
|
2005-12-30 11:52:26 +00:00
|
|
|
(cd AIX; $(MAKE) TOP=.. clean)
|
2005-04-25 18:20:15 +00:00
|
|
|
if [ "`uname -s`" = "IRIX" ]; then (cd IRIX; $(MAKE) clean); fi
|
|
|
|
[ -d test ] && (cd test; $(MAKE) clean)
|
|
|
|
(cd ipsend; $(MAKE) clean)
|
1997-02-09 22:50:16 +00:00
|
|
|
|
1999-11-08 20:51:23 +00:00
|
|
|
clean-include:
|
2005-04-25 18:20:15 +00:00
|
|
|
sh -c 'if [ -d netinet ] ; then cd netinet; for i in *; do if [ -h $$i ] ; then /bin/rm -f $$i; fi; done fi'
|
|
|
|
sh -c 'if [ -d net ] ; then cd net; for i in *; do if [ -h $$i ] ; then /bin/rm -f $$i; fi; done fi'
|
|
|
|
${RM} -f netinet/done net/done
|
1999-11-08 20:51:23 +00:00
|
|
|
|
|
|
|
clean-bsd: clean-include
|
2005-04-25 18:20:15 +00:00
|
|
|
(cd BSD; make TOP=.. clean)
|
|
|
|
|
|
|
|
clean-hpux: clean-include
|
|
|
|
(cd HPUX; $(MAKE) BITS=32 clean)
|
|
|
|
|
|
|
|
clean-osf: clean-include
|
|
|
|
(cd OSF; make clean)
|
|
|
|
|
2005-12-30 11:52:26 +00:00
|
|
|
clean-aix: clean-include
|
|
|
|
(cd AIX; make clean)
|
|
|
|
|
2005-04-25 18:20:15 +00:00
|
|
|
clean-linux: clean-include
|
|
|
|
(cd Linux; make clean)
|
1997-02-09 22:50:16 +00:00
|
|
|
|
1999-11-08 20:51:23 +00:00
|
|
|
clean-sunos4: clean-include
|
1997-02-09 22:50:16 +00:00
|
|
|
(cd SunOS4; make clean)
|
|
|
|
|
1999-11-08 20:51:23 +00:00
|
|
|
clean-sunos5: clean-include
|
2005-04-25 18:20:15 +00:00
|
|
|
(cd SunOS5; $(MAKE) clean)
|
|
|
|
/bin/rm -rf sparcv?
|
1997-02-09 22:50:16 +00:00
|
|
|
|
1999-11-08 20:51:23 +00:00
|
|
|
clean-irix: clean-include
|
2005-04-25 18:20:15 +00:00
|
|
|
(cd IRIX; $(MAKE) clean)
|
1997-11-16 04:52:19 +00:00
|
|
|
|
2005-04-25 18:20:15 +00:00
|
|
|
h/xti.h:
|
|
|
|
mkdir -p h
|
|
|
|
ln -s /usr/include/sys/xti.h h
|
1997-11-16 04:52:19 +00:00
|
|
|
|
2005-04-25 18:20:15 +00:00
|
|
|
hpux: include h/xti.h
|
|
|
|
make setup CPUDIR=`HPUX/cpurev` TARGOS=HPUX
|
|
|
|
(cd HPUX/`HPUX/cpurev`; $(MAKE) build TOP=../.. $(DEST) $(MFLAGS) "BITS=`getconf KERNEL_BITS`" `../makeargs`; cd ..)
|
|
|
|
(cd HPUX/`HPUX/cpurev`; $(MAKE) -f Makefile.ipsend build TOP=../.. $(DEST) $(MFLAGS) "BITS=`getconf KERNEL_BITS`" `../makeargs`; cd ..)
|
1997-02-09 22:50:16 +00:00
|
|
|
|
2005-04-25 18:20:15 +00:00
|
|
|
sunos4 solaris1:
|
2000-05-24 02:14:22 +00:00
|
|
|
(cd SunOS4; make build TOP=.. "CC=$(CC)" $(DEST) $(MFLAGS); cd ..)
|
2005-04-25 18:20:15 +00:00
|
|
|
(cd SunOS4; make -f Makefile.ipsend build "CC=$(CC)" TOP=.. $(DEST) $(MFLAGS); cd ..)
|
1997-04-03 10:22:02 +00:00
|
|
|
|
2003-02-15 06:27:40 +00:00
|
|
|
sunos5 solaris2: null
|
2007-10-18 21:52:14 +00:00
|
|
|
(cd SunOS5/$(CPUDIR); $(MAKE) build TOP=../.. "CC=$(CC)" $(DEST) $(MFLAGS) "SOLARIS2=$(SOLARIS2)"; cd ..)
|
2005-04-25 18:20:15 +00:00
|
|
|
(cd SunOS5/$(CPUDIR); $(MAKE) -f Makefile.ipsend build TOP=../.. "CC=$(CC)" $(DEST) $(MFLAGS); cd ..)
|
1997-04-03 10:22:02 +00:00
|
|
|
|
2005-04-25 18:20:15 +00:00
|
|
|
linux: include
|
|
|
|
(cd Linux; make build LINUX=$(LINUX) TOP=.. "DEBUG=-g" "CC=$(CC)" $(MFLAGS) OBJ=$(CPUDIR) LINUXKERNEL=$(LINUXKERNEL); cd ..)
|
|
|
|
(cd Linux; make ipflkm LINUX=$(LINUX) TOP=.. "DEBUG=-g" "CC=$(CC)" $(MFLAGS) OBJ=$(CPUDIR) LINUXKERNEL=$(LINUXKERNEL) WORKDIR=`pwd`; cd ..)
|
|
|
|
# (cd Linux; make -f Makefile.ipsend build LINUX=$(LINUX) TOP=.. "CC=$(CC)" $(MFLAGS); cd ..)
|
1998-06-20 18:29:38 +00:00
|
|
|
|
2005-04-25 18:20:15 +00:00
|
|
|
install-linux: linux
|
|
|
|
(cd Linux/; make LINUX=$(LINUX) TOP=.. "DEBUG=-g" "CC=$(CC)" $(MFLAGS) OBJ=$(CPUDIR) install ; cd ..)
|
1997-04-03 10:22:02 +00:00
|
|
|
|
1997-11-16 04:52:19 +00:00
|
|
|
install-bsd:
|
|
|
|
(cd BSD/$(CPUDIR); make install "TOP=../.." $(MFLAGS); cd ..)
|
|
|
|
(cd BSD/$(CPUDIR); make -f Makefile.ipsend INSTALL=$(INSTALL) install "TOP=../.." $(MFLAGS); cd ..)
|
1997-05-25 15:45:04 +00:00
|
|
|
|
1997-02-09 22:50:16 +00:00
|
|
|
install-sunos4: solaris
|
2005-04-25 18:20:15 +00:00
|
|
|
(cd SunOS4; $(MAKE) CPU=$(CPU) TOP=.. install)
|
1997-05-25 15:45:04 +00:00
|
|
|
|
2005-04-25 18:20:15 +00:00
|
|
|
install-sunos5: solaris null
|
2007-10-18 21:52:14 +00:00
|
|
|
(cd SunOS5; $(MAKE) TOP=.. install)
|
2005-04-25 18:20:15 +00:00
|
|
|
|
2005-12-30 11:52:26 +00:00
|
|
|
install-aix:
|
|
|
|
(cd AIX/`AIX/cpurev`; make install "TOP=../.." $(MFLAGS); cd ..)
|
|
|
|
# (cd AIX/`AIX/cpurev`; make -f Makefile.ipsend INSTALL=$(INSTALL) install "TOP=../.." $(MFLAGS); cd ..)
|
|
|
|
|
2005-04-25 18:20:15 +00:00
|
|
|
install-hpux: hpux
|
|
|
|
(cd HPUX/`HPUX/cpurev`; $(MAKE) CPU=$(CPU) TOP=../.. "BITS=`getconf KERNEL_BITS`" install)
|
1997-02-09 22:50:16 +00:00
|
|
|
|
1997-11-16 04:52:19 +00:00
|
|
|
install-irix: irix
|
2005-04-25 18:20:15 +00:00
|
|
|
(cd IRIX; smake install CPU=$(CPU) TOP=.. $(DEST) $(MFLAGS) CPUDIR=`./cpurev`)
|
|
|
|
|
|
|
|
install-osf install-tru64:
|
|
|
|
(cd OSF/`OSF/cpurev`; make install "TOP=../.." $(MFLAGS); cd ..)
|
1997-02-09 22:50:16 +00:00
|
|
|
|
|
|
|
do-cvs:
|
|
|
|
find . -type d -name CVS -print | xargs /bin/rm -rf
|
|
|
|
find . -type f -name .cvsignore -print | xargs /bin/rm -f
|
2005-04-25 18:20:15 +00:00
|
|
|
/bin/rm -f ip_msnrpc_pxy.c ip_sunrpc_pxy.c
|
|
|
|
|
|
|
|
ip_rules.c ip_rules.h: rules/ip_rules tools/ipfcomp.c
|
|
|
|
-./ipf -n -cc -f rules/ip_rules 2>/dev/null 1>&2
|
2003-02-15 06:27:40 +00:00
|
|
|
|
|
|
|
null:
|
2005-04-25 18:20:15 +00:00
|
|
|
@if [ "`$(MAKE) -v 2>&1 | sed -ne 's/GNU.*/GNU/p'`" = "GNU" ] ; then \
|
2003-02-15 06:27:40 +00:00
|
|
|
echo 'Do not use GNU make (gmake) to compile IPFilter'; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
|
|
|
-@echo make ok
|
2004-06-21 22:53:03 +00:00
|
|
|
|
2005-04-25 18:20:15 +00:00
|
|
|
mdb:
|
|
|
|
/bin/rm -rf mdbgen_build
|
|
|
|
mdbgen -D_KERNEL -DIPFILTER_LOG -DIPFILTER_LOOKUP -DSUNDDI \
|
|
|
|
-DIPFILTER_SCAN -DIPFILTER_LKM -DSOLARIS2=10 -n ipf_mdb -k \
|
|
|
|
-I/home/dr146992/pfil -I/home/dr146992/ipf -f \
|
|
|
|
/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
|
2005-12-30 11:52:26 +00:00
|
|
|
|