Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / ipf / ipsend / Makefile
blobed3a51e45370833e74bd16ecb0b704dae019f1ce
2 # Copyright (C) 1993-1998 by Darren Reed.
4 # See the IPFILTER.LICENCE file for details on licencing.
6 IPFT=ipft_ef.o ipft_hx.o ipft_pc.o ipft_sn.o ipft_td.o ipft_tx.o opt.o
7 OBJS=ipsend.o ip.o ipsopt.o y.tab.o lex.yy.o
8 ROBJS=ipresend.o ip.o resend.o $(IPFT)
9 TOBJS=iptest.o iptests.o ip.o
10 BPF=sbpf.o
11 NIT=snit.o
12 SUNOS4=sock.o arp.o inet_addr.o
13 BSD=sock.o 44arp.o
14 LINUX=lsock.o slinux.o larp.o
15 LINUXK=
16 TOP=..
17 SUNOS5=dlcommon.o sdlpi.o arp.o inet_addr.o
18 ULTRIX=ultrix.o sock.o arp.o inet_addr.o
19 HPUX=hpux.o sock.o arp.o inet_addr.o
21 #CC=gcc
22 DEBUG=-g
23 CFLAGS=$(DEBUG) -I. -Iipf
25 MFLAGS="BINDEST=$(BINDEST)" "SBINDEST=$(SBINDEST)" "MANDIR=$(MANDIR)" \
26 "IPFLKM=$(IPFLKM)" \
27 "IPFLOG=$(IPFLOG)" "LOGFAC=$(LOGFAC)" "POLICY=$(POLICY)" \
28 "SOLARIS2=$(SOLARIS2)" "DEBUG=$(DEBUG)" "DCPU=$(CPU)" \
29 "CPUDIR=$(CPUDIR)"
31 all:
32 @echo "Use one of these targets:"
33 @echo " sunos4-nit (standard SunOS 4.1.x)"
34 @echo " sunos4-bpf (SunOS4.1.x with BPF in the kernel)"
35 @echo " bsd-bpf (4.4BSD variant with BPF in the kernel)"
36 @echo " linux10 (Linux 1.0 kernels)"
37 @echo " linux12 (Linux 1.2 kernels)"
38 @echo " linux20 (Linux 2.0 kernels)"
39 @echo " sunos5 (Solaris 2.x)"
41 ipf:
42 -if [ ! -d iplang ] ; then ln -s ../iplang iplang; fi
43 -if [ ! -d netinet ] ; then ln -s ../netinet netinet; fi
44 -if [ ! -d ipf ] ; then ln -s .. ipf; fi
46 y.tab.o: iplang/iplang_y.y
47 -if [ -h iplang ] ; then \
48 (cd iplang; ${MAKE} $(MFLAGS) 'DESTDIR=../ipsend' ) \
49 else \
50 (cd iplang; ${MAKE} $(MFLAGS) 'DESTDIR=..' ) \
53 lex.yy.o: iplang/iplang_l.l
54 -if [ -h iplang ] ; then \
55 (cd iplang; ${MAKE} $(MFLAGS) 'DESTDIR=../ipsend' ) \
56 else \
57 (cd iplang; ${MAKE} $(MFLAGS) 'DESTDIR=..' ) \
60 .c.o:
61 $(CC) $(CFLAGS) $(LINUXK) -c $< -o $@
63 install:
64 -$(INSTALL) -cs -g wheel -m 755 -o root ipsend ipresend iptest $(BINDEST)
66 bpf sunos4-bpf :
67 make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(BPF) $(SUNOS4)" "CC=$(CC)" \
68 "CFLAGS=$(CFLAGS) -DDOSOCKET -DIPSEND" "LLIB=-ll"
69 make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(BPF) $(SUNOS4)" "CC=$(CC)" \
70 "CFLAGS=$(CFLAGS) -DDOSOCKET"
71 make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(BPF) $(SUNOS4)" "CC=$(CC)" \
72 "CFLAGS=$(CFLAGS) -DDOSOCKET"
74 nit sunos4 sunos4-nit :
75 make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(NIT) $(SUNOS4)" "CC=$(CC)" \
76 "CFLAGS=$(CFLAGS) -DDOSOCKET -DIPSEND" "LLIB=-ll"
77 make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(NIT) $(SUNOS4)" "CC=$(CC)" \
78 "CFLAGS=$(CFLAGS) -DDOSOCKET"
79 make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(NIT) $(SUNOS4)" "CC=$(CC)" \
80 "CFLAGS=$(CFLAGS) -DDOSOCKET"
82 dlpi sunos5 :
83 make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(SUNOS5)" "CC=$(CC)" \
84 CFLAGS="$(CFLAGS) -Dsolaris -DIPSEND" "LIBS=-lsocket -lnsl" \
85 "LLIB=-ll"
86 make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(SUNOS5)" "CC=$(CC)" \
87 CFLAGS="$(CFLAGS) -Dsolaris" "LIBS=-lsocket -lnsl"
88 make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(SUNOS5)" "CC=$(CC)" \
89 CFLAGS="$(CFLAGS) -Dsolaris" "LIBS=-lsocket -lnsl"
91 bsd-bpf :
92 make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(BPF) $(BSD)" "CC=$(CC)" \
93 "CFLAGS=$(CFLAGS) -DDOSOCKET -DIPSEND" "LLIB=-ll"
94 make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(BPF) $(BSD)" "CC=$(CC)" \
95 "CFLAGS=$(CFLAGS) -DDOSOCKET"
96 make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(BPF) $(BSD)" "CC=$(CC)" \
97 "CFLAGS=$(CFLAGS) -DDOSOCKET"
99 linuxrev :
100 make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(LINUX)" "CC=$(CC)" \
101 CFLAGS="$(CFLAGS) $(INC) -DDOSOCKET -DIPSEND" $(LINUXK)
102 make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(LINUX)" "CC=$(CC)" \
103 CFLAGS="$(CFLAGS) $(INC) -DDOSOCKET" $(LINUXK)
104 make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(LINUX)" "CC=$(CC)" \
105 CFLAGS="$(CFLAGS) $(INC) -DDOSOCKET" $(LINUXK)
107 linux10:
108 make linuxrev 'LINUXK="LINUXK=-DLINUX=0100"' \
109 "INC=-I/usr/src/linux/include" "LLIB=-lfl"
111 linux12:
112 make linuxrev 'LINUXK="LINUXK=-DLINUX=0102"' "INC=-I/usr/src/linux" \
113 "LLIB=-lfl"
115 linux20:
116 make linuxrev 'LINUXK="LINUXK=-DLINUX=0200"' \
117 "INC=-I/usr/src/linux/include" "LLIB=-lfl" "ELIB=-lelf"
119 ultrix :
120 make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(ULTRIX)" "CC=$(CC)" \
121 CFLAGS="$(CFLAGS) -DIPSEND" "LIBS=" "LLIB=-ll"
122 make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(ULTRIX)" "CC=$(CC)" \
123 CFLAGS="$(CFLAGS)" "LIBS="
124 make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(ULTRIX)" "CC=$(CC)" \
125 CFLAGS="$(CFLAGS)" "LIBS="
127 hpux9 :
128 make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(HPUX)" "CC=$(CC)" \
129 CFLAGS="$(CFLAGS) -DIPSEND" "LIBS="
130 make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(HPUX)" "CC=$(CC)" \
131 CFLAGS="$(CFLAGS)" "LIBS="
132 make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(HPUX)" "CC=$(CC)" \
133 CFLAGS="$(CFLAGS)" "LIBS="
135 hpux11 :
136 make ipsend "OBJS=$(OBJS)" "UNIXOBJS=$(HPUX)" "CC=$(CC)" \
137 CFLAGS="$(CFLAGS) -DIPSEND" "LIBS="
138 make ipresend "ROBJS=$(ROBJS)" "UNIXOBJS=$(HPUX)" "CC=$(CC)" \
139 CFLAGS="$(CFLAGS)" "LIBS="
140 make iptest "TOBJS=$(TOBJS)" "UNIXOBJS=$(HPUX)" "CC=$(CC)" \
141 CFLAGS="$(CFLAGS)" "LIBS="
143 ipsend: ipf $(OBJS) $(UNIXOBJS)
144 $(CC) $(OBJS) $(UNIXOBJS) -o $@ $(LIBS) $(LLIB) $(ELIB)
146 ipresend: $(ROBJS) $(UNIXOBJS)
147 $(CC) $(ROBJS) $(UNIXOBJS) -o $@ $(LIBS) $(ELIB)
149 iptest: $(TOBJS) $(UNIXOBJS)
150 $(CC) $(TOBJS) $(UNIXOBJS) -o $@ $(LIBS) $(ELIB)
152 ipft_ef.o: ipf/ipft_ef.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h
153 $(CC) $(CFLAGS) $(LINUXK) -c ipf/ipft_ef.c -o $@
155 ipft_hx.o: ipf/ipft_hx.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h
156 $(CC) $(CFLAGS) $(LINUXK) -c ipf/ipft_hx.c -o $@
158 ipft_pc.o: ipf/ipft_pc.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h
159 $(CC) $(CFLAGS) $(LINUXK) -c ipf/ipft_pc.c -o $@
161 ipft_sn.o: ipf/ipft_sn.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h
162 $(CC) $(CFLAGS) $(LINUXK) -c ipf/ipft_sn.c -o $@
164 ipft_td.o: ipf/ipft_td.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h
165 $(CC) $(CFLAGS) $(LINUXK) -c ipf/ipft_td.c -o $@
167 ipft_tx.o: ipf/ipft_tx.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h
168 $(CC) $(CFLAGS) $(LINUXK) -c ipf/ipft_tx.c -o $@
170 opt.o: ipf/opt.c ipf/ipt.h ipf/ipf.h ipf/ip_compat.h
171 $(CC) $(CFLAGS) $(LINUXK) -c ipf/opt.c -o $@
173 inet_addr.o: ipf/inet_addr.c
174 $(CC) $(CFLAGS) $(LINUXK) -c ipf/inet_addr.c -o $@
176 clean:
177 rm -rf *.o *core a.out ipsend ipresend iptest
178 if [ -d iplang ]; then (cd iplang; $(MAKE) $(MFLAGS) clean); fi
179 if [ -d $(TOP)/iplang ]; then (cd $(TOP)/iplang; $(MAKE) $(MFLAGS) clean); fi
181 do-cvs:
182 find . -type d -name CVS -print | xargs /bin/rm -rf
183 find . -type f -name .cvsignore -print | xargs /bin/rm -f