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 25prefix = @prefix@ 26exec_prefix = @exec_prefix@ 27datarootdir = @datarootdir@ 28# Pathname of directory to install the binary 29bindir = @bindir@ 30# Pathname of directory to install the man page 31mandir = @mandir@ 32 33# VPATH 34srcdir = @srcdir@ 35top_srcdir = @top_srcdir@ 36VPATH = @srcdir@ 37 38# 39# You shouldn't need to edit anything below here. 40# 41 42CC = @CC@ 43AR = @AR@ 44MKDEP = @MKDEP@ 45PROG = tcpdump 46CCOPT = @V_CCOPT@ 47INCLS = -I. @V_INCLS@ 48DEFS = @DEFS@ @CPPFLAGS@ @V_DEFS@ 49 50# Standard CFLAGS 51CFLAGS = @CFLAGS@ 52FULL_CFLAGS = $(CCOPT) $(DEFS) $(INCLS) $(CFLAGS) 53 54# Standard LDFLAGS 55LDFLAGS = @LDFLAGS@ 56 57# Standard LIBS 58LIBS = @LIBS@ 59 60INSTALL = @INSTALL@ 61INSTALL_PROGRAM = @INSTALL_PROGRAM@ 62INSTALL_DATA = @INSTALL_DATA@ 63RANLIB = @RANLIB@ 64 65DEPENDENCY_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 74CSRC = fptype.c tcpdump.c 75 76LIBNETDISSECT_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-nsh.c \ 187 print-ntp.c \ 188 print-null.c \ 189 print-olsr.c \ 190 print-openflow-1.0.c \ 191 print-openflow-1.3.c \ 192 print-openflow.c \ 193 print-ospf.c \ 194 print-ospf6.c \ 195 print-otv.c \ 196 print-pgm.c \ 197 print-pim.c \ 198 print-pktap.c \ 199 print-ppi.c \ 200 print-ppp.c \ 201 print-pppoe.c \ 202 print-pptp.c \ 203 print-ptp.c \ 204 print-radius.c \ 205 print-raw.c \ 206 print-resp.c \ 207 print-rip.c \ 208 print-ripng.c \ 209 print-rpki-rtr.c \ 210 print-rrcp.c \ 211 print-rsvp.c \ 212 print-rt6.c \ 213 print-rtsp.c \ 214 print-rx.c \ 215 print-sctp.c \ 216 print-sflow.c \ 217 print-sip.c \ 218 print-sl.c \ 219 print-sll.c \ 220 print-slow.c \ 221 print-smtp.c \ 222 print-snmp.c \ 223 print-someip.c \ 224 print-ssh.c \ 225 print-stp.c \ 226 print-sunatm.c \ 227 print-sunrpc.c \ 228 print-symantec.c \ 229 print-syslog.c \ 230 print-tcp.c \ 231 print-telnet.c \ 232 print-tftp.c \ 233 print-timed.c \ 234 print-tipc.c \ 235 print-token.c \ 236 print-udld.c \ 237 print-udp.c \ 238 print-unsupported.c \ 239 print-usb.c \ 240 print-vjc.c \ 241 print-vqp.c \ 242 print-vrrp.c \ 243 print-vsock.c \ 244 print-vtp.c \ 245 print-vxlan-gpe.c \ 246 print-vxlan.c \ 247 print-wb.c \ 248 print-zep.c \ 249 print-zephyr.c \ 250 print-zeromq.c \ 251 signature.c \ 252 strtoaddr.c \ 253 util-print.c 254 255LOCALSRC = @LOCALSRC@ 256LIBOBJS = @LIBOBJS@ 257 258LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) ${LOCALSRC:.c=.o} ${LIBOBJS} 259LIBNETDISSECT=libnetdissect.a 260 261 262SRC = $(CSRC) $(LOCALSRC) 263 264# We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot 265# hack the extra indirection 266OBJ = $(CSRC:.c=.o) 267HDR = \ 268 addrtoname.h \ 269 addrtostr.h \ 270 af.h \ 271 ah.h \ 272 appletalk.h \ 273 ascii_strcasecmp.h \ 274 atm.h \ 275 chdlc.h \ 276 compiler-tests.h \ 277 cpack.h \ 278 ethertype.h \ 279 extract.h \ 280 fptype.h \ 281 ftmacros.h \ 282 funcattrs.h \ 283 getservent.h \ 284 gmpls.h \ 285 interface.h \ 286 ip.h \ 287 ip6.h \ 288 ipproto.h \ 289 l2vpn.h \ 290 llc.h \ 291 machdep.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 321TAGHDR = \ 322 /usr/include/netinet/if_ether.h \ 323 /usr/include/netinet/in.h 324 325TAGFILES = $(SRC) $(HDR) $(TAGHDR) $(LIBNETDISSECT_SRC) \ 326 print-pflog.c print-smb.c smbutil.c 327 328CLEANFILES = $(PROG) $(OBJ) $(LIBNETDISSECT_OBJ) 329 330EXTRA_DIST = \ 331 CHANGES \ 332 CONTRIBUTING \ 333 CREDITS \ 334 CMakeLists.txt \ 335 INSTALL.txt \ 336 LICENSE \ 337 Makefile.in \ 338 Makefile-devel-adds \ 339 README.md \ 340 VERSION \ 341 aclocal.m4 \ 342 atime.awk \ 343 bpf_dump.c \ 344 cmake_uninstall.cmake.in \ 345 cmakeconfig.h.in \ 346 cmake/Modules/FindCRYPTO.cmake \ 347 cmake/Modules/FindPCAP.cmake \ 348 cmake/Modules/FindSMI.cmake \ 349 config.guess \ 350 config.h.in \ 351 config.sub \ 352 configure \ 353 configure.ac \ 354 doc/README.Win32.md \ 355 install-sh \ 356 lbl/os-osf4.h \ 357 lbl/os-solaris2.h \ 358 lbl/os-sunos4.h \ 359 lbl/os-ultrix4.h \ 360 makemib \ 361 missing/dlnames.c \ 362 missing/datalinks.c \ 363 missing/getopt_long.h \ 364 missing/getopt_long.c \ 365 missing/getservent.c \ 366 missing/pcap_dump_ftell.c \ 367 missing/snprintf.c \ 368 missing/strdup.c \ 369 missing/strlcat.c \ 370 missing/strlcpy.c \ 371 missing/strsep.c \ 372 missing/win_ether_ntohost.c \ 373 missing/win_ether_ntohost.h \ 374 mkdep \ 375 packetdat.awk \ 376 print-pflog.c \ 377 print-smb.c \ 378 send-ack.awk \ 379 smbutil.c \ 380 stime.awk \ 381 tcpdump.1.in 382 383TEST_DIST= `git ls-files tests | grep -v 'tests/\..*'` 384 385all: $(PROG) 386 387$(PROG): $(OBJ) @V_PCAPDEP@ $(LIBNETDISSECT) 388 @rm -f $@ 389 $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBNETDISSECT) $(LIBS) 390 391$(LIBNETDISSECT): $(LIBNETDISSECT_OBJ) 392 @rm -f $@ 393 $(AR) cr $@ $(LIBNETDISSECT_OBJ) 394 $(RANLIB) $@ 395 396datalinks.o: $(srcdir)/missing/datalinks.c 397 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c 398dlnames.o: $(srcdir)/missing/dlnames.c 399 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c 400getservent.o: $(srcdir)/missing/getservent.c 401 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getservent.c 402getopt_long.o: $(srcdir)/missing/getopt_long.c 403 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getopt_long.c 404snprintf.o: $(srcdir)/missing/snprintf.c 405 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c 406strdup.o: $(srcdir)/missing/strdup.c 407 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strdup.c 408strlcat.o: $(srcdir)/missing/strlcat.c 409 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c 410strlcpy.o: $(srcdir)/missing/strlcpy.c 411 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c 412strsep.o: $(srcdir)/missing/strsep.c 413 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c 414pcap_dump_ftell.o: $(srcdir)/missing/pcap_dump_ftell.c 415 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/pcap_dump_ftell.c 416 417install: all 418 [ -d $(DESTDIR)$(bindir) ] || \ 419 (mkdir -p $(DESTDIR)$(bindir); chmod 755 $(DESTDIR)$(bindir)) 420 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(bindir)/$(PROG) 421 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(bindir)/$(PROG).`cat ${srcdir}/VERSION` 422 [ -d $(DESTDIR)$(mandir)/man1 ] || \ 423 (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1) 424 $(INSTALL_DATA) $(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1 425 426uninstall: 427 rm -f $(DESTDIR)$(bindir)/$(PROG) 428 rm -f $(DESTDIR)$(bindir)/$(PROG).`cat ${srcdir}/VERSION` 429 rm -f $(DESTDIR)$(mandir)/man1/$(PROG).1 430 431lint: 432 lint -hbxn $(SRC) $(LIBNETDISSECT_SRC) | \ 433 grep -v 'struct/union .* never defined' | \ 434 grep -v 'possible pointer alignment problem' 435 436clean: 437 rm -f $(CLEANFILES) $(PROG)-`cat ${srcdir}/VERSION`.tar.gz 438 439distclean: 440 rm -f $(CLEANFILES) Makefile config.cache config.log config.status \ 441 config.h gnuc.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 446check: tcpdump 447 $(srcdir)/tests/TESTrun 448 449extags: $(TAGFILES) 450 ctags $(TAGFILES) 451 452tags: $(TAGFILES) 453 ctags -wtd $(TAGFILES) 454 455TAGS: $(TAGFILES) 456 etags $(TAGFILES) 457 458releasetar: 459 @autoreconf -f; \ 460 name=$(PROG)-`cat VERSION` ; \ 461 mkdir $$name; \ 462 tar cf - $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) $(TEST_DIST) | (cd $$name; tar xf -); \ 463 tar -c -z -f $$name.tar.gz $$name; \ 464 rm -rf $$name 465 466rc1 rc2 rc3 rc4 rc5: 467 @VER=`cat $(srcdir)/VERSION`; \ 468 sed -i "s/$$VER/$${VER}$@/" VERSION ; \ 469 make releasetar; \ 470 git checkout VERSION configure 471 472testlist: 473 echo $(TEST_DIST) 474 475depend: 476 $(MKDEP) -c "$(CC)" -m "$(DEPENDENCY_CFLAG)" -s "$(srcdir)" $(DEFS) $(INCLS) $(SRC) $(LIBNETDISSECT_SRC) 477 478shellcheck: 479 shellcheck -f gcc build.sh build_matrix.sh 480