Makefile (37074) | Makefile (53024) |
---|---|
1# | 1# |
2# Copyright (C) 1993-1997 by Darren Reed. | 2# Copyright (C) 1993-1998 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# | 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.10 1998/05/23 05:01:23 darrenr Exp $ | 8# $Id: Makefile,v 2.2 1999/08/04 17:29:52 darrenr Exp $ |
9# 10BINDEST=/usr/local/bin 11SBINDEST=/sbin 12MANDIR=/usr/local/man 13#To test prototyping | 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 | 14CC=gcc -Wstrict-prototypes -Wmissing-prototypes 15#CC=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# --- 10 unchanged lines hidden (view full) --- 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# | 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# --- 10 unchanged lines hidden (view full) --- 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)" \ | 42MFLAGS1="BINDEST=$(BINDEST)" "SBINDEST=$(SBINDEST)" "MANDIR=$(MANDIR)" \ 43 'CFLAGS=$(CFLAGS) $(ARCHINC) $(SOLARIS2)' \ |
44 "IPFLOG=$(IPFLOG)" "LOGFAC=$(LOGFAC)" "POLICY=$(POLICY)" \ 45 "SOLARIS2=$(SOLARIS2)" "DEBUG=$(DEBUG)" "DCPU=$(CPU)" \ 46 "CPUDIR=$(CPUDIR)" | 44 "IPFLOG=$(IPFLOG)" "LOGFAC=$(LOGFAC)" "POLICY=$(POLICY)" \ 45 "SOLARIS2=$(SOLARIS2)" "DEBUG=$(DEBUG)" "DCPU=$(CPU)" \ 46 "CPUDIR=$(CPUDIR)" |
47MFLAGS=$(MFLAGS1) "IPFLKM=$(IPFLKM)" |
|
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 "" | 48# 49SHELL=/bin/sh 50# 51########## ########## ########## ########## ########## ########## ########## 52# 53CP=/bin/cp 54RM=/bin/rm 55CHMOD=/bin/chmod 56INSTALL=install 57# 58 59all: 60 @echo "Chose one of the following targets for making IP filter:" 61 @echo "" |
61 @echo "solaris - auto-selects SunOS4.1.x/Solaris 2.[45]/Solaris2.[45]-x86" | 62 @echo "solaris - auto-selects SunOS4.1.x/Solaris 2.3-6/Solaris2.4-6x86" |
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" | 63 @echo "netbsd - compile for NetBSD" 64 @echo "openbsd - compile for OpenBSD" 65 @echo "freebsd - compile for FreeBSD 2.0, 2.1 or earlier" 66 @echo "freebsd22 - compile for FreeBSD-2.2 or greater" |
67 @echo "freebsd3 - compile for FreeBSD-3.x" |
|
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: | 68 @echo "bsd - compile for generic 4.4BSD systems" 69 @echo "bsdi - compile for BSD/OS" 70 @echo "irix - compile for SGI IRIX" 71 @echo "linux - compile for Linux 2.0.31+" 72 @echo "" 73 74tests: 75 @if [ -d test ]; then (cd test; make) \ 76 else echo test directory not present, sorry; fi 77 78include: |
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 .); \ | 79 if [ ! -f netinet/done ] ; then \ 80 (cd netinet; ln -s ../*.h .; ln -s ../ip_ftp_pxy.c .; ln -s ../ip_rcmd_pxy.c .; ln -s ../ip_raudio_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 | 81 (cd netinet; ln -s ../ipsend/tcpip.h tcpip.h); \ 82 touch netinet/done; \ 83 fi 84 85sunos solaris: include 86 ./buildsunos 87 |
87freebsd22 freebsd30: include | 88freebsd22: include |
88 make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)" 89 -rm -f BSD/$(CPUDIR)/ioconf.h 90 @if [ -n $(IPFILKERN) ] ; then \ | 89 make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)" 90 -rm -f BSD/$(CPUDIR)/ioconf.h 91 @if [ -n $(IPFILKERN) ] ; then \ |
91 if [ -f /sys/$(IPFILKERN)/compile/ioconf.h ] ; then \ 92 ln -s /sys/$(IPFILKERN)/compile/ioconf.h BSD/$(CPUDIR); \ | 92 if [ -f /sys/compile/$(IPFILKERN)/ioconf.h ] ; then \ 93 ln -s /sys/compile/$(IPFILKERN)/ioconf.h BSD/$(CPUDIR); \ |
93 else \ 94 ln -s /sys/$(IPFILKERN)/ioconf.h BSD/$(CPUDIR); \ 95 fi \ 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 | 94 else \ 95 ln -s /sys/$(IPFILKERN)/ioconf.h BSD/$(CPUDIR); \ 96 fi \ 97 elif [ ! -f `uname -v|sed -e 's@^.*:\(/[^: ]*\).*@\1@'`/ioconf.h ] ; then \ 98 echo -n "Can't find ioconf.h in "; \ 99 echo `uname -v|sed -e 's@^.*:\(/[^: ]*\).*@\1@'`; \ 100 exit 1;\ 101 else \ 102 ln -s `uname -v|sed -e 's@^.*:\(/[^: ]*\).*@\1@'`/ioconf.h BSD/$(CPU) ; \ 103 fi 104 make freebsd 105 |
106freebsd3 freebsd30: include 107 make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)" 108 (cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS1) "ML=mlf_ipl.c" LKM= ; cd ..) 109 (cd BSD/$(CPUDIR); make -f Makefile.ipsend TOP=../.. $(MFLAGS1); cd ..) 110 |
|
105netbsd: include 106 make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)" 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 ..) 109 110openbsd openbsd21: include 111 make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)" 112 (cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS) 'DLKM=-D_LKM' "ML=mln_ipl.c"; cd ..) --- 28 unchanged lines hidden (view full) --- 141 (cd Linux/$(CPUDIR); make -f Makefile.ipsend TOP=../.. $(MFLAGS); cd ..) 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 | 111netbsd: include 112 make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)" 113 (cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS) 'DLKM=-D_LKM' "ML=mln_ipl.c"; cd ..) 114 (cd BSD/$(CPUDIR); make -f Makefile.ipsend TOP=../.. $(MFLAGS); cd ..) 115 116openbsd openbsd21: include 117 make setup "TARGOS=BSD" "CPUDIR=$(CPUDIR)" 118 (cd BSD/$(CPUDIR); make build TOP=../.. $(MFLAGS) 'DLKM=-D_LKM' "ML=mln_ipl.c"; cd ..) --- 28 unchanged lines hidden (view full) --- 147 (cd Linux/$(CPUDIR); make -f Makefile.ipsend TOP=../.. $(MFLAGS); cd ..) 148 149setup: 150 -if [ ! -d $(TARGOS)/$(CPUDIR) ] ; then mkdir $(TARGOS)/$(CPUDIR); fi 151 -rm -f $(TARGOS)/$(CPUDIR)/Makefile $(TARGOS)/$(CPUDIR)/Makefile.ipsend 152 -ln -s ../Makefile $(TARGOS)/$(CPUDIR)/Makefile 153 -ln -s ../Makefile.ipsend $(TARGOS)/$(CPUDIR)/Makefile.ipsend 154 |
149clean: 150 ${RM} -rf netinet | 155clean: clean-include |
151 ${RM} -f core *.o ipt fils ipf ipfstat ipftest ipmon if_ipl \ | 156 ${RM} -f core *.o ipt fils ipf ipfstat ipftest ipmon if_ipl \ |
152 vnode_if.h $(LKM) | 157 vnode_if.h $(LKM) *~ |
153 if [ "`uname -s`" = "SunOS" ]; then (cd SunOS4; make clean); fi 154 if [ "`uname -s`" = "SunOS" ]; then (cd SunOS5; make clean); fi 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 | 158 if [ "`uname -s`" = "SunOS" ]; then (cd SunOS4; make clean); fi 159 if [ "`uname -s`" = "SunOS" ]; then (cd SunOS5; make clean); fi 160 (cd BSD; make clean) 161 (cd Linux; make clean) 162 if [ "`uname -s`" = "IRIX" ]; then (cd IRIX; make clean); fi 163 [ -d test ] && (cd test; make clean) 164 (cd ipsend; make clean) 165 |
161clean-bsd: | 166clean-include: 167 sh -c 'cd netinet; for i in *; do if [ -h $$i ] ; then /bin/rm -f $$i; fi; done' 168 ${RM} -f netinet/done 169 170clean-bsd: clean-include |
162 (cd BSD; make clean) 163 | 171 (cd BSD; make clean) 172 |
164clean-sunos4: | 173clean-sunos4: clean-include |
165 (cd SunOS4; make clean) 166 | 174 (cd SunOS4; make clean) 175 |
167clean-sunos5: | 176clean-sunos5: clean-include |
168 (cd SunOS5; make clean) 169 | 177 (cd SunOS5; make clean) 178 |
170clean-irix: | 179clean-irix: clean-include |
171 (cd IRIX; make clean) 172 | 180 (cd IRIX; make clean) 181 |
173clean-linux: | 182clean-linux: clean-include |
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 \ --- 52 unchanged lines hidden --- | 183 (cd Linux; make clean) 184 185get: 186 -@for i in ipf.c ipt.h solaris.c ipf.h kmem.c ipft_ef.c linux.h \ 187 ipft_pc.c fil.c ipft_sn.c mln_ipl.c fils.c ipft_td.c \ 188 mls_ipl.c ip_compat.h ipl.h opt.c ip_fil.c ipl_ldev.c \ 189 parse.c ip_fil.h ipmon.c pcap.h ip_sfil.c ipt.c snoop.h \ 190 ip_state.c ip_state.h ip_nat.c ip_nat.h ip_frag.c \ --- 52 unchanged lines hidden --- |