]> The Tcpdump Group git mirrors - tcpdump/blob - Makefile.in
rt6: parse TLV
[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 bindir = @bindir@
30 # Pathname of directory to install the man page
31 mandir = @mandir@
32
33 # VPATH
34 srcdir = @srcdir@
35 top_srcdir = @top_srcdir@
36 VPATH = @srcdir@
37
38 #
39 # You shouldn't need to edit anything below here.
40 #
41
42 CC = @CC@
43 AR = @AR@
44 MKDEP = @MKDEP@
45 PROG = tcpdump
46 CCOPT = @V_CCOPT@
47 INCLS = -I. @V_INCLS@
48 DEFS = @DEFS@ @CPPFLAGS@ @V_DEFS@
49
50 # Standard CFLAGS
51 CFLAGS = @CFLAGS@
52 FULL_CFLAGS = $(CCOPT) $(DEFS) $(INCLS) $(CFLAGS)
53
54 # Standard LDFLAGS
55 LDFLAGS = @LDFLAGS@
56
57 # Standard LIBS
58 LIBS = @LIBS@
59
60 INSTALL = @INSTALL@
61 INSTALL_PROGRAM = @INSTALL_PROGRAM@
62 INSTALL_DATA = @INSTALL_DATA@
63 RANLIB = @RANLIB@
64
65 DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@
66
67 # Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
68 # Also, gcc does not remove the .o before forking 'as', which can be a
69 # problem if you don't own the file but can write to the directory.
70 .c.o:
71 @rm -f $@
72 $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c
73
74 CSRC = fptype.c tcpdump.c
75
76 LIBNETDISSECT_SRC=\
77 addrtoname.c \
78 addrtostr.c \
79 af.c \
80 ascii_strcasecmp.c \
81 checksum.c \
82 cpack.c \
83 gmpls.c \
84 in_cksum.c \
85 ipproto.c \
86 l2vpn.c \
87 machdep.c \
88 netdissect.c \
89 netdissect-alloc.c \
90 nlpid.c \
91 ntp.c \
92 oui.c \
93 parsenfsfh.c \
94 print.c \
95 print-802_11.c \
96 print-802_15_4.c \
97 print-ah.c \
98 print-ahcp.c \
99 print-aodv.c \
100 print-aoe.c \
101 print-ap1394.c \
102 print-arcnet.c \
103 print-arista.c \
104 print-arp.c \
105 print-ascii.c \
106 print-atalk.c \
107 print-atm.c \
108 print-babel.c \
109 print-bcm-li.c \
110 print-beep.c \
111 print-bfd.c \
112 print-bgp.c \
113 print-bootp.c \
114 print-brcmtag.c \
115 print-bt.c \
116 print-calm-fast.c \
117 print-carp.c \
118 print-cdp.c \
119 print-cfm.c \
120 print-chdlc.c \
121 print-cip.c \
122 print-cnfp.c \
123 print-dccp.c \
124 print-decnet.c \
125 print-dhcp6.c \
126 print-domain.c \
127 print-dsa.c \
128 print-dtp.c \
129 print-dvmrp.c \
130 print-eap.c \
131 print-egp.c \
132 print-eigrp.c \
133 print-enc.c \
134 print-esp.c \
135 print-ether.c \
136 print-fddi.c \
137 print-forces.c \
138 print-fr.c \
139 print-frag6.c \
140 print-ftp.c \
141 print-geneve.c \
142 print-geonet.c \
143 print-gre.c \
144 print-hncp.c \
145 print-hsrp.c \
146 print-http.c \
147 print-icmp.c \
148 print-icmp6.c \
149 print-igmp.c \
150 print-igrp.c \
151 print-ip-demux.c \
152 print-ip.c \
153 print-ip6.c \
154 print-ip6opts.c \
155 print-ipcomp.c \
156 print-ipfc.c \
157 print-ipnet.c \
158 print-ipoib.c \
159 print-ipx.c \
160 print-isakmp.c \
161 print-isoclns.c \
162 print-juniper.c \
163 print-krb.c \
164 print-l2tp.c \
165 print-lane.c \
166 print-ldp.c \
167 print-lisp.c \
168 print-llc.c \
169 print-lldp.c \
170 print-lmp.c \
171 print-loopback.c \
172 print-lspping.c \
173 print-lwapp.c \
174 print-lwres.c \
175 print-m3ua.c \
176 print-macsec.c \
177 print-mobile.c \
178 print-mobility.c \
179 print-mpcp.c \
180 print-mpls.c \
181 print-mptcp.c \
182 print-msdp.c \
183 print-msnlb.c \
184 print-nflog.c \
185 print-nfs.c \
186 print-nhrp.c \
187 print-nsh.c \
188 print-ntp.c \
189 print-null.c \
190 print-olsr.c \
191 print-openflow-1.0.c \
192 print-openflow-1.3.c \
193 print-openflow.c \
194 print-ospf.c \
195 print-ospf6.c \
196 print-otv.c \
197 print-pflog.c \
198 print-pgm.c \
199 print-pim.c \
200 print-pktap.c \
201 print-ppi.c \
202 print-ppp.c \
203 print-pppoe.c \
204 print-pptp.c \
205 print-ptp.c \
206 print-quic.c \
207 print-radius.c \
208 print-raw.c \
209 print-realtek.c \
210 print-resp.c \
211 print-rip.c \
212 print-ripng.c \
213 print-rpki-rtr.c \
214 print-rsvp.c \
215 print-rt6.c \
216 print-rtsp.c \
217 print-rx.c \
218 print-sctp.c \
219 print-sflow.c \
220 print-sip.c \
221 print-sl.c \
222 print-sll.c \
223 print-slow.c \
224 print-smtp.c \
225 print-snmp.c \
226 print-someip.c \
227 print-ssh.c \
228 print-stp.c \
229 print-sunatm.c \
230 print-sunrpc.c \
231 print-symantec.c \
232 print-syslog.c \
233 print-tcp.c \
234 print-telnet.c \
235 print-tftp.c \
236 print-timed.c \
237 print-tipc.c \
238 print-token.c \
239 print-udld.c \
240 print-udp.c \
241 print-unsupported.c \
242 print-usb.c \
243 print-vjc.c \
244 print-vqp.c \
245 print-vrrp.c \
246 print-vsock.c \
247 print-vtp.c \
248 print-vxlan-gpe.c \
249 print-vxlan.c \
250 print-wb.c \
251 print-whois.c \
252 print-zep.c \
253 print-zephyr.c \
254 print-zeromq.c \
255 signature.c \
256 strtoaddr.c \
257 util-print.c
258
259 LOCALSRC = @LOCALSRC@
260 LIBOBJS = @LIBOBJS@
261
262 LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) ${LOCALSRC:.c=.o} ${LIBOBJS}
263 LIBNETDISSECT=libnetdissect.a
264
265
266 SRC = $(CSRC) $(LOCALSRC)
267
268 OBJ = $(CSRC:.c=.o)
269 HDR = \
270 addrtoname.h \
271 addrtostr.h \
272 af.h \
273 ah.h \
274 appletalk.h \
275 ascii_strcasecmp.h \
276 atm.h \
277 chdlc.h \
278 compiler-tests.h \
279 cpack.h \
280 diag-control.h \
281 ethertype.h \
282 extract.h \
283 fptype.h \
284 ftmacros.h \
285 funcattrs.h \
286 getservent.h \
287 gmpls.h \
288 interface.h \
289 ip.h \
290 ip6.h \
291 ipproto.h \
292 l2vpn.h \
293 llc.h \
294 machdep.h \
295 mib.h \
296 mpls.h \
297 nameser.h \
298 netdissect.h \
299 netdissect-alloc.h \
300 netdissect-ctype.h \
301 netdissect-stdinc.h \
302 nfs.h \
303 nfsfh.h \
304 nlpid.h \
305 ntp.h \
306 openflow.h \
307 ospf.h \
308 oui.h \
309 pcap-missing.h \
310 pflog.h \
311 ppp.h \
312 print.h \
313 rpc_auth.h \
314 rpc_msg.h \
315 signature.h \
316 slcompress.h \
317 smb.h \
318 status-exit-codes.h \
319 strtoaddr.h \
320 tcp.h \
321 timeval-operations.h \
322 udp.h \
323 varattrs.h
324
325 TAGHDR = \
326 /usr/include/netinet/if_ether.h \
327 /usr/include/netinet/in.h
328
329 TAGFILES = $(SRC) $(HDR) $(TAGHDR) $(LIBNETDISSECT_SRC) \
330 print-smb.c smbutil.c
331
332 CLEANFILES = $(PROG) $(OBJ) $(LIBNETDISSECT_OBJ) \
333 print-smb.o smbutil.o instrument-functions.o
334
335 EXTRA_DIST = \
336 CHANGES \
337 CMakeLists.txt \
338 CONTRIBUTING.md \
339 CREDITS \
340 INSTALL.md \
341 LICENSE \
342 Makefile-devel-adds \
343 Makefile.in \
344 README.md \
345 VERSION \
346 aclocal.m4 \
347 autogen.sh \
348 atime.awk \
349 bpf_dump.c \
350 cmake/Modules/FindCRYPTO.cmake \
351 cmake/Modules/FindPCAP.cmake \
352 cmake/Modules/FindSMI.cmake \
353 cmake_uninstall.cmake.in \
354 cmakeconfig.h.in \
355 config.guess \
356 config.sub \
357 configure.ac \
358 doc/README.aix.md \
359 doc/README.haiku.md \
360 doc/README.NetBSD.md \
361 doc/README.solaris.md \
362 doc/README.Win32.md \
363 install-sh \
364 instrument-functions.c \
365 makemib \
366 missing/datalinks.c \
367 missing/dlnames.c \
368 missing/getopt_long.c \
369 missing/getopt_long.h \
370 missing/getservent.c \
371 missing/pcap_dump_ftell.c \
372 missing/strlcat.c \
373 missing/strlcpy.c \
374 missing/strsep.c \
375 mkdep \
376 packetdat.awk \
377 print-smb.c \
378 send-ack.awk \
379 smbutil.c \
380 stime.awk \
381 tcpdump.1.in
382
383 TEST_DIST= `git -C "$$DIR" ls-files tests | grep -v 'tests/\..*'`
384
385 RELEASE_FILES = $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) $(TEST_DIST)
386
387 all: $(PROG)
388
389 $(PROG): $(OBJ) @V_PCAPDEP@ $(LIBNETDISSECT)
390 @rm -f $@
391 $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBNETDISSECT) $(LIBS)
392
393 $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ)
394 @rm -f $@
395 $(AR) cr $@ $(LIBNETDISSECT_OBJ)
396 $(RANLIB) $@
397
398 datalinks.o: $(srcdir)/missing/datalinks.c
399 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c
400 dlnames.o: $(srcdir)/missing/dlnames.c
401 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c
402 getservent.o: $(srcdir)/missing/getservent.c
403 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getservent.c
404 getopt_long.o: $(srcdir)/missing/getopt_long.c
405 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getopt_long.c
406 strlcat.o: $(srcdir)/missing/strlcat.c
407 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c
408 strlcpy.o: $(srcdir)/missing/strlcpy.c
409 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c
410 strsep.o: $(srcdir)/missing/strsep.c
411 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c
412 pcap_dump_ftell.o: $(srcdir)/missing/pcap_dump_ftell.c
413 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/pcap_dump_ftell.c
414
415 install: all
416 [ -d $(DESTDIR)$(bindir) ] || \
417 (mkdir -p $(DESTDIR)$(bindir); chmod 755 $(DESTDIR)$(bindir))
418 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(bindir)/$(PROG)
419 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(bindir)/$(PROG).`cat ${srcdir}/VERSION`
420 [ -d $(DESTDIR)$(mandir)/man1 ] || \
421 (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1)
422 $(INSTALL_DATA) $(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1
423
424 uninstall:
425 rm -f $(DESTDIR)$(bindir)/$(PROG)
426 rm -f $(DESTDIR)$(bindir)/$(PROG).`cat ${srcdir}/VERSION`
427 rm -f $(DESTDIR)$(mandir)/man1/$(PROG).1
428
429 lint:
430 lint -hbxn $(SRC) $(LIBNETDISSECT_SRC) | \
431 grep -v 'struct/union .* never defined' | \
432 grep -v 'possible pointer alignment problem'
433
434 clean:
435 rm -f $(CLEANFILES) $(PROG)-`cat ${srcdir}/VERSION`.tar.gz \
436 config.h.in~ configure~ configure.ac~
437
438 distclean: clean
439 rm -f Makefile config.cache config.log config.status \
440 config.h os-proto.h stamp-h stamp-h.in $(PROG).1 \
441 libnetdissect.a tests/.failed tests/.passed \
442 tests/failure-outputs.txt
443 rm -rf autom4te.cache tests/DIFF tests/NEW
444
445 check: tcpdump
446 $(srcdir)/tests/TESTrun
447
448 extags: $(TAGFILES)
449 ctags $(TAGFILES)
450
451 tags: $(TAGFILES)
452 ctags -wtd $(TAGFILES)
453
454 TAGS: $(TAGFILES)
455 etags $(TAGFILES)
456
457 #
458 # Use git archive piped to tar to construct a subdirectory whose name
459 # is tcpdump-{release}, containing all the checked-in source files,
460 # and then run autoreconf in that directory to generate the configure
461 # script and other files from that source. Then remove autom4te.cache,
462 # construct the release tarball from that subdirectory, and remove
463 # the subdirectory.
464 #
465 # The --format=tar is to force git archive to write a non-compressed
466 # archive, in case the platform's tar command doesn't have built-in
467 # decompression.
468 #
469 # The ^{tree} is there to force git archive not to write out the
470 # "helpful" global extended pax header with a commit ID, as not all
471 # versions of tar can handle that (Solaris tar can't, for example).
472 # (It turns HEAD, or a tag, both of which are apparently "tree-ish"es,
473 # into a tree; apparently, unlike HEAD, or a tag, which have a commit
474 # ID associated with them, the tree associated with them doesn't have
475 # a commit ID, so no commit ID is available to write, and thus
476 # git archive doesn't write one.)
477 #
478 releasetar:
479 @TAG=$(PROG)-`cat VERSION` && \
480 if [ ! -d .git ]; then echo 'Not in a git clone, stop.'; exit 1; fi && \
481 TMPTESTFILE=`mktemp -t tmptestfile_XXXXXXXX` && \
482 rm -f "$$TMPTESTFILE" && \
483 AUTORECONF_DIR=`dirname "$$TMPTESTFILE"`/"$(PROG)"_build_autoreconf_$$$$ && \
484 DIR=`pwd` && \
485 rm -rf "$$AUTORECONF_DIR" && \
486 mkdir "$$AUTORECONF_DIR" && \
487 cd "$$AUTORECONF_DIR" && \
488 if git -C "$$DIR" show-ref --tags --quiet --verify -- "refs/tags/$$TAG"; then \
489 (git -C "$$DIR" archive --format=tar --prefix="$$TAG"/ "$$TAG^{tree}" $(RELEASE_FILES) | \
490 tar xf -) && \
491 echo "Archive build from tag $$TAG."; \
492 else \
493 (git -C "$$DIR" archive --format=tar --prefix="$$TAG"/ "HEAD^{tree}" $(RELEASE_FILES) | \
494 tar xf -) && \
495 echo "No $$TAG tag. Archive build from HEAD."; \
496 fi && \
497 (cd "$$TAG" && "$${AUTORECONF:-autoreconf}" && rm -rf autom4te.cache) && \
498 tar cf "$$DIR/$$TAG".tar "$$TAG" && \
499 rm -f "$$DIR/$$TAG".tar.gz && \
500 gzip --best "$$DIR/$$TAG".tar && \
501 cd "$$DIR" && \
502 rm -rf "$$AUTORECONF_DIR"
503
504 releasecheck: releasetar
505 @TAG=$(PROG)-`cat VERSION` && \
506 INSTALL_DIR=/tmp/install_"$$TAG"_$$$$ && \
507 DIR=`pwd` && \
508 cd /tmp && \
509 rm -rf "$$TAG" && \
510 rm -rf "$$INSTALL_DIR" && \
511 tar xf "$$DIR"/"$$TAG".tar.gz && \
512 cd "$$TAG" && \
513 echo "[$@] $$ ./configure --enable-smb --quiet --prefix=$$INSTALL_DIR" && \
514 ./configure --enable-smb --quiet --prefix="$$INSTALL_DIR" && \
515 echo '[$@] $$ make -s all check' && \
516 make -s all check >/dev/null && \
517 echo '[$@] $$ make -s install' && \
518 make -s install && \
519 cd .. && \
520 rm -rf "$$TAG" && \
521 rm -rf "$$INSTALL_DIR" && \
522 tar xf "$$DIR"/"$$TAG".tar.gz && \
523 cd "$$TAG" && \
524 mkdir build && \
525 cd build && \
526 echo '[$@] $$ cmake -DENABLE_SMB=yes [...] ..' && \
527 cmake -DENABLE_SMB=yes \
528 -DCMAKE_INSTALL_PREFIX="$$INSTALL_DIR" \
529 -DCMAKE_MESSAGE_LOG_LEVEL=NOTICE \
530 -DCMAKE_RULE_MESSAGES=OFF \
531 -DCMAKE_INSTALL_MESSAGE=NEVER \
532 .. && \
533 echo '[$@] $$ make -s all check' && \
534 make -s all check >/dev/null && \
535 echo '[$@] $$ make -s install' && \
536 make -s install && \
537 cd ../.. && \
538 rm -rf "$$TAG" && \
539 rm -rf "$$INSTALL_DIR" && \
540 echo '[$@] Done.'
541
542 whitespacecheck:
543 @# trailing space(s)?
544 @if git grep -I -n ' $$' $$(git ls-files|grep -v '^tests/'); then \
545 echo 'Error: Trailing space(s).'; \
546 exit 1; \
547 fi
548 @# trailing tab(s)?
549 @# install-sh has a tab at the end of one line
550 @if git grep -I -n ' $$' $$(git ls-files|grep -vE '^(tests/|install-sh$$)'); then \
551 echo 'Error: Trailing tabs(s).'; \
552 exit 1; \
553 fi
554 @# space(s) before tab(s)?
555 @if git grep -I -n '[ ][ ]' $$(git ls-files|grep -v '^tests/'); then \
556 echo 'Error: space(s) before tab(s).'; \
557 exit 1; \
558 fi
559
560 testlist:
561 echo $(TEST_DIST)
562
563 depend:
564 $(MKDEP) -c "$(CC)" -m "$(DEPENDENCY_CFLAG)" -s "$(srcdir)" $(DEFS) $(INCLS) $(SRC) $(LIBNETDISSECT_SRC)
565
566 shellcheck:
567 shellcheck -f gcc -e SC2006 build.sh build_matrix.sh build_common.sh