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