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