HAMMER: Mass storage flush command support
[dragonfly.git] / contrib / ipfilter / ipsend / Makefile
blobbb8000f5389f32bc2fdcf50e980cdbc62e75a1ff
2 # Copyright (C) 1993-1998 by Darren Reed.
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.
8 IPFT=ipft_ef.o ipft_hx.o ipft_pc.o ipft_sn.o ipft_td.o ipft_tx.o opt.o
9 OBJS=ipsend.o ip.o ipsopt.o y.tab.o lex.yy.o
10 ROBJS=ipresend.o ip.o resend.o $(IPFT)
11 TOBJS=iptest.o iptests.o ip.o
12 BPF=sbpf.o
13 NIT=snit.o
14 SUNOS4=sock.o arp.o inet_addr.o
15 BSD=sock.o 44arp.o
16 LINUX=lsock.o slinux.o larp.o
17 LINUXK=
18 TOP=..
19 SUNOS5=dlcommon.o sdlpi.o arp.o inet_addr.o
20 ULTRIX=ultrix.o sock.o arp.o inet_addr.o
21 HPUX=hpux.o sock.o arp.o inet_addr.o
23 #CC=gcc
24 DEBUG=-g
25 CFLAGS=$(DEBUG) -I. -Iipf
27 MFLAGS="BINDEST=$(BINDEST)" "SBINDEST=$(SBINDEST)" "MANDIR=$(MANDIR)" \
28 "IPFLKM=$(IPFLKM)" \
29 "IPFLOG=$(IPFLOG)" "LOGFAC=$(LOGFAC)" "POLICY=$(POLICY)" \
30 "SOLARIS2=$(SOLARIS2)" "DEBUG=$(DEBUG)" "DCPU=$(CPU)" \
31 "CPUDIR=$(CPUDIR)"
33 all:
34 @echo "Use one of these targets:"
35 @echo " sunos4-nit (standard SunOS 4.1.x)"
36 @echo " sunos4-bpf (SunOS4.1.x with BPF in the kernel)"
37 @echo " bsd-bpf (4.4BSD variant with BPF in the kernel)"
38 @echo " linux10 (Linux 1.0 kernels)"
39 @echo " linux12 (Linux 1.2 kernels)"
40 @echo " linux20 (Linux 2.0 kernels)"
41 @echo " sunos5 (Solaris 2.x)"
43 ipf:
44 -if [ ! -d iplang ] ; then ln -s ../iplang iplang; fi
45 -if [ ! -d netinet ] ; then ln -s ../netinet netinet; fi
46 -if [ ! -d ipf ] ; then ln -s .. ipf; fi
48 y.tab.o: iplang/iplang_y.y
49 -if [ -h iplang ] ; then \
50 (cd iplang; ${MAKE} $(MFLAGS) 'DESTDIR=../ipsend' ) \
51 else \
52 (cd iplang; ${MAKE} $(MFLAGS) 'DESTDIR=..' ) \
55 lex.yy.o: iplang/iplang_l.l
56 -if [ -h iplang ] ; then \
57 (cd iplang; ${MAKE} $(MFLAGS) 'DESTDIR=../ipsend' ) \
58 else \
59 (cd iplang; ${MAKE} $(MFLAGS) 'DESTDIR=..' ) \
62 .c.o:
63 $(CC) $(CFLAGS) $(LINUXK) -c $< -o $@
65 install:
66 -$(INSTALL) -cs -g wheel -m 755 -o root ipsend ipresend iptest $(BINDEST)
68 bpf sunos4-bpf :
69 make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(BPF) $(SUNOS4)" "CC=$(CC)" \
70 "CFLAGS=$(CFLAGS) -DDOSOCKET -DIPSEND" "LLIB=-ll"
71 make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(BPF) $(SUNOS4)" "CC=$(CC)" \
72 "CFLAGS=$(CFLAGS) -DDOSOCKET"
73 make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(BPF) $(SUNOS4)" "CC=$(CC)" \
74 "CFLAGS=$(CFLAGS) -DDOSOCKET"
76 nit sunos4 sunos4-nit :
77 make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(NIT) $(SUNOS4)" "CC=$(CC)" \
78 "CFLAGS=$(CFLAGS) -DDOSOCKET -DIPSEND" "LLIB=-ll"
79 make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(NIT) $(SUNOS4)" "CC=$(CC)" \
80 "CFLAGS=$(CFLAGS) -DDOSOCKET"
81 make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(NIT) $(SUNOS4)" "CC=$(CC)" \
82 "CFLAGS=$(CFLAGS) -DDOSOCKET"
84 dlpi sunos5 :
85 make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(SUNOS5)" "CC=$(CC)" \
86 CFLAGS="$(CFLAGS) -Dsolaris -DIPSEND" "LIBS=-lsocket -lnsl" \
87 "LLIB=-ll"
88 make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(SUNOS5)" "CC=$(CC)" \
89 CFLAGS="$(CFLAGS) -Dsolaris" "LIBS=-lsocket -lnsl"
90 make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(SUNOS5)" "CC=$(CC)" \
91 CFLAGS="$(CFLAGS) -Dsolaris" "LIBS=-lsocket -lnsl"
93 bsd-bpf :
94 make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(BPF) $(BSD)" "CC=$(CC)" \
95 "CFLAGS=$(CFLAGS) -DDOSOCKET -DIPSEND" "LLIB=-ll"
96 make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(BPF) $(BSD)" "CC=$(CC)" \
97 "CFLAGS=$(CFLAGS) -DDOSOCKET"
98 make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(BPF) $(BSD)" "CC=$(CC)" \
99 "CFLAGS=$(CFLAGS) -DDOSOCKET"
101 linuxrev :
102 make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(LINUX)" "CC=$(CC)" \
103 CFLAGS="$(CFLAGS) $(INC) -DDOSOCKET -DIPSEND" $(LINUXK)
104 make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(LINUX)" "CC=$(CC)" \
105 CFLAGS="$(CFLAGS) $(INC) -DDOSOCKET" $(LINUXK)
106 make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(LINUX)" "CC=$(CC)" \
107 CFLAGS="$(CFLAGS) $(INC) -DDOSOCKET" $(LINUXK)
109 linux10:
110 make linuxrev 'LINUXK="LINUXK=-DLINUX=0100"' \
111 "INC=-I/usr/src/linux/include" "LLIB=-lfl"
113 linux12:
114 make linuxrev 'LINUXK="LINUXK=-DLINUX=0102"' "INC=-I/usr/src/linux" \
115 "LLIB=-lfl"
117 linux20:
118 make linuxrev 'LINUXK="LINUXK=-DLINUX=0200"' \
119 "INC=-I/usr/src/linux/include" "LLIB=-lfl" "ELIB=-lelf"
121 ultrix :
122 make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(ULTRIX)" "CC=$(CC)" \
123 CFLAGS="$(CFLAGS) -DIPSEND" "LIBS=" "LLIB=-ll"
124 make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(ULTRIX)" "CC=$(CC)" \
125 CFLAGS="$(CFLAGS)" "LIBS="
126 make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(ULTRIX)" "CC=$(CC)" \
127 CFLAGS="$(CFLAGS)" "LIBS="
129 hpux9 :
130 make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(HPUX)" "CC=$(CC)" \
131 CFLAGS="$(CFLAGS) -DIPSEND" "LIBS="
132 make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(HPUX)" "CC=$(CC)" \
133 CFLAGS="$(CFLAGS)" "LIBS="
134 make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(HPUX)" "CC=$(CC)" \
135 CFLAGS="$(CFLAGS)" "LIBS="
137 ipsend: ipf $(OBJS) $(UNIXOBJS)
138 $(CC) $(OBJS) $(UNIXOBJS) -o $@ $(LIBS) $(LLIB) $(ELIB)
140 ipresend: $(ROBJS) $(UNIXOBJS)
141 $(CC) $(ROBJS) $(UNIXOBJS) -o $@ $(LIBS) $(ELIB)
143 iptest: $(TOBJS) $(UNIXOBJS)
144 $(CC) $(TOBJS) $(UNIXOBJS) -o $@ $(LIBS) $(ELIB)
146 ipft_ef.o: ipf/ipft_ef.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h
147 $(CC) $(CFLAGS) $(LINUXK) -c ipf/ipft_ef.c -o $@
149 ipft_hx.o: ipf/ipft_hx.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h
150 $(CC) $(CFLAGS) $(LINUXK) -c ipf/ipft_hx.c -o $@
152 ipft_pc.o: ipf/ipft_pc.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h
153 $(CC) $(CFLAGS) $(LINUXK) -c ipf/ipft_pc.c -o $@
155 ipft_sn.o: ipf/ipft_sn.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h
156 $(CC) $(CFLAGS) $(LINUXK) -c ipf/ipft_sn.c -o $@
158 ipft_td.o: ipf/ipft_td.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h
159 $(CC) $(CFLAGS) $(LINUXK) -c ipf/ipft_td.c -o $@
161 ipft_tx.o: ipf/ipft_tx.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h
162 $(CC) $(CFLAGS) $(LINUXK) -c ipf/ipft_tx.c -o $@
164 opt.o: ipf/opt.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h
165 $(CC) $(CFLAGS) $(LINUXK) -c ipf/opt.c -o $@
167 inet_addr.o: ipf/inet_addr.c
168 $(CC) $(CFLAGS) $(LINUXK) -c ipf/inet_addr.c -o $@
170 clean:
171 rm -rf *.o *core a.out ipsend ipresend iptest
172 if [ -d iplang ]; then (cd iplang; $(MAKE) $(MFLAGS) clean); fi
173 if [ -d $(TOP)/iplang ]; then (cd $(TOP)/iplang; $(MAKE) $(MFLAGS) clean); fi
175 do-cvs:
176 find . -type d -name CVS -print | xargs /bin/rm -rf
177 find . -type f -name .cvsignore -print | xargs /bin/rm -f