]> The Tcpdump Group git mirrors - tcpdump/blob - Makefile.in
We no longer have win32/Include/errno.h.
[tcpdump] / Makefile.in
1 # Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
2 # The Regents of the University of California. All rights reserved.
3 #
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that: (1) source code distributions
6 # retain the above copyright notice and this paragraph in its entirety, (2)
7 # distributions including binary code include the above copyright notice and
8 # this paragraph in its entirety in the documentation or other materials
9 # provided with the distribution, and (3) all advertising materials mentioning
10 # features or use of this software display the following acknowledgement:
11 # ``This product includes software developed by the University of California,
12 # Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
13 # the University nor the names of its contributors may be used to endorse
14 # or promote products derived from this software without specific prior
15 # written permission.
16 # THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
17 # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
18 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19
20 #
21 # Various configurable paths (remember to edit Makefile.in, not Makefile)
22 #
23
24 # Top level hierarchy
25 prefix = @prefix@
26 exec_prefix = @exec_prefix@
27 datarootdir = @datarootdir@
28 # Pathname of directory to install the binary
29 sbindir = @sbindir@
30 # Pathname of directory to install the man page
31 mandir = @mandir@
32
33 # VPATH
34 srcdir = @srcdir@
35 VPATH = @srcdir@
36
37 #
38 # You shouldn't need to edit anything below here.
39 #
40
41 CC = @CC@
42 AR = @AR@
43 MKDEP = @MKDEP@
44 PROG = tcpdump
45 CCOPT = @V_CCOPT@
46 INCLS = -I. @V_INCLS@
47 DEFS = @DEFS@ @CPPFLAGS@ @V_DEFS@
48
49 # Standard CFLAGS
50 CFLAGS = @CFLAGS@
51 FULL_CFLAGS = $(CCOPT) $(DEFS) $(INCLS) $(CFLAGS)
52
53 # Standard LDFLAGS
54 LDFLAGS = @LDFLAGS@
55
56 # Standard LIBS
57 LIBS = @LIBS@
58
59 INSTALL = @INSTALL@
60 INSTALL_PROGRAM = @INSTALL_PROGRAM@
61 INSTALL_DATA = @INSTALL_DATA@
62 RANLIB = @RANLIB@
63
64 DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@
65
66 # Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
67 # Also, gcc does not remove the .o before forking 'as', which can be a
68 # problem if you don't own the file but can write to the directory.
69 .c.o:
70 @rm -f $@
71 $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c
72
73 CSRC = setsignal.c tcpdump.c
74
75 LIBNETDISSECT_SRC=\
76 addrtoname.c \
77 af.c \
78 checksum.c \
79 cpack.c \
80 gmpls.c \
81 gmt2local.c \
82 in_cksum.c \
83 ipproto.c \
84 l2vpn.c \
85 machdep.c \
86 nlpid.c \
87 oui.c \
88 parsenfsfh.c \
89 print-802_11.c \
90 print-802_15_4.c \
91 print-ah.c \
92 print-ahcp.c \
93 print-aodv.c \
94 print-ap1394.c \
95 print-arcnet.c \
96 print-arp.c \
97 print-ascii.c \
98 print-atalk.c \
99 print-atm.c \
100 print-beep.c \
101 print-bfd.c \
102 print-bgp.c \
103 print-bootp.c \
104 print-bt.c \
105 print-calm-fast.c \
106 print-carp.c \
107 print-cdp.c \
108 print-cfm.c \
109 print-chdlc.c \
110 print-cip.c \
111 print-cnfp.c \
112 print-dccp.c \
113 print-decnet.c \
114 print-domain.c \
115 print-dtp.c \
116 print-dvmrp.c \
117 print-eap.c \
118 print-egp.c \
119 print-eigrp.c \
120 print-enc.c \
121 print-esp.c \
122 print-ether.c \
123 print-fddi.c \
124 print-forces.c \
125 print-fr.c \
126 print-geonet.c \
127 print-gre.c \
128 print-hsrp.c \
129 print-icmp.c \
130 print-igmp.c \
131 print-igrp.c \
132 print-ip.c \
133 print-ipcomp.c \
134 print-ipfc.c \
135 print-ipnet.c \
136 print-ipx.c \
137 print-isakmp.c \
138 print-isoclns.c \
139 print-juniper.c \
140 print-krb.c \
141 print-l2tp.c \
142 print-lane.c \
143 print-ldp.c \
144 print-llc.c \
145 print-lldp.c \
146 print-lmp.c \
147 print-loopback.c \
148 print-lspping.c \
149 print-lwapp.c \
150 print-lwres.c \
151 print-m3ua.c \
152 print-mobile.c \
153 print-mpcp.c \
154 print-mpls.c \
155 print-mptcp.c \
156 print-msdp.c \
157 print-msnlb.c \
158 print-nflog.c \
159 print-nfs.c \
160 print-ntp.c \
161 print-null.c \
162 print-olsr.c \
163 print-openflow-1.0.c \
164 print-openflow.c \
165 print-ospf.c \
166 print-otv.c \
167 print-pgm.c \
168 print-pim.c \
169 print-pktap.c \
170 print-ppi.c \
171 print-ppp.c \
172 print-pppoe.c \
173 print-pptp.c \
174 print-radius.c \
175 print-raw.c \
176 print-rip.c \
177 print-rpki-rtr.c \
178 print-rrcp.c \
179 print-rsvp.c \
180 print-rx.c \
181 print-sctp.c \
182 print-sflow.c \
183 print-sip.c \
184 print-sl.c \
185 print-sll.c \
186 print-slow.c \
187 print-snmp.c \
188 print-stp.c \
189 print-sunatm.c \
190 print-sunrpc.c \
191 print-symantec.c \
192 print-syslog.c \
193 print-tcp.c \
194 print-telnet.c \
195 print-tftp.c \
196 print-timed.c \
197 print-tipc.c \
198 print-token.c \
199 print-udld.c \
200 print-udp.c \
201 print-usb.c \
202 print-vjc.c \
203 print-vqp.c \
204 print-vrrp.c \
205 print-vtp.c \
206 print-vxlan.c \
207 print-wb.c \
208 print-zephyr.c \
209 print-zeromq.c \
210 signature.c \
211 util.c
212
213 LOCALSRC = @LOCALSRC@
214 GENSRC = version.c
215 LIBOBJS = @LIBOBJS@
216
217 LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) ${LOCALSRC:.c=.o} ${LIBOBJS}
218 LIBNETDISSECT=libnetdissect.a
219
220
221 SRC = $(CSRC) $(GENSRC) $(LOCALSRC) $(LIBNETDISSECT_SRC)
222
223 # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
224 # hack the extra indirection
225 OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) $(LIBNETDISSECT_OBJ)
226 HDR = \
227 addrtoname.h \
228 af.h \
229 ah.h \
230 appletalk.h \
231 atm.h \
232 atmuni31.h \
233 bootp.h \
234 chdlc.h \
235 cpack.h \
236 ether.h \
237 ethertype.h \
238 extract.h \
239 getopt_long.h \
240 gmpls.h \
241 gmt2local.h \
242 interface.h \
243 interface.h \
244 ip.h \
245 ip6.h \
246 ipproto.h \
247 l2vpn.h \
248 llc.h \
249 machdep.h \
250 mib.h \
251 mpls.h \
252 nameser.h \
253 netdissect.h \
254 nfs.h \
255 nfsfh.h \
256 nlpid.h \
257 openflow.h \
258 ospf.h \
259 oui.h \
260 pcap-missing.h \
261 ppp.h \
262 rpc_auth.h \
263 rpc_msg.h \
264 rpl.h \
265 setsignal.h \
266 signature.h \
267 slcompress.h \
268 smb.h \
269 tcp.h \
270 tcpdump-stdinc.h \
271 udp.h
272
273 TAGHDR = \
274 /usr/include/arpa/tftp.h \
275 /usr/include/net/if_arp.h \
276 /usr/include/net/slip.h \
277 /usr/include/netinet/if_ether.h \
278 /usr/include/netinet/in.h \
279 /usr/include/netinet/ip_icmp.h \
280 /usr/include/netinet/tcp.h \
281 /usr/include/netinet/udp.h \
282 /usr/include/protocols/routed.h
283
284 TAGFILES = $(SRC) $(HDR) $(TAGHDR)
285
286 CLEANFILES = $(PROG) $(OBJ) $(GENSRC)
287
288 EXTRA_DIST = \
289 CHANGES \
290 CREDITS \
291 INSTALL.txt \
292 LICENSE \
293 Makefile.in \
294 Makefile-devel-adds \
295 README.md \
296 Readme.Win32 \
297 VERSION \
298 aclocal.m4 \
299 atime.awk \
300 bpf_dump.c \
301 config.guess \
302 config.h.in \
303 config.sub \
304 configure \
305 configure.in \
306 install-sh \
307 lbl/os-osf4.h \
308 lbl/os-solaris2.h \
309 lbl/os-sunos4.h \
310 lbl/os-ultrix4.h \
311 makemib \
312 missing/addrinfo.h \
313 missing/dlnames.c \
314 missing/datalinks.c \
315 missing/getnameinfo.c \
316 missing/getopt_long.c \
317 missing/inet_aton.c \
318 missing/inet_ntop.c \
319 missing/inet_pton.c \
320 missing/snprintf.c \
321 missing/strdup.c \
322 missing/strlcat.c \
323 missing/strlcpy.c \
324 missing/strsep.c \
325 mkdep \
326 packetdat.awk \
327 pcap_dump_ftell.c \
328 print-babel.c \
329 print-dhcp6.c \
330 print-frag6.c \
331 print-icmp6.c \
332 print-ip6.c \
333 print-ip6opts.c \
334 print-mobility.c \
335 print-ospf6.c \
336 print-pflog.c \
337 print-ripng.c \
338 print-rt6.c \
339 print-smb.c \
340 send-ack.awk \
341 smbutil.c \
342 stime.awk \
343 strcasecmp.c \
344 tcpdump.1.in \
345 vfprintf.c \
346 win32/Include/w32_fzs.h \
347 win32/prj/GNUmakefile \
348 win32/prj/WinDump.dsp \
349 win32/prj/WinDump.dsw
350
351 TEST_DIST= `find tests \( -name 'DIFF' -prune \) -o \( -name NEW -prune \) -o -type f \! -name '.*' \! -name '*~' -print`
352
353 all: $(PROG) $(LIBNETDISSECT)
354
355 $(PROG): $(OBJ) @V_PCAPDEP@
356 @rm -f $@
357 $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
358
359 $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ)
360 @rm -f $@
361 $(AR) cr $@ $(LIBNETDISSECT_OBJ)
362 $(RANLIB) $@
363
364 datalinks.o: $(srcdir)/missing/datalinks.c
365 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c
366 dlnames.o: $(srcdir)/missing/dlnames.c
367 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c
368 getnameinfo.o: $(srcdir)/missing/getnameinfo.c
369 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getnameinfo.c
370 getopt_long.o: $(srcdir)/missing/getopt_long.c
371 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getopt_long.c
372 inet_pton.o: $(srcdir)/missing/inet_pton.c
373 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_pton.c
374 inet_ntop.o: $(srcdir)/missing/inet_ntop.c
375 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_ntop.c
376 inet_aton.o: $(srcdir)/missing/inet_aton.c
377 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_aton.c
378 snprintf.o: $(srcdir)/missing/snprintf.c
379 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
380 strdup.o: $(srcdir)/missing/strdup.c
381 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strdup.c
382 strlcat.o: $(srcdir)/missing/strlcat.c
383 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c
384 strlcpy.o: $(srcdir)/missing/strlcpy.c
385 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c
386 strsep.o: $(srcdir)/missing/strsep.c
387 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c
388
389 version.o: version.c
390 $(CC) $(FULL_CFLAGS) -c version.c
391
392 version.c: $(srcdir)/VERSION
393 @rm -f $@
394 if grep GIT ${srcdir}/VERSION >/dev/null; then \
395 read ver <${srcdir}/VERSION; \
396 echo $$ver | tr -d '\012'; \
397 date +_%Y_%m_%d; \
398 else \
399 cat ${srcdir}/VERSION; \
400 fi | sed -e 's/.*/const char version[] = "&";/' > $@
401
402 install: all
403 [ -d $(DESTDIR)$(sbindir) ] || \
404 (mkdir -p $(DESTDIR)$(sbindir); chmod 755 $(DESTDIR)$(sbindir))
405 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG)
406 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG).`cat ${srcdir}/VERSION`
407 [ -d $(DESTDIR)$(mandir)/man1 ] || \
408 (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1)
409 $(INSTALL_DATA) $(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1
410
411 uninstall:
412 rm -f $(DESTDIR)$(sbindir)/$(PROG)
413 rm -f $(DESTDIR)$(mandir)/man1/$(PROG).1
414
415 lint: $(GENSRC)
416 lint -hbxn $(SRC) | \
417 grep -v 'struct/union .* never defined' | \
418 grep -v 'possible pointer alignment problem'
419
420 clean:
421 rm -f $(CLEANFILES) $(PROG)-`cat VERSION`.tar.gz
422
423 distclean:
424 rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
425 config.h gnuc.h os-proto.h stamp-h stamp-h.in $(PROG).1 \
426 libnetdissect.a tests/.failed tests/.passed \
427 tests/failure-outputs.txt
428 rm -rf autom4te.cache tests/DIFF tests/NEW
429
430 check: tcpdump
431 (cd tests && ./TESTrun.sh)
432
433 tags: $(TAGFILES)
434 ctags -wtd $(TAGFILES)
435
436 TAGS: $(TAGFILES)
437 etags $(TAGFILES)
438
439 releasetar:
440 @cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \
441 mkdir $$name; \
442 tar cf - $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) $(TEST_DIST) | (cd $$name; tar xf -); \
443 tar -c -z -f $$name.tar.gz $$name; \
444 rm -rf $$name
445
446 testlist:
447 echo $(TEST_DIST)
448
449 depend: $(GENSRC)
450 $(MKDEP) -c $(CC) -m $(DEPENDENCY_CFLAG) $(DEFS) $(INCLS) $(SRC)