Makefile revision 235537
122514Sdarrenr# 253024Sguido# Copyright (C) 1993-1998 by Darren Reed. 322514Sdarrenr# 4145510Sdarrenr# See the IPFILTER.LICENCE file for details on licencing. 522514Sdarrenr# 631183SpeterIPFT=ipft_ef.o ipft_hx.o ipft_pc.o ipft_sn.o ipft_td.o ipft_tx.o opt.o 731183SpeterOBJS=ipsend.o ip.o ipsopt.o y.tab.o lex.yy.o 831183SpeterROBJS=ipresend.o ip.o resend.o $(IPFT) 922514SdarrenrTOBJS=iptest.o iptests.o ip.o 1022514SdarrenrBPF=sbpf.o 1122514SdarrenrNIT=snit.o 1231183SpeterSUNOS4=sock.o arp.o inet_addr.o 1322514SdarrenrBSD=sock.o 44arp.o 1422514SdarrenrLINUX=lsock.o slinux.o larp.o 1522514SdarrenrLINUXK= 1622514SdarrenrTOP=.. 1731183SpeterSUNOS5=dlcommon.o sdlpi.o arp.o inet_addr.o 1831183SpeterULTRIX=ultrix.o sock.o arp.o inet_addr.o 1931183SpeterHPUX=hpux.o sock.o arp.o inet_addr.o 2022514Sdarrenr 2131183Speter#CC=gcc 2231183SpeterDEBUG=-g 2331183SpeterCFLAGS=$(DEBUG) -I. -Iipf 2431183Speter# 2531183SpeterMFLAGS="BINDEST=$(BINDEST)" "SBINDEST=$(SBINDEST)" "MANDIR=$(MANDIR)" \ 2631183Speter "IPFLKM=$(IPFLKM)" \ 2731183Speter "IPFLOG=$(IPFLOG)" "LOGFAC=$(LOGFAC)" "POLICY=$(POLICY)" \ 2831183Speter "SOLARIS2=$(SOLARIS2)" "DEBUG=$(DEBUG)" "DCPU=$(CPU)" \ 2931183Speter "CPUDIR=$(CPUDIR)" 3031183Speter# 3122514Sdarrenrall: 3222514Sdarrenr @echo "Use one of these targets:" 3322514Sdarrenr @echo " sunos4-nit (standard SunOS 4.1.x)" 3422514Sdarrenr @echo " sunos4-bpf (SunOS4.1.x with BPF in the kernel)" 3522514Sdarrenr @echo " bsd-bpf (4.4BSD variant with BPF in the kernel)" 3622514Sdarrenr @echo " linux10 (Linux 1.0 kernels)" 3731183Speter @echo " linux12 (Linux 1.2 kernels)" 3822514Sdarrenr @echo " linux20 (Linux 2.0 kernels)" 3922514Sdarrenr @echo " sunos5 (Solaris 2.x)" 4022514Sdarrenr 4131183Speteripf: 4231183Speter -if [ ! -d iplang ] ; then ln -s ../iplang iplang; fi 4331183Speter -if [ ! -d netinet ] ; then ln -s ../netinet netinet; fi 4431183Speter -if [ ! -d ipf ] ; then ln -s .. ipf; fi 4531183Speter 4631183Spetery.tab.o: iplang/iplang_y.y 4731183Speter -if [ -h iplang ] ; then \ 4831183Speter (cd iplang; ${MAKE} $(MFLAGS) 'DESTDIR=../ipsend' ) \ 4931183Speter else \ 5031183Speter (cd iplang; ${MAKE} $(MFLAGS) 'DESTDIR=..' ) \ 5131183Speter fi 5231183Speter 5331183Speterlex.yy.o: iplang/iplang_l.l 5431183Speter -if [ -h iplang ] ; then \ 5531183Speter (cd iplang; ${MAKE} $(MFLAGS) 'DESTDIR=../ipsend' ) \ 5631183Speter else \ 5731183Speter (cd iplang; ${MAKE} $(MFLAGS) 'DESTDIR=..' ) \ 5831183Speter fi 5931183Speter 6022514Sdarrenr.c.o: 6122514Sdarrenr $(CC) $(CFLAGS) $(LINUXK) -c $< -o $@ 6222514Sdarrenr 6326119Sdarrenrinstall: 6426119Sdarrenr -$(INSTALL) -cs -g wheel -m 755 -o root ipsend ipresend iptest $(BINDEST) 6526119Sdarrenr 6622514Sdarrenrbpf sunos4-bpf : 6722514Sdarrenr make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(BPF) $(SUNOS4)" "CC=$(CC)" \ 6853024Sguido "CFLAGS=$(CFLAGS) -DDOSOCKET -DIPSEND" "LLIB=-ll" 6922514Sdarrenr make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(BPF) $(SUNOS4)" "CC=$(CC)" \ 7022514Sdarrenr "CFLAGS=$(CFLAGS) -DDOSOCKET" 7122514Sdarrenr make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(BPF) $(SUNOS4)" "CC=$(CC)" \ 7222514Sdarrenr "CFLAGS=$(CFLAGS) -DDOSOCKET" 7322514Sdarrenr 7422514Sdarrenrnit sunos4 sunos4-nit : 7522514Sdarrenr make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(NIT) $(SUNOS4)" "CC=$(CC)" \ 7653024Sguido "CFLAGS=$(CFLAGS) -DDOSOCKET -DIPSEND" "LLIB=-ll" 7722514Sdarrenr make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(NIT) $(SUNOS4)" "CC=$(CC)" \ 7822514Sdarrenr "CFLAGS=$(CFLAGS) -DDOSOCKET" 7922514Sdarrenr make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(NIT) $(SUNOS4)" "CC=$(CC)" \ 8022514Sdarrenr "CFLAGS=$(CFLAGS) -DDOSOCKET" 8122514Sdarrenr 8222514Sdarrenrdlpi sunos5 : 8322514Sdarrenr make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(SUNOS5)" "CC=$(CC)" \ 8453024Sguido CFLAGS="$(CFLAGS) -Dsolaris -DIPSEND" "LIBS=-lsocket -lnsl" \ 8553024Sguido "LLIB=-ll" 8622514Sdarrenr make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(SUNOS5)" "CC=$(CC)" \ 8722514Sdarrenr CFLAGS="$(CFLAGS) -Dsolaris" "LIBS=-lsocket -lnsl" 8822514Sdarrenr make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(SUNOS5)" "CC=$(CC)" \ 8922514Sdarrenr CFLAGS="$(CFLAGS) -Dsolaris" "LIBS=-lsocket -lnsl" 9022514Sdarrenr 9122514Sdarrenrbsd-bpf : 9222514Sdarrenr make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(BPF) $(BSD)" "CC=$(CC)" \ 9353024Sguido "CFLAGS=$(CFLAGS) -DDOSOCKET -DIPSEND" "LLIB=-ll" 9422514Sdarrenr make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(BPF) $(BSD)" "CC=$(CC)" \ 9522514Sdarrenr "CFLAGS=$(CFLAGS) -DDOSOCKET" 9622514Sdarrenr make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(BPF) $(BSD)" "CC=$(CC)" \ 9722514Sdarrenr "CFLAGS=$(CFLAGS) -DDOSOCKET" 9822514Sdarrenr 9922514Sdarrenrlinuxrev : 10022514Sdarrenr make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(LINUX)" "CC=$(CC)" \ 10153024Sguido CFLAGS="$(CFLAGS) $(INC) -DDOSOCKET -DIPSEND" $(LINUXK) 10222514Sdarrenr make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(LINUX)" "CC=$(CC)" \ 10331183Speter CFLAGS="$(CFLAGS) $(INC) -DDOSOCKET" $(LINUXK) 10422514Sdarrenr make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(LINUX)" "CC=$(CC)" \ 10531183Speter CFLAGS="$(CFLAGS) $(INC) -DDOSOCKET" $(LINUXK) 10622514Sdarrenr 10722514Sdarrenrlinux10: 10831183Speter make linuxrev 'LINUXK="LINUXK=-DLINUX=0100"' \ 10931183Speter "INC=-I/usr/src/linux/include" "LLIB=-lfl" 11022514Sdarrenr 11131183Speterlinux12: 11231183Speter make linuxrev 'LINUXK="LINUXK=-DLINUX=0102"' "INC=-I/usr/src/linux" \ 11331183Speter "LLIB=-lfl" 11431183Speter 11522514Sdarrenrlinux20: 11631183Speter make linuxrev 'LINUXK="LINUXK=-DLINUX=0200"' \ 11731183Speter "INC=-I/usr/src/linux/include" "LLIB=-lfl" "ELIB=-lelf" 11822514Sdarrenr 11931183Speterultrix : 12031183Speter make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(ULTRIX)" "CC=$(CC)" \ 12153024Sguido CFLAGS="$(CFLAGS) -DIPSEND" "LIBS=" "LLIB=-ll" 12231183Speter make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(ULTRIX)" "CC=$(CC)" \ 12331183Speter CFLAGS="$(CFLAGS)" "LIBS=" 12431183Speter make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(ULTRIX)" "CC=$(CC)" \ 12531183Speter CFLAGS="$(CFLAGS)" "LIBS=" 12622514Sdarrenr 12731183Speterhpux9 : 12831183Speter make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(HPUX)" "CC=$(CC)" \ 12953024Sguido CFLAGS="$(CFLAGS) -DIPSEND" "LIBS=" 13031183Speter make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(HPUX)" "CC=$(CC)" \ 13131183Speter CFLAGS="$(CFLAGS)" "LIBS=" 13231183Speter make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(HPUX)" "CC=$(CC)" \ 13331183Speter CFLAGS="$(CFLAGS)" "LIBS=" 13431183Speter 135145510Sdarrenrhpux11 : 136145510Sdarrenr make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(HPUX)" "CC=$(CC)" \ 137145510Sdarrenr CFLAGS="$(CFLAGS) -DIPSEND" "LIBS=" 138145510Sdarrenr make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(HPUX)" "CC=$(CC)" \ 139145510Sdarrenr CFLAGS="$(CFLAGS)" "LIBS=" 140145510Sdarrenr make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(HPUX)" "CC=$(CC)" \ 141145510Sdarrenr CFLAGS="$(CFLAGS)" "LIBS=" 142145510Sdarrenr 14331183Speteripsend: ipf $(OBJS) $(UNIXOBJS) 14431183Speter $(CC) $(OBJS) $(UNIXOBJS) -o $@ $(LIBS) $(LLIB) $(ELIB) 14531183Speter 14622514Sdarrenripresend: $(ROBJS) $(UNIXOBJS) 14731183Speter $(CC) $(ROBJS) $(UNIXOBJS) -o $@ $(LIBS) $(ELIB) 14822514Sdarrenr 14922514Sdarrenriptest: $(TOBJS) $(UNIXOBJS) 15031183Speter $(CC) $(TOBJS) $(UNIXOBJS) -o $@ $(LIBS) $(ELIB) 15122514Sdarrenr 15231183Speteripft_ef.o: ipf/ipft_ef.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h 15331183Speter $(CC) $(CFLAGS) $(LINUXK) -c ipf/ipft_ef.c -o $@ 15431183Speter 15531183Speteripft_hx.o: ipf/ipft_hx.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h 15631183Speter $(CC) $(CFLAGS) $(LINUXK) -c ipf/ipft_hx.c -o $@ 15731183Speter 15831183Speteripft_pc.o: ipf/ipft_pc.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h 15931183Speter $(CC) $(CFLAGS) $(LINUXK) -c ipf/ipft_pc.c -o $@ 16031183Speter 16131183Speteripft_sn.o: ipf/ipft_sn.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h 16231183Speter $(CC) $(CFLAGS) $(LINUXK) -c ipf/ipft_sn.c -o $@ 16331183Speter 16431183Speteripft_td.o: ipf/ipft_td.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h 16531183Speter $(CC) $(CFLAGS) $(LINUXK) -c ipf/ipft_td.c -o $@ 16631183Speter 16731183Speteripft_tx.o: ipf/ipft_tx.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h 16831183Speter $(CC) $(CFLAGS) $(LINUXK) -c ipf/ipft_tx.c -o $@ 16931183Speter 17031183Speteropt.o: ipf/opt.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h 17131183Speter $(CC) $(CFLAGS) $(LINUXK) -c ipf/opt.c -o $@ 17231183Speter 17331183Speterinet_addr.o: ipf/inet_addr.c 17431183Speter $(CC) $(CFLAGS) $(LINUXK) -c ipf/inet_addr.c -o $@ 17531183Speter 17622514Sdarrenrclean: 17722514Sdarrenr rm -rf *.o *core a.out ipsend ipresend iptest 17831183Speter if [ -d iplang ]; then (cd iplang; $(MAKE) $(MFLAGS) clean); fi 17931183Speter if [ -d $(TOP)/iplang ]; then (cd $(TOP)/iplang; $(MAKE) $(MFLAGS) clean); fi 18031183Speter 18131183Speterdo-cvs: 18231183Speter find . -type d -name CVS -print | xargs /bin/rm -rf 18331183Speter find . -type f -name .cvsignore -print | xargs /bin/rm -f 184