]> The Tcpdump Group git mirrors - tcpdump/blob - Makefile.in
CI: Add warning exemptions for Sun C (suncc-5.14) on Solaris 10
[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 = $(INCLS) $(CCOPT) $(DEFS) $(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 icmp.h \
286 interface.h \
287 ip.h \
288 ip6.h \
289 ipproto.h \
290 l2vpn.h \
291 llc.h \
292 mib.h \
293 mpls.h \
294 nameser.h \
295 netdissect.h \
296 netdissect-alloc.h \
297 netdissect-ctype.h \
298 netdissect-stdinc.h \
299 nfs.h \
300 nfsfh.h \
301 nlpid.h \
302 ntp.h \
303 openflow.h \
304 ospf.h \
305 oui.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`
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 [ ! -f "${srcdir}/.devel" ] || $(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
428 rm -rf autom4te.cache
429
430 check: tcpdump
431 $(srcdir)/tests/TESTrun
432
433 extags: $(TAGFILES)
434 ctags $(TAGFILES)
435
436 tags: $(TAGFILES)
437 ctags -wtd $(TAGFILES)
438
439 TAGS: $(TAGFILES)
440 etags $(TAGFILES)
441
442 #
443 # Use git archive piped to tar to construct a subdirectory whose name
444 # is tcpdump-{release}, containing all the checked-in source files,
445 # and then run autoreconf in that directory to generate the configure
446 # script and other files from that source. Then remove autom4te.cache,
447 # construct the release tarball from that subdirectory, and remove
448 # the subdirectory.
449 #
450 # The --format=tar is to force git archive to write a non-compressed
451 # archive, in case the platform's tar command doesn't have built-in
452 # decompression.
453 #
454 # The ^{tree} is there to force git archive not to write out the
455 # "helpful" global extended pax header with a commit ID, as not all
456 # versions of tar can handle that (Solaris tar can't, for example).
457 # (It turns HEAD, or a tag, both of which are apparently "tree-ish"es,
458 # into a tree; apparently, unlike HEAD, or a tag, which have a commit
459 # ID associated with them, the tree associated with them doesn't have
460 # a commit ID, so no commit ID is available to write, and thus
461 # git archive doesn't write one.)
462 #
463 releasetar:
464 @TAG=$(PROG)-`cat VERSION` && \
465 if [ ! -d .git ]; then echo 'Not in a git clone, stop.'; exit 1; fi && \
466 TMPTESTFILE=`mktemp -t tmptestfile_XXXXXXXX` && \
467 rm -f "$$TMPTESTFILE" && \
468 AUTORECONF_DIR=`dirname "$$TMPTESTFILE"`/"$(PROG)"_build_autoreconf_$$$$ && \
469 DIR=`pwd` && \
470 rm -rf "$$AUTORECONF_DIR" && \
471 mkdir "$$AUTORECONF_DIR" && \
472 cd "$$AUTORECONF_DIR" && \
473 if git -C "$$DIR" show-ref --tags --quiet --verify -- "refs/tags/$$TAG"; then \
474 (git -C "$$DIR" archive --format=tar --prefix="$$TAG"/ "$$TAG^{tree}" $(RELEASE_FILES) | \
475 tar xf -) && \
476 echo "Archive build from tag $$TAG."; \
477 else \
478 (git -C "$$DIR" archive --format=tar --prefix="$$TAG"/ "HEAD^{tree}" $(RELEASE_FILES) | \
479 tar xf -) && \
480 echo "No $$TAG tag. Archive build from HEAD."; \
481 fi && \
482 (cd "$$TAG" && ./autogen.sh && rm -rf autom4te.cache) && \
483 tar cf "$$DIR/$$TAG".tar "$$TAG" && \
484 rm -f "$$DIR/$$TAG".tar.gz && \
485 gzip --best "$$DIR/$$TAG".tar && \
486 cd "$$DIR" && \
487 rm -rf "$$AUTORECONF_DIR"
488
489 releasecheck: releasetar
490 @TAG=$(PROG)-`cat VERSION` && \
491 INSTALL_DIR=/tmp/install_"$$TAG"_$$$$ && \
492 DIR=`pwd` && \
493 cd /tmp && \
494 rm -rf libpcap && \
495 rm -rf install_libpcap && \
496 echo "[$@] $$ git clone [...] libpcap.git" && \
497 git clone --depth 3 --quiet https://github.com/the-tcpdump-group/libpcap.git && \
498 echo "[$@] $$ cd libpcap" && \
499 cd libpcap && \
500 echo "[$@] $$ ./autogen.sh" && \
501 ./autogen.sh && \
502 echo "[$@] $$ ./configure --quiet --prefix=/tmp/install_libpcap" && \
503 ./configure --quiet --prefix=/tmp/install_libpcap && \
504 echo "[$@] $$ make -s " && \
505 make -s && \
506 echo "[$@] $$ make -s install" && \
507 make -s install && \
508 echo "[$@] $$ cd .." && \
509 cd .. && \
510 rm -rf "$$TAG" && \
511 rm -rf "$$INSTALL_DIR" && \
512 tar xf "$$DIR"/"$$TAG".tar.gz && \
513 cd "$$TAG" && \
514 echo "[$@] $$ touch .devel" && \
515 touch .devel && \
516 echo "[$@] $$ ./configure --enable-instrument-functions --enable-smb --quiet --prefix=$$INSTALL_DIR" && \
517 ./configure --enable-instrument-functions --enable-smb --quiet --prefix="$$INSTALL_DIR" && \
518 echo '[$@] $$ $(MAKE) -s all check' && \
519 $(MAKE) -s all check >/dev/null && \
520 echo '[$@] $$ $(MAKE) -s install' && \
521 $(MAKE) -s install && \
522 cd .. && \
523 rm -rf "$$TAG" && \
524 rm -rf "$$INSTALL_DIR" && \
525 tar xf "$$DIR"/"$$TAG".tar.gz && \
526 cd "$$TAG" && \
527 echo "[$@] $$ touch .devel" && \
528 touch .devel && \
529 mkdir build && \
530 cd build && \
531 echo "[$@] $$ export PKG_CONFIG_PATH=/tmp/install_libpcap/lib/pkgconfig" && \
532 export PKG_CONFIG_PATH=/tmp/install_libpcap/lib/pkgconfig && \
533 echo '[$@] $$ cmake -DENABLE_SMB=yes [...] ..' && \
534 cmake -DENABLE_SMB=yes \
535 -DCMAKE_INSTALL_PREFIX="$$INSTALL_DIR" \
536 -DCMAKE_MESSAGE_LOG_LEVEL=NOTICE \
537 -DCMAKE_RULE_MESSAGES=OFF \
538 -DCMAKE_INSTALL_MESSAGE=NEVER \
539 .. && \
540 echo '[$@] $$ $(MAKE) -s all check' && \
541 $(MAKE) -s all check >/dev/null && \
542 echo '[$@] $$ $(MAKE) -s install' && \
543 $(MAKE) -s install && \
544 cd ../.. && \
545 rm -rf "$$TAG" && \
546 rm -rf "$$INSTALL_DIR" && \
547 rm -rf install_libpcap && \
548 rm -rf libpcap && \
549 echo '[$@] Done.'
550
551 whitespacecheck:
552 @# trailing space(s)?
553 @if git grep -I -n ' $$' $$(git ls-files|grep -v '^tests/'); then \
554 echo 'Error: Trailing space(s).'; \
555 exit 1; \
556 fi
557 @# trailing tab(s)?
558 @if git grep -I -n ' $$' $$(git ls-files|grep -v '^tests/'); then \
559 echo 'Error: Trailing tabs(s).'; \
560 exit 1; \
561 fi
562 @# space(s) before tab(s)?
563 @if git grep -I -n '[ ][ ]' $$(git ls-files|grep -v '^tests/'); then \
564 echo 'Error: space(s) before tab(s).'; \
565 exit 1; \
566 fi
567
568 testlist:
569 echo $(TEST_DIST)
570
571 depend:
572 @echo $(MKDEP) -c $(CC) -m "$(DEPENDENCY_CFLAG)" -s "$(srcdir)" $(DEFS) $(INCLS) $(SRC) '<libnetdissect src list>'
573 @$(MKDEP) -c $(CC) -m "$(DEPENDENCY_CFLAG)" -s "$(srcdir)" $(DEFS) $(INCLS) $(SRC) $(LIBNETDISSECT_SRC)
574
575 shellcheck:
576 shellcheck -f gcc -e SC2006 autogen.sh build.sh build_matrix.sh build_common.sh mkdep .ci-coverity-scan-build.sh