Deleted Added
full compact
Makefile (34739) Makefile (37074)
1#
2# Copyright (C) 1993-1997 by Darren Reed.
3#
4# Redistribution and use in source and binary forms are permitted
5# provided that this notice is preserved and due credit is given
6# to the original author and the contributors.
7#
1#
2# Copyright (C) 1993-1997 by Darren Reed.
3#
4# Redistribution and use in source and binary forms are permitted
5# provided that this notice is preserved and due credit is given
6# to the original author and the contributors.
7#
8# $Id: Makefile,v 2.0.2.26.2.5 1997/11/27 09:32:38 darrenr Exp $
8# $Id: Makefile,v 2.0.2.26.2.10 1998/05/23 05:01:23 darrenr Exp $
9#
10BINDEST=/usr/local/bin
11SBINDEST=/sbin
12MANDIR=/usr/local/man
13#To test prototyping
14#CC=gcc -Wstrict-prototypes -Wmissing-prototypes -Werror
15CC=gcc
16#CC=cc -Dconst=
17DEBUG=-g
18CFLAGS=-I$$(TOP)
19CPU=`uname -m`
20CPUDIR=`uname -s|sed -e 's@/@@g'`-`uname -r`-`uname -m`
21#
22# To enable this to work as a Loadable Kernel Module...
23#
24IPFLKM=-DIPFILTER_LKM
25#
26# To enable logging of blocked/passed packets...
27#
28IPFLOG=-DIPFILTER_LOG
29#
30# The facility you wish to log messages from ipmon to syslogd with.
31#
32LOGFAC=-DLOGFAC=LOG_LOCAL0
33#
34# For packets which don't match any pass rules or any block rules, set either
35# FR_PASS or FR_BLOCK (respectively). It defaults to FR_PASS if left
36# undefined. This is ignored for ipftest, which can thus return three
37# results: pass, block and nomatch. This is the sort of "block unless
38# explicitly allowed" type #define switch.
39#
40POLICY=-DIPF_DEFAULT_PASS=FR_PASS
41#
42MFLAGS="BINDEST=$(BINDEST)" "SBINDEST=$(SBINDEST)" "MANDIR=$(MANDIR)" \
43 'CFLAGS=$(CFLAGS) $(SOLARIS2)' "IPFLKM=$(IPFLKM)" \
44 "IPFLOG=$(IPFLOG)" "LOGFAC=$(LOGFAC)" "POLICY=$(POLICY)" \
45 "SOLARIS2=$(SOLARIS2)" "DEBUG=$(DEBUG)" "DCPU=$(CPU)" \
46 "CPUDIR=$(CPUDIR)"
47#
48SHELL=/bin/sh
49#
50########## ########## ########## ########## ########## ########## ##########
51#
52CP=/bin/cp
53RM=/bin/rm
54CHMOD=/bin/chmod
55INSTALL=install
56#
57
58all:
59 @echo "Chose one of the following targets for making IP filter:"
60 @echo ""
61 @echo "solaris - auto-selects SunOS4.1.x/Solaris 2.[45]/Solaris2.[45]-x86"
62 @echo "netbsd - compile for NetBSD"
63 @echo "openbsd - compile for OpenBSD"
64 @echo "freebsd - compile for FreeBSD 2.0, 2.1 or earlier"
65 @echo "freebsd22 - compile for FreeBSD-2.2 or greater"
66 @echo "bsd - compile for generic 4.4BSD systems"
67 @echo "bsdi - compile for BSD/OS"
68 @echo "irix - compile for SGI IRIX"
69 @echo "linux - compile for Linux 2.0.31+"
70 @echo ""
71
72tests:
73 @if [ -d test ]; then (cd test; make) \
74 else echo test directory not present, sorry; fi
75
76include:
77 if [ ! -d netinet -o ! -f netinet/done ] ; then \
78 mkdir -p netinet; \
79 (cd netinet; ln -s ../*.h .; ln -s ../ip_ftp_pxy.c .); \
80 (cd netinet; ln -s ../ipsend/tcpip.h tcpip.h); \
81 touch netinet/done; \
82 fi
83
84sunos solaris: include
85 ./buildsunos
86
87freebsd22 freebsd30: include
88 make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
89 -rm -f BSD/$(CPUDIR)/ioconf.h
90 @if [ -n $(IPFILKERN) ] ; then \
9#
10BINDEST=/usr/local/bin
11SBINDEST=/sbin
12MANDIR=/usr/local/man
13#To test prototyping
14#CC=gcc -Wstrict-prototypes -Wmissing-prototypes -Werror
15CC=gcc
16#CC=cc -Dconst=
17DEBUG=-g
18CFLAGS=-I$$(TOP)
19CPU=`uname -m`
20CPUDIR=`uname -s|sed -e 's@/@@g'`-`uname -r`-`uname -m`
21#
22# To enable this to work as a Loadable Kernel Module...
23#
24IPFLKM=-DIPFILTER_LKM
25#
26# To enable logging of blocked/passed packets...
27#
28IPFLOG=-DIPFILTER_LOG
29#
30# The facility you wish to log messages from ipmon to syslogd with.
31#
32LOGFAC=-DLOGFAC=LOG_LOCAL0
33#
34# For packets which don't match any pass rules or any block rules, set either
35# FR_PASS or FR_BLOCK (respectively). It defaults to FR_PASS if left
36# undefined. This is ignored for ipftest, which can thus return three
37# results: pass, block and nomatch. This is the sort of "block unless
38# explicitly allowed" type #define switch.
39#
40POLICY=-DIPF_DEFAULT_PASS=FR_PASS
41#
42MFLAGS="BINDEST=$(BINDEST)" "SBINDEST=$(SBINDEST)" "MANDIR=$(MANDIR)" \
43 'CFLAGS=$(CFLAGS) $(SOLARIS2)' "IPFLKM=$(IPFLKM)" \
44 "IPFLOG=$(IPFLOG)" "LOGFAC=$(LOGFAC)" "POLICY=$(POLICY)" \
45 "SOLARIS2=$(SOLARIS2)" "DEBUG=$(DEBUG)" "DCPU=$(CPU)" \
46 "CPUDIR=$(CPUDIR)"
47#
48SHELL=/bin/sh
49#
50########## ########## ########## ########## ########## ########## ##########
51#
52CP=/bin/cp
53RM=/bin/rm
54CHMOD=/bin/chmod
55INSTALL=install
56#
57
58all:
59 @echo "Chose one of the following targets for making IP filter:"
60 @echo ""
61 @echo "solaris - auto-selects SunOS4.1.x/Solaris 2.[45]/Solaris2.[45]-x86"
62 @echo "netbsd - compile for NetBSD"
63 @echo "openbsd - compile for OpenBSD"
64 @echo "freebsd - compile for FreeBSD 2.0, 2.1 or earlier"
65 @echo "freebsd22 - compile for FreeBSD-2.2 or greater"
66 @echo "bsd - compile for generic 4.4BSD systems"
67 @echo "bsdi - compile for BSD/OS"
68 @echo "irix - compile for SGI IRIX"
69 @echo "linux - compile for Linux 2.0.31+"
70 @echo ""
71
72tests:
73 @if [ -d test ]; then (cd test; make) \
74 else echo test directory not present, sorry; fi
75
76include:
77 if [ ! -d netinet -o ! -f netinet/done ] ; then \
78 mkdir -p netinet; \
79 (cd netinet; ln -s ../*.h .; ln -s ../ip_ftp_pxy.c .); \
80 (cd netinet; ln -s ../ipsend/tcpip.h tcpip.h); \
81 touch netinet/done; \
82 fi
83
84sunos solaris: include
85 ./buildsunos
86
87freebsd22 freebsd30: include
88 make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
89 -rm -f BSD/$(CPUDIR)/ioconf.h
90 @if [ -n $(IPFILKERN) ] ; then \
91 if [ -f /sys/$(IPFILKERN)/compile/ioconf.h ] ; then \
92 ln -s /sys/$(IPFILKERN)/compile/ioconf.h BSD/$(CPUDIR); \
93 else \
91 ln -s /sys/$(IPFILKERN)/ioconf.h BSD/$(CPUDIR); \
94 ln -s /sys/$(IPFILKERN)/ioconf.h BSD/$(CPUDIR); \
95 fi \
92 elif [ ! -f `uname -v|sed -e 's@^.*:\(/[^: ]*\).*@\1@'`/ioconf.h ] ; then \
93 echo -n "Can't find ioconf.h in "; \
94 echo `uname -v|sed -e 's@^.*:\(/[^: ]*\).*@\1@'`; \
95 exit 1;\
96 else \
97 ln -s `uname -v|sed -e 's@^.*:\(/[^: ]*\).*@\1@'`/ioconf.h BSD/$(CPU) ; \
98 fi
99 make freebsd
100
101netbsd: include
102 make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
96 elif [ ! -f `uname -v|sed -e 's@^.*:\(/[^: ]*\).*@\1@'`/ioconf.h ] ; then \
97 echo -n "Can't find ioconf.h in "; \
98 echo `uname -v|sed -e 's@^.*:\(/[^: ]*\).*@\1@'`; \
99 exit 1;\
100 else \
101 ln -s `uname -v|sed -e 's@^.*:\(/[^: ]*\).*@\1@'`/ioconf.h BSD/$(CPU) ; \
102 fi
103 make freebsd
104
105netbsd: include
106 make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
103 (cd BSD/$(CPUDIR); make build "TOP=../.." $(MFLAGS) 'DLKM=-D_LKM' "ML=mln_ipl.c"; cd ..)
104 (cd BSD/$(CPUDIR); make -f Makefile.ipsend "TOP=../.." $(MFLAGS); cd ..)
107 (cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS) 'DLKM=-D_LKM' "ML=mln_ipl.c"; cd ..)
108 (cd BSD/$(CPUDIR); make -f Makefile.ipsend TOP=../.. $(MFLAGS); cd ..)
105
106openbsd openbsd21: include
107 make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
109
110openbsd openbsd21: include
111 make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
108 (cd BSD/$(CPUDIR); make build "TOP=../.." $(MFLAGS) 'DLKM=-D_LKM' "ML=mln_ipl.c"; cd ..)
109 (cd BSD/$(CPUDIR); make -f Makefile.ipsend "TOP=../.." $(MFLAGS); cd ..)
112 (cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS) 'DLKM=-D_LKM' "ML=mln_ipl.c"; cd ..)
113 (cd BSD/$(CPUDIR); make -f Makefile.ipsend TOP=../.. $(MFLAGS); cd ..)
110
111freebsd freebsd20 freebsd21: include
112 make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
114
115freebsd freebsd20 freebsd21: include
116 make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
113 (cd BSD/$(CPUDIR); make build "TOP=../.." $(MFLAGS) "ML=mlf_ipl.c"; cd ..)
114 (cd BSD/$(CPUDIR); make -f Makefile.ipsend "TOP=../.." $(MFLAGS); cd ..)
117 (cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS) "ML=mlf_ipl.c"; cd ..)
118 (cd BSD/$(CPUDIR); make -f Makefile.ipsend TOP=../.. $(MFLAGS); cd ..)
115
116bsd: include
117 make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
119
120bsd: include
121 make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
118 (cd BSD/$(CPUDIR); make build "TOP=../.." $(MFLAGS); cd ..)
119 (cd BSD/$(CPUDIR); make -f Makefile.ipsend "TOP=../.." $(MFLAGS); cd ..)
122 (cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS); cd ..)
123 (cd BSD/$(CPUDIR); make -f Makefile.ipsend TOP=../.. $(MFLAGS); cd ..)
120
121bsdi bsdos: include
122 make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
124
125bsdi bsdos: include
126 make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)"
123 (cd BSD/$(CPUDIR); make build "CC=$(CC)" "TOP=../.." $(MFLAGS) LKM= ; cd ..)
124 (cd BSD/$(CPUDIR); make -f Makefile.ipsend "CC=$(CC)" "TOP=../.." $(MFLAGS); cd ..)
127 (cd BSD/$(CPUDIR); make build "CC=$(CC)" TOP=../.. $(MFLAGS) LKM= ; cd ..)
128 (cd BSD/$(CPUDIR); make -f Makefile.ipsend "CC=$(CC)" TOP=../.. $(MFLAGS); cd ..)
125
126irix IRIX: include
127 make setup "TARGOS=IRIX" "CPUDIR=$(CPUDIR)"
129
130irix IRIX: include
131 make setup "TARGOS=IRIX" "CPUDIR=$(CPUDIR)"
128 (cd IRIX/$(CPUDIR); smake build "TOP=../.." $(MFLAGS); cd ..)
129 (cd IRIX/$(CPUDIR); make -f Makefile.ipsend "TOP=../.." $(MFLAGS); cd ..)
132 (cd IRIX/$(CPUDIR); smake build TOP=../.. $(MFLAGS); cd ..)
133 (cd IRIX/$(CPUDIR); make -f Makefile.ipsend TOP=../.. $(MFLAGS); cd ..)
130
131linux: include
132 make setup "TARGOS=Linux" "CPUDIR=$(CPUDIR)"
133 ./buildlinux
134
135linuxrev:
134
135linux: include
136 make setup "TARGOS=Linux" "CPUDIR=$(CPUDIR)"
137 ./buildlinux
138
139linuxrev:
136 (cd Linux/$(CPUDIR); make build "TOP=../.." $(MFLAGS) LKM= ; cd ..)
137 (cd Linux/$(CPUDIR); make -f Makefile.ipsend "TOP=../.." $(MFLAGS); cd ..)
140 (cd Linux/$(CPUDIR); make build TOP=../.. $(MFLAGS) LKM= ; cd ..)
141 (cd Linux/$(CPUDIR); make -f Makefile.ipsend TOP=../.. $(MFLAGS); cd ..)
138
139setup:
140 -if [ ! -d $(TARGOS)/$(CPUDIR) ] ; then mkdir $(TARGOS)/$(CPUDIR); fi
141 -rm -f $(TARGOS)/$(CPUDIR)/Makefile $(TARGOS)/$(CPUDIR)/Makefile.ipsend
142 -ln -s ../Makefile $(TARGOS)/$(CPUDIR)/Makefile
143 -ln -s ../Makefile.ipsend $(TARGOS)/$(CPUDIR)/Makefile.ipsend
144
145clean:
146 ${RM} -rf netinet
147 ${RM} -f core *.o ipt fils ipf ipfstat ipftest ipmon if_ipl \
148 vnode_if.h $(LKM)
142
143setup:
144 -if [ ! -d $(TARGOS)/$(CPUDIR) ] ; then mkdir $(TARGOS)/$(CPUDIR); fi
145 -rm -f $(TARGOS)/$(CPUDIR)/Makefile $(TARGOS)/$(CPUDIR)/Makefile.ipsend
146 -ln -s ../Makefile $(TARGOS)/$(CPUDIR)/Makefile
147 -ln -s ../Makefile.ipsend $(TARGOS)/$(CPUDIR)/Makefile.ipsend
148
149clean:
150 ${RM} -rf netinet
151 ${RM} -f core *.o ipt fils ipf ipfstat ipftest ipmon if_ipl \
152 vnode_if.h $(LKM)
149 (cd SunOS4; make clean)
150 (cd SunOS5; make clean)
153 if [ "`uname -s`" = "SunOS" ]; then (cd SunOS4; make clean); fi
154 if [ "`uname -s`" = "SunOS" ]; then (cd SunOS5; make clean); fi
151 (cd BSD; make clean)
152 (cd Linux; make clean)
153 if [ "`uname -s`" = "IRIX" ]; then (cd IRIX; make clean); fi
154 [ -d test ] && (cd test; make clean)
155 (cd ipsend; make clean)
156
157clean-bsd:
158 (cd BSD; make clean)
159
160clean-sunos4:
161 (cd SunOS4; make clean)
162
163clean-sunos5:
164 (cd SunOS5; make clean)
165
166clean-irix:
167 (cd IRIX; make clean)
168
169clean-linux:
170 (cd Linux; make clean)
171
172get:
173 -@for i in ipf.c ipt.h solaris.c ipf.h kmem.c ipft_ef.c linux.h \
174 ipft_pc.c fil.c ipft_sn.c mln_ipl.c fils.c ipft_td.c \
175 mls_ipl.c ip_compat.h ipl.h opt.c ip_fil.c ipl_ldev.c \
176 parse.c ip_fil.h ipmon.c pcap.h ip_sfil.c ipt.c snoop.h \
177 ip_state.c ip_state.h ip_nat.c ip_nat.h ip_frag.c \
178 ip_frag.h ip_sfil.c misc.c; do \
179 if [ ! -f $$i ] ; then \
180 echo "getting $$i"; \
181 sccs get $$i; \
182 fi \
183 done
184
185sunos4 solaris1:
186 (cd SunOS4; make build TOP=.. "CC=$(CC)" $(MFLAGS); cd ..)
187 (cd SunOS4; make -f Makefile.ipsend "CC=$(CC)" TOP=.. $(MFLAGS); cd ..)
188
189sunos5 solaris2:
155 (cd BSD; make clean)
156 (cd Linux; make clean)
157 if [ "`uname -s`" = "IRIX" ]; then (cd IRIX; make clean); fi
158 [ -d test ] && (cd test; make clean)
159 (cd ipsend; make clean)
160
161clean-bsd:
162 (cd BSD; make clean)
163
164clean-sunos4:
165 (cd SunOS4; make clean)
166
167clean-sunos5:
168 (cd SunOS5; make clean)
169
170clean-irix:
171 (cd IRIX; make clean)
172
173clean-linux:
174 (cd Linux; make clean)
175
176get:
177 -@for i in ipf.c ipt.h solaris.c ipf.h kmem.c ipft_ef.c linux.h \
178 ipft_pc.c fil.c ipft_sn.c mln_ipl.c fils.c ipft_td.c \
179 mls_ipl.c ip_compat.h ipl.h opt.c ip_fil.c ipl_ldev.c \
180 parse.c ip_fil.h ipmon.c pcap.h ip_sfil.c ipt.c snoop.h \
181 ip_state.c ip_state.h ip_nat.c ip_nat.h ip_frag.c \
182 ip_frag.h ip_sfil.c misc.c; do \
183 if [ ! -f $$i ] ; then \
184 echo "getting $$i"; \
185 sccs get $$i; \
186 fi \
187 done
188
189sunos4 solaris1:
190 (cd SunOS4; make build TOP=.. "CC=$(CC)" $(MFLAGS); cd ..)
191 (cd SunOS4; make -f Makefile.ipsend "CC=$(CC)" TOP=.. $(MFLAGS); cd ..)
192
193sunos5 solaris2:
190 (cd SunOS5/$(CPU); make build TOP=../.. "CC=$(CC)" $(MFLAGS) "SOLARIS2=$(SOLARIS2)" "CPU=-Dsparc -D__sparc__"; cd ..)
191 (cd SunOS5/$(CPU); make -f Makefile.ipsend TOP=../.. "CC=$(CC)" $(MFLAGS); cd ..)
194 (cd SunOS5/$(CPUDIR); make build TOP=../.. "CC=$(CC)" $(MFLAGS) "SOLARIS2=$(SOLARIS2)" "CPU=-Dsparc -D__sparc__"; cd ..)
195 (cd SunOS5/$(CPUDIR); make -f Makefile.ipsend TOP=../.. "CC=$(CC)" $(MFLAGS); cd ..)
192
193sunos5x86 solaris2x86:
196
197sunos5x86 solaris2x86:
194 (cd SunOS5/$(CPU); make build TOP=../.. "CC=$(CC)" $(MFLAGS) "SOLARIS2=$(SOLARIS2)" "CPU=-Di86pc -Di386 -D__i386__"; cd ..)
195 (cd SunOS5/$(CPU); make -f Makefile.ipsend TOP=../.. "CC=$(CC)" $(MFLAGS); cd ..)
198 (cd SunOS5/$(CPUDIR); make build TOP=../.. "CC=$(CC)" $(MFLAGS) "SOLARIS2=$(SOLARIS2)" "CPU=-Di86pc -Di386 -D__i386__"; cd ..)
199 (cd SunOS5/$(CPUDIR); make -f Makefile.ipsend TOP=../.. "CC=$(CC)" $(MFLAGS); cd ..)
196
200
201install-linux:
202 (cd Linux/$(CPUDIR); make install "TOP=../.." $(MFLAGS); cd ..)
203 (cd Linux/$(CPUDIR); make -f Makefile.ipsend INSTALL=$(INSTALL) install "TOP=../.." $(MFLAGS); cd ..)
204
197install-bsd:
198 (cd BSD/$(CPUDIR); make install "TOP=../.." $(MFLAGS); cd ..)
199 (cd BSD/$(CPUDIR); make -f Makefile.ipsend INSTALL=$(INSTALL) install "TOP=../.." $(MFLAGS); cd ..)
200
201install-sunos4: solaris
202 (cd SunOS4; $(MAKE) "CPU=$(CPU) TOP=.." install)
203
204install-sunos5: solaris
205 (cd SunOS5; $(MAKE) "CPU=$(CPU) TOP=.." install)
206
207install-irix: irix
208 (cd IRIX; smake install "CPU=$(CPU) TOP=.." $(MFLAGS))
209
210rcsget:
211 -@for i in ipf.c ipt.h solaris.c ipf.h kmem.c ipft_ef.c linux.h \
212 ipft_pc.c fil.c ipft_sn.c mln_ipl.c fils.c ipft_td.c \
213 mls_ipl.c ip_compat.h ipl.h opt.c ip_fil.c ipl_ldev.c \
214 parse.c ip_fil.h ipmon.c pcap.h ip_sfil.c ipt.c snoop.h \
215 ip_state.c ip_state.h ip_nat.c ip_nat.h ip_frag.c \
216 ip_frag.h ip_sfil.c misc.c; do \
217 if [ ! -f $$i ] ; then \
218 echo "getting $$i"; \
219 co $$i; \
220 fi \
221 done
222
223do-cvs:
224 find . -type d -name CVS -print | xargs /bin/rm -rf
225 find . -type f -name .cvsignore -print | xargs /bin/rm -f
205install-bsd:
206 (cd BSD/$(CPUDIR); make install "TOP=../.." $(MFLAGS); cd ..)
207 (cd BSD/$(CPUDIR); make -f Makefile.ipsend INSTALL=$(INSTALL) install "TOP=../.." $(MFLAGS); cd ..)
208
209install-sunos4: solaris
210 (cd SunOS4; $(MAKE) "CPU=$(CPU) TOP=.." install)
211
212install-sunos5: solaris
213 (cd SunOS5; $(MAKE) "CPU=$(CPU) TOP=.." install)
214
215install-irix: irix
216 (cd IRIX; smake install "CPU=$(CPU) TOP=.." $(MFLAGS))
217
218rcsget:
219 -@for i in ipf.c ipt.h solaris.c ipf.h kmem.c ipft_ef.c linux.h \
220 ipft_pc.c fil.c ipft_sn.c mln_ipl.c fils.c ipft_td.c \
221 mls_ipl.c ip_compat.h ipl.h opt.c ip_fil.c ipl_ldev.c \
222 parse.c ip_fil.h ipmon.c pcap.h ip_sfil.c ipt.c snoop.h \
223 ip_state.c ip_state.h ip_nat.c ip_nat.h ip_frag.c \
224 ip_frag.h ip_sfil.c misc.c; do \
225 if [ ! -f $$i ] ; then \
226 echo "getting $$i"; \
227 co $$i; \
228 fi \
229 done
230
231do-cvs:
232 find . -type d -name CVS -print | xargs /bin/rm -rf
233 find . -type f -name .cvsignore -print | xargs /bin/rm -f