]> The Tcpdump Group git mirrors - tcpdump/blob - Makefile.in
pflog: handle OpenBSD's "rewriten" flag and addresses.
[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 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 pcap-missing.h \
307 ppp.h \
308 print.h \
309 rpc_auth.h \
310 rpc_msg.h \
311 signature.h \
312 slcompress.h \
313 smb.h \
314 status-exit-codes.h \
315 strtoaddr.h \
316 tcp.h \
317 timeval-operations.h \
318 udp.h \
319 varattrs.h
320
321 TAGHDR = \
322 /usr/include/netinet/if_ether.h \
323 /usr/include/netinet/in.h
324
325 TAGFILES = $(SRC) $(HDR) $(TAGHDR) $(LIBNETDISSECT_SRC) \
326 print-smb.c smbutil.c
327
328 CLEANFILES = $(PROG) $(OBJ) $(LIBNETDISSECT_OBJ) \
329 print-smb.o smbutil.o instrument-functions.o
330
331 EXTRA_DIST = \
332 CHANGES \
333 CMakeLists.txt \
334 CONTRIBUTING.md \
335 CREDITS \
336 INSTALL.md \
337 LICENSE \
338 Makefile-devel-adds \
339 Makefile.in \
340 README.md \
341 VERSION \
342 aclocal.m4 \
343 autogen.sh \
344 atime.awk \
345 bpf_dump.c \
346 cmake/Modules/FindCRYPTO.cmake \
347 cmake/Modules/FindPCAP.cmake \
348 cmake/Modules/FindSMI.cmake \
349 cmake_uninstall.cmake.in \
350 cmakeconfig.h.in \
351 config.guess \
352 config.sub \
353 configure.ac \
354 doc/README.aix.md \
355 doc/README.haiku.md \
356 doc/README.NetBSD.md \
357 doc/README.solaris.md \
358 doc/README.windows.md \
359 install-sh \
360 instrument-functions.c \
361 makemib \
362 missing/getopt_long.c \
363 missing/getopt_long.h \
364 missing/getservent.c \
365 missing/strlcat.c \
366 missing/strlcpy.c \
367 missing/strsep.c \
368 mkdep \
369 packetdat.awk \
370 print-smb.c \
371 send-ack.awk \
372 smbutil.c \
373 stime.awk \
374 tcpdump.1.in
375
376 TEST_DIST= `git -C "$$DIR" ls-files tests | grep -v 'tests/\..*'`
377
378 RELEASE_FILES = $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) $(TEST_DIST)
379
380 all: $(PROG)
381
382 $(PROG): $(OBJ) @V_PCAPDEP@ $(LIBNETDISSECT)
383 @rm -f $@
384 $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBNETDISSECT) $(LIBS)
385
386 $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ)
387 @rm -f $@
388 $(AR) cr $@ $(LIBNETDISSECT_OBJ)
389 $(RANLIB) $@
390
391 getservent.o: $(srcdir)/missing/getservent.c
392 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getservent.c
393 getopt_long.o: $(srcdir)/missing/getopt_long.c
394 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getopt_long.c
395 strlcat.o: $(srcdir)/missing/strlcat.c
396 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c
397 strlcpy.o: $(srcdir)/missing/strlcpy.c
398 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c
399 strsep.o: $(srcdir)/missing/strsep.c
400 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c
401
402 install: all
403 [ -d $(DESTDIR)$(bindir) ] || \
404 (mkdir -p $(DESTDIR)$(bindir); chmod 755 $(DESTDIR)$(bindir))
405 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(bindir)/$(PROG)
406 [ ! -f "${srcdir}/.devel" ] || $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(bindir)/$(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)$(bindir)/$(PROG)
413 rm -f $(DESTDIR)$(bindir)/$(PROG).`cat ${srcdir}/VERSION`
414 rm -f $(DESTDIR)$(mandir)/man1/$(PROG).1
415
416 lint:
417 lint -hbxn $(SRC) $(LIBNETDISSECT_SRC) | \
418 grep -v 'struct/union .* never defined' | \
419 grep -v 'possible pointer alignment problem'
420
421 clean:
422 rm -f $(CLEANFILES) $(PROG)-`cat ${srcdir}/VERSION`.tar.gz \
423 config.h.in~ configure~ configure.ac~
424
425 distclean: clean
426 rm -f Makefile config.cache config.log config.status \
427 config.h os-proto.h stamp-h stamp-h.in $(PROG).1 \
428 libnetdissect.a tests/.failed tests/.passed \
429 tests/failure-outputs.txt
430 rm -rf autom4te.cache tests/DIFF tests/NEW
431
432 check: tcpdump
433 $(srcdir)/tests/TESTrun
434
435 extags: $(TAGFILES)
436 ctags $(TAGFILES)
437
438 tags: $(TAGFILES)
439 ctags -wtd $(TAGFILES)
440
441 TAGS: $(TAGFILES)
442 etags $(TAGFILES)
443
444 #
445 # Use git archive piped to tar to construct a subdirectory whose name
446 # is tcpdump-{release}, containing all the checked-in source files,
447 # and then run autoreconf in that directory to generate the configure
448 # script and other files from that source. Then remove autom4te.cache,
449 # construct the release tarball from that subdirectory, and remove
450 # the subdirectory.
451 #
452 # The --format=tar is to force git archive to write a non-compressed
453 # archive, in case the platform's tar command doesn't have built-in
454 # decompression.
455 #
456 # The ^{tree} is there to force git archive not to write out the
457 # "helpful" global extended pax header with a commit ID, as not all
458 # versions of tar can handle that (Solaris tar can't, for example).
459 # (It turns HEAD, or a tag, both of which are apparently "tree-ish"es,
460 # into a tree; apparently, unlike HEAD, or a tag, which have a commit
461 # ID associated with them, the tree associated with them doesn't have
462 # a commit ID, so no commit ID is available to write, and thus
463 # git archive doesn't write one.)
464 #
465 releasetar:
466 @TAG=$(PROG)-`cat VERSION` && \
467 if [ ! -d .git ]; then echo 'Not in a git clone, stop.'; exit 1; fi && \
468 TMPTESTFILE=`mktemp -t tmptestfile_XXXXXXXX` && \
469 rm -f "$$TMPTESTFILE" && \
470 AUTORECONF_DIR=`dirname "$$TMPTESTFILE"`/"$(PROG)"_build_autoreconf_$$$$ && \
471 DIR=`pwd` && \
472 rm -rf "$$AUTORECONF_DIR" && \
473 mkdir "$$AUTORECONF_DIR" && \
474 cd "$$AUTORECONF_DIR" && \
475 if git -C "$$DIR" show-ref --tags --quiet --verify -- "refs/tags/$$TAG"; then \
476 (git -C "$$DIR" archive --format=tar --prefix="$$TAG"/ "$$TAG^{tree}" $(RELEASE_FILES) | \
477 tar xf -) && \
478 echo "Archive build from tag $$TAG."; \
479 else \
480 (git -C "$$DIR" archive --format=tar --prefix="$$TAG"/ "HEAD^{tree}" $(RELEASE_FILES) | \
481 tar xf -) && \
482 echo "No $$TAG tag. Archive build from HEAD."; \
483 fi && \
484 (cd "$$TAG" && ./autogen.sh && rm -rf autom4te.cache) && \
485 tar cf "$$DIR/$$TAG".tar "$$TAG" && \
486 rm -f "$$DIR/$$TAG".tar.gz && \
487 gzip --best "$$DIR/$$TAG".tar && \
488 cd "$$DIR" && \
489 rm -rf "$$AUTORECONF_DIR"
490
491 releasecheck: releasetar
492 @TAG=$(PROG)-`cat VERSION` && \
493 INSTALL_DIR=/tmp/install_"$$TAG"_$$$$ && \
494 DIR=`pwd` && \
495 cd /tmp && \
496 rm -rf libpcap && \
497 rm -rf install_libpcap && \
498 echo "[$@] $$ git clone [...] libpcap.git" && \
499 git clone --depth 3 --quiet https://github.com/the-tcpdump-group/libpcap.git && \
500 echo "[$@] $$ cd libpcap" && \
501 cd libpcap && \
502 echo "[$@] $$ ./autogen.sh" && \
503 ./autogen.sh && \
504 echo "[$@] $$ ./configure --quiet --prefix=/tmp/install_libpcap" && \
505 ./configure --quiet --prefix=/tmp/install_libpcap && \
506 echo "[$@] $$ make -s " && \
507 make -s && \
508 echo "[$@] $$ make -s install" && \
509 make -s install && \
510 echo "[$@] $$ cd .." && \
511 cd .. && \
512 rm -rf "$$TAG" && \
513 rm -rf "$$INSTALL_DIR" && \
514 tar xf "$$DIR"/"$$TAG".tar.gz && \
515 cd "$$TAG" && \
516 echo "[$@] $$ touch .devel" && \
517 touch .devel && \
518 echo "[$@] $$ ./configure --enable-instrument-functions --enable-smb --quiet --prefix=$$INSTALL_DIR" && \
519 ./configure --enable-instrument-functions --enable-smb --quiet --prefix="$$INSTALL_DIR" && \
520 echo '[$@] $$ $(MAKE) -s all check' && \
521 $(MAKE) -s all check >/dev/null && \
522 echo '[$@] $$ $(MAKE) -s install' && \
523 $(MAKE) -s install && \
524 cd .. && \
525 rm -rf "$$TAG" && \
526 rm -rf "$$INSTALL_DIR" && \
527 tar xf "$$DIR"/"$$TAG".tar.gz && \
528 cd "$$TAG" && \
529 echo "[$@] $$ touch .devel" && \
530 touch .devel && \
531 mkdir build && \
532 cd build && \
533 echo "[$@] $$ export PKG_CONFIG_PATH=/tmp/install_libpcap/lib/pkgconfig" && \
534 export PKG_CONFIG_PATH=/tmp/install_libpcap/lib/pkgconfig && \
535 echo '[$@] $$ cmake -DENABLE_SMB=yes [...] ..' && \
536 cmake -DENABLE_SMB=yes \
537 -DCMAKE_INSTALL_PREFIX="$$INSTALL_DIR" \
538 -DCMAKE_MESSAGE_LOG_LEVEL=NOTICE \
539 -DCMAKE_RULE_MESSAGES=OFF \
540 -DCMAKE_INSTALL_MESSAGE=NEVER \
541 .. && \
542 echo '[$@] $$ $(MAKE) -s all check' && \
543 $(MAKE) -s all check >/dev/null && \
544 echo '[$@] $$ $(MAKE) -s install' && \
545 $(MAKE) -s install && \
546 cd ../.. && \
547 rm -rf "$$TAG" && \
548 rm -rf "$$INSTALL_DIR" && \
549 rm -rf install_libpcap && \
550 rm -rf libpcap && \
551 echo '[$@] Done.'
552
553 whitespacecheck:
554 @# trailing space(s)?
555 @if git grep -I -n ' $$' $$(git ls-files|grep -v '^tests/'); then \
556 echo 'Error: Trailing space(s).'; \
557 exit 1; \
558 fi
559 @# trailing tab(s)?
560 @if git grep -I -n ' $$' $$(git ls-files|grep -v '^tests/'); then \
561 echo 'Error: Trailing tabs(s).'; \
562 exit 1; \
563 fi
564 @# space(s) before tab(s)?
565 @if git grep -I -n '[ ][ ]' $$(git ls-files|grep -v '^tests/'); then \
566 echo 'Error: space(s) before tab(s).'; \
567 exit 1; \
568 fi
569
570 testlist:
571 echo $(TEST_DIST)
572
573 depend:
574 @echo $(MKDEP) -c $(CC) -m "$(DEPENDENCY_CFLAG)" -s "$(srcdir)" $(DEFS) $(INCLS) $(SRC) '<libnetdissect src list>'
575 @$(MKDEP) -c $(CC) -m "$(DEPENDENCY_CFLAG)" -s "$(srcdir)" $(DEFS) $(INCLS) $(SRC) $(LIBNETDISSECT_SRC)
576
577 shellcheck:
578 shellcheck -f gcc -e SC2006 autogen.sh build.sh build_matrix.sh build_common.sh mkdep .ci-coverity-scan-build.sh