]> The Tcpdump Group git mirrors - tcpdump/blob - Makefile.in
gre, erspan: add an ERSPAN dissector and have the GRE dissector call it.
[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-erspan.c \
135 print-esp.c \
136 print-ether.c \
137 print-fddi.c \
138 print-forces.c \
139 print-fr.c \
140 print-frag6.c \
141 print-ftp.c \
142 print-geneve.c \
143 print-geonet.c \
144 print-gre.c \
145 print-hncp.c \
146 print-hsrp.c \
147 print-http.c \
148 print-icmp.c \
149 print-icmp6.c \
150 print-igmp.c \
151 print-igrp.c \
152 print-ip-demux.c \
153 print-ip.c \
154 print-ip6.c \
155 print-ip6opts.c \
156 print-ipcomp.c \
157 print-ipfc.c \
158 print-ipnet.c \
159 print-ipoib.c \
160 print-ipx.c \
161 print-isakmp.c \
162 print-isoclns.c \
163 print-juniper.c \
164 print-krb.c \
165 print-l2tp.c \
166 print-lane.c \
167 print-ldp.c \
168 print-lisp.c \
169 print-llc.c \
170 print-lldp.c \
171 print-lmp.c \
172 print-loopback.c \
173 print-lspping.c \
174 print-lwapp.c \
175 print-lwres.c \
176 print-m3ua.c \
177 print-macsec.c \
178 print-mobile.c \
179 print-mobility.c \
180 print-mpcp.c \
181 print-mpls.c \
182 print-mptcp.c \
183 print-msdp.c \
184 print-msnlb.c \
185 print-nflog.c \
186 print-nfs.c \
187 print-nhrp.c \
188 print-nsh.c \
189 print-ntp.c \
190 print-null.c \
191 print-olsr.c \
192 print-openflow-1.0.c \
193 print-openflow-1.3.c \
194 print-openflow.c \
195 print-ospf.c \
196 print-ospf6.c \
197 print-otv.c \
198 print-pflog.c \
199 print-pgm.c \
200 print-pim.c \
201 print-pktap.c \
202 print-ppi.c \
203 print-ppp.c \
204 print-pppoe.c \
205 print-pptp.c \
206 print-ptp.c \
207 print-quic.c \
208 print-radius.c \
209 print-raw.c \
210 print-realtek.c \
211 print-resp.c \
212 print-rip.c \
213 print-ripng.c \
214 print-rpki-rtr.c \
215 print-rsvp.c \
216 print-rt6.c \
217 print-rtsp.c \
218 print-rx.c \
219 print-sctp.c \
220 print-sflow.c \
221 print-sip.c \
222 print-sl.c \
223 print-sll.c \
224 print-slow.c \
225 print-smtp.c \
226 print-snmp.c \
227 print-someip.c \
228 print-ssh.c \
229 print-stp.c \
230 print-sunatm.c \
231 print-sunrpc.c \
232 print-symantec.c \
233 print-syslog.c \
234 print-tcp.c \
235 print-telnet.c \
236 print-tftp.c \
237 print-timed.c \
238 print-tipc.c \
239 print-token.c \
240 print-udld.c \
241 print-udp.c \
242 print-unsupported.c \
243 print-usb.c \
244 print-vjc.c \
245 print-vqp.c \
246 print-vrrp.c \
247 print-vsock.c \
248 print-vtp.c \
249 print-vxlan-gpe.c \
250 print-vxlan.c \
251 print-wb.c \
252 print-whois.c \
253 print-zep.c \
254 print-zephyr.c \
255 print-zeromq.c \
256 signature.c \
257 strtoaddr.c \
258 util-print.c
259
260 LOCALSRC = @LOCALSRC@
261 LIBOBJS = @LIBOBJS@
262
263 LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) ${LOCALSRC:.c=.o} ${LIBOBJS}
264 LIBNETDISSECT=libnetdissect.a
265
266
267 SRC = $(CSRC) $(LOCALSRC)
268
269 OBJ = $(CSRC:.c=.o)
270 HDR = \
271 addrtoname.h \
272 addrtostr.h \
273 af.h \
274 ah.h \
275 appletalk.h \
276 ascii_strcasecmp.h \
277 atm.h \
278 chdlc.h \
279 compiler-tests.h \
280 cpack.h \
281 diag-control.h \
282 ethertype.h \
283 extract.h \
284 fptype.h \
285 ftmacros.h \
286 funcattrs.h \
287 getservent.h \
288 gmpls.h \
289 interface.h \
290 ip.h \
291 ip6.h \
292 ipproto.h \
293 l2vpn.h \
294 llc.h \
295 machdep.h \
296 mib.h \
297 mpls.h \
298 nameser.h \
299 netdissect.h \
300 netdissect-alloc.h \
301 netdissect-ctype.h \
302 netdissect-stdinc.h \
303 nfs.h \
304 nfsfh.h \
305 nlpid.h \
306 ntp.h \
307 openflow.h \
308 ospf.h \
309 oui.h \
310 pcap-missing.h \
311 pflog.h \
312 ppp.h \
313 print.h \
314 rpc_auth.h \
315 rpc_msg.h \
316 signature.h \
317 slcompress.h \
318 smb.h \
319 status-exit-codes.h \
320 strtoaddr.h \
321 tcp.h \
322 timeval-operations.h \
323 udp.h \
324 varattrs.h
325
326 TAGHDR = \
327 /usr/include/netinet/if_ether.h \
328 /usr/include/netinet/in.h
329
330 TAGFILES = $(SRC) $(HDR) $(TAGHDR) $(LIBNETDISSECT_SRC) \
331 print-smb.c smbutil.c
332
333 CLEANFILES = $(PROG) $(OBJ) $(LIBNETDISSECT_OBJ) \
334 print-smb.o smbutil.o instrument-functions.o
335
336 EXTRA_DIST = \
337 CHANGES \
338 CMakeLists.txt \
339 CONTRIBUTING.md \
340 CREDITS \
341 INSTALL.md \
342 LICENSE \
343 Makefile-devel-adds \
344 Makefile.in \
345 README.md \
346 VERSION \
347 aclocal.m4 \
348 autogen.sh \
349 atime.awk \
350 bpf_dump.c \
351 cmake/Modules/FindCRYPTO.cmake \
352 cmake/Modules/FindPCAP.cmake \
353 cmake/Modules/FindSMI.cmake \
354 cmake_uninstall.cmake.in \
355 cmakeconfig.h.in \
356 config.guess \
357 config.sub \
358 configure.ac \
359 doc/README.aix.md \
360 doc/README.haiku.md \
361 doc/README.NetBSD.md \
362 doc/README.solaris.md \
363 doc/README.Win32.md \
364 install-sh \
365 instrument-functions.c \
366 makemib \
367 missing/datalinks.c \
368 missing/dlnames.c \
369 missing/getopt_long.c \
370 missing/getopt_long.h \
371 missing/getservent.c \
372 missing/pcap_dump_ftell.c \
373 missing/strlcat.c \
374 missing/strlcpy.c \
375 missing/strsep.c \
376 mkdep \
377 packetdat.awk \
378 print-smb.c \
379 send-ack.awk \
380 smbutil.c \
381 stime.awk \
382 tcpdump.1.in
383
384 TEST_DIST= `git -C "$$DIR" ls-files tests | grep -v 'tests/\..*'`
385
386 RELEASE_FILES = $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) $(TEST_DIST)
387
388 all: $(PROG)
389
390 $(PROG): $(OBJ) @V_PCAPDEP@ $(LIBNETDISSECT)
391 @rm -f $@
392 $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBNETDISSECT) $(LIBS)
393
394 $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ)
395 @rm -f $@
396 $(AR) cr $@ $(LIBNETDISSECT_OBJ)
397 $(RANLIB) $@
398
399 datalinks.o: $(srcdir)/missing/datalinks.c
400 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c
401 dlnames.o: $(srcdir)/missing/dlnames.c
402 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c
403 getservent.o: $(srcdir)/missing/getservent.c
404 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getservent.c
405 getopt_long.o: $(srcdir)/missing/getopt_long.c
406 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getopt_long.c
407 strlcat.o: $(srcdir)/missing/strlcat.c
408 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c
409 strlcpy.o: $(srcdir)/missing/strlcpy.c
410 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c
411 strsep.o: $(srcdir)/missing/strsep.c
412 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c
413 pcap_dump_ftell.o: $(srcdir)/missing/pcap_dump_ftell.c
414 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/pcap_dump_ftell.c
415
416 install: all
417 [ -d $(DESTDIR)$(bindir) ] || \
418 (mkdir -p $(DESTDIR)$(bindir); chmod 755 $(DESTDIR)$(bindir))
419 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(bindir)/$(PROG)
420 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(bindir)/$(PROG).`cat ${srcdir}/VERSION`
421 [ -d $(DESTDIR)$(mandir)/man1 ] || \
422 (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1)
423 $(INSTALL_DATA) $(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1
424
425 uninstall:
426 rm -f $(DESTDIR)$(bindir)/$(PROG)
427 rm -f $(DESTDIR)$(bindir)/$(PROG).`cat ${srcdir}/VERSION`
428 rm -f $(DESTDIR)$(mandir)/man1/$(PROG).1
429
430 lint:
431 lint -hbxn $(SRC) $(LIBNETDISSECT_SRC) | \
432 grep -v 'struct/union .* never defined' | \
433 grep -v 'possible pointer alignment problem'
434
435 clean:
436 rm -f $(CLEANFILES) $(PROG)-`cat ${srcdir}/VERSION`.tar.gz \
437 config.h.in~ configure~ configure.ac~
438
439 distclean: clean
440 rm -f Makefile config.cache config.log config.status \
441 config.h os-proto.h stamp-h stamp-h.in $(PROG).1 \
442 libnetdissect.a tests/.failed tests/.passed \
443 tests/failure-outputs.txt
444 rm -rf autom4te.cache tests/DIFF tests/NEW
445
446 check: tcpdump
447 $(srcdir)/tests/TESTrun
448
449 extags: $(TAGFILES)
450 ctags $(TAGFILES)
451
452 tags: $(TAGFILES)
453 ctags -wtd $(TAGFILES)
454
455 TAGS: $(TAGFILES)
456 etags $(TAGFILES)
457
458 #
459 # Use git archive piped to tar to construct a subdirectory whose name
460 # is tcpdump-{release}, containing all the checked-in source files,
461 # and then run autoreconf in that directory to generate the configure
462 # script and other files from that source. Then remove autom4te.cache,
463 # construct the release tarball from that subdirectory, and remove
464 # the subdirectory.
465 #
466 # The --format=tar is to force git archive to write a non-compressed
467 # archive, in case the platform's tar command doesn't have built-in
468 # decompression.
469 #
470 # The ^{tree} is there to force git archive not to write out the
471 # "helpful" global extended pax header with a commit ID, as not all
472 # versions of tar can handle that (Solaris tar can't, for example).
473 # (It turns HEAD, or a tag, both of which are apparently "tree-ish"es,
474 # into a tree; apparently, unlike HEAD, or a tag, which have a commit
475 # ID associated with them, the tree associated with them doesn't have
476 # a commit ID, so no commit ID is available to write, and thus
477 # git archive doesn't write one.)
478 #
479 releasetar:
480 @TAG=$(PROG)-`cat VERSION` && \
481 if [ ! -d .git ]; then echo 'Not in a git clone, stop.'; exit 1; fi && \
482 TMPTESTFILE=`mktemp -t tmptestfile_XXXXXXXX` && \
483 rm -f "$$TMPTESTFILE" && \
484 AUTORECONF_DIR=`dirname "$$TMPTESTFILE"`/"$(PROG)"_build_autoreconf_$$$$ && \
485 DIR=`pwd` && \
486 rm -rf "$$AUTORECONF_DIR" && \
487 mkdir "$$AUTORECONF_DIR" && \
488 cd "$$AUTORECONF_DIR" && \
489 if git -C "$$DIR" show-ref --tags --quiet --verify -- "refs/tags/$$TAG"; then \
490 (git -C "$$DIR" archive --format=tar --prefix="$$TAG"/ "$$TAG^{tree}" $(RELEASE_FILES) | \
491 tar xf -) && \
492 echo "Archive build from tag $$TAG."; \
493 else \
494 (git -C "$$DIR" archive --format=tar --prefix="$$TAG"/ "HEAD^{tree}" $(RELEASE_FILES) | \
495 tar xf -) && \
496 echo "No $$TAG tag. Archive build from HEAD."; \
497 fi && \
498 (cd "$$TAG" && "$${AUTORECONF:-autoreconf}" && rm -rf autom4te.cache) && \
499 tar cf "$$DIR/$$TAG".tar "$$TAG" && \
500 rm -f "$$DIR/$$TAG".tar.gz && \
501 gzip --best "$$DIR/$$TAG".tar && \
502 cd "$$DIR" && \
503 rm -rf "$$AUTORECONF_DIR"
504
505 releasecheck: releasetar
506 @TAG=$(PROG)-`cat VERSION` && \
507 INSTALL_DIR=/tmp/install_"$$TAG"_$$$$ && \
508 DIR=`pwd` && \
509 cd /tmp && \
510 rm -rf "$$TAG" && \
511 rm -rf "$$INSTALL_DIR" && \
512 tar xf "$$DIR"/"$$TAG".tar.gz && \
513 cd "$$TAG" && \
514 echo "[$@] $$ ./configure --enable-smb --quiet --prefix=$$INSTALL_DIR" && \
515 ./configure --enable-smb --quiet --prefix="$$INSTALL_DIR" && \
516 echo '[$@] $$ $(MAKE) -s all check' && \
517 $(MAKE) -s all check >/dev/null && \
518 echo '[$@] $$ $(MAKE) -s install' && \
519 $(MAKE) -s install && \
520 cd .. && \
521 rm -rf "$$TAG" && \
522 rm -rf "$$INSTALL_DIR" && \
523 tar xf "$$DIR"/"$$TAG".tar.gz && \
524 cd "$$TAG" && \
525 mkdir build && \
526 cd build && \
527 echo '[$@] $$ cmake -DENABLE_SMB=yes [...] ..' && \
528 cmake -DENABLE_SMB=yes \
529 -DCMAKE_INSTALL_PREFIX="$$INSTALL_DIR" \
530 -DCMAKE_MESSAGE_LOG_LEVEL=NOTICE \
531 -DCMAKE_RULE_MESSAGES=OFF \
532 -DCMAKE_INSTALL_MESSAGE=NEVER \
533 .. && \
534 echo '[$@] $$ $(MAKE) -s all check' && \
535 $(MAKE) -s all check >/dev/null && \
536 echo '[$@] $$ $(MAKE) -s install' && \
537 $(MAKE) -s install && \
538 cd ../.. && \
539 rm -rf "$$TAG" && \
540 rm -rf "$$INSTALL_DIR" && \
541 echo '[$@] Done.'
542
543 whitespacecheck:
544 @# trailing space(s)?
545 @if git grep -I -n ' $$' $$(git ls-files|grep -v '^tests/'); then \
546 echo 'Error: Trailing space(s).'; \
547 exit 1; \
548 fi
549 @# trailing tab(s)?
550 @if git grep -I -n ' $$' $$(git ls-files|grep -v '^tests/'); 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