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 sbindir = @sbindir@ 30 # Pathname of directory to install the man page 31 mandir = @mandir@ 32 33 # VPATH 34 srcdir = @srcdir@ 35 VPATH = @srcdir@ 36 37 # 38 # You shouldn't need to edit anything below here. 39 # 40 41 CC = @CC@ 42 AR = @AR@ 43 MKDEP = @MKDEP@ 44 PROG = tcpdump 45 CCOPT = @V_CCOPT@ 46 INCLS = -I. @V_INCLS@ 47 DEFS = @DEFS@ @CPPFLAGS@ @V_DEFS@ 48 49 # Standard CFLAGS 50 CFLAGS = @CFLAGS@ 51 FULL_CFLAGS = $(CCOPT) $(DEFS) $(INCLS) $(CFLAGS) 52 53 # Standard LDFLAGS 54 LDFLAGS = @LDFLAGS@ 55 56 # Standard LIBS 57 LIBS = @LIBS@ 58 59 INSTALL = @INSTALL@ 60 INSTALL_PROGRAM = @INSTALL_PROGRAM@ 61 INSTALL_DATA = @INSTALL_DATA@ 62 RANLIB = @RANLIB@ 63 64 DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@ 65 66 # Explicitly define compilation rule since SunOS 4's make doesn't like gcc. 67 # Also, gcc does not remove the .o before forking 'as', which can be a 68 # problem if you don't own the file but can write to the directory. 69 .c.o: 70 @rm -f $@ 71 $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c 72 73 CSRC = setsignal.c tcpdump.c 74 75 LIBNETDISSECT_SRC=\ 76 addrtoname.c \ 77 af.c \ 78 checksum.c \ 79 cpack.c \ 80 gmpls.c \ 81 gmt2local.c \ 82 in_cksum.c \ 83 ipproto.c \ 84 l2vpn.c \ 85 machdep.c \ 86 nlpid.c \ 87 oui.c \ 88 parsenfsfh.c \ 89 print-802_11.c \ 90 print-802_15_4.c \ 91 print-ah.c \ 92 print-ahcp.c \ 93 print-aodv.c \ 94 print-aoe.c \ 95 print-ap1394.c \ 96 print-arcnet.c \ 97 print-arp.c \ 98 print-ascii.c \ 99 print-atalk.c \ 100 print-atm.c \ 101 print-beep.c \ 102 print-bfd.c \ 103 print-bgp.c \ 104 print-bootp.c \ 105 print-bt.c \ 106 print-calm-fast.c \ 107 print-carp.c \ 108 print-cdp.c \ 109 print-cfm.c \ 110 print-chdlc.c \ 111 print-cip.c \ 112 print-cnfp.c \ 113 print-dccp.c \ 114 print-decnet.c \ 115 print-domain.c \ 116 print-dtp.c \ 117 print-dvmrp.c \ 118 print-eap.c \ 119 print-egp.c \ 120 print-eigrp.c \ 121 print-enc.c \ 122 print-esp.c \ 123 print-ether.c \ 124 print-fddi.c \ 125 print-forces.c \ 126 print-fr.c \ 127 print-ftp.c \ 128 print-geneve.c \ 129 print-geonet.c \ 130 print-gre.c \ 131 print-hsrp.c \ 132 print-http.c \ 133 print-icmp.c \ 134 print-igmp.c \ 135 print-igrp.c \ 136 print-ip.c \ 137 print-ip6.c \ 138 print-ipcomp.c \ 139 print-ipfc.c \ 140 print-ipnet.c \ 141 print-ipx.c \ 142 print-isakmp.c \ 143 print-isoclns.c \ 144 print-juniper.c \ 145 print-krb.c \ 146 print-l2tp.c \ 147 print-lane.c \ 148 print-ldp.c \ 149 print-llc.c \ 150 print-lldp.c \ 151 print-lmp.c \ 152 print-loopback.c \ 153 print-lspping.c \ 154 print-lwapp.c \ 155 print-lwres.c \ 156 print-m3ua.c \ 157 print-mobile.c \ 158 print-mpcp.c \ 159 print-mpls.c \ 160 print-mptcp.c \ 161 print-msdp.c \ 162 print-msnlb.c \ 163 print-nflog.c \ 164 print-nfs.c \ 165 print-ntp.c \ 166 print-null.c \ 167 print-olsr.c \ 168 print-openflow-1.0.c \ 169 print-openflow.c \ 170 print-ospf.c \ 171 print-otv.c \ 172 print-pgm.c \ 173 print-pim.c \ 174 print-pktap.c \ 175 print-ppi.c \ 176 print-ppp.c \ 177 print-pppoe.c \ 178 print-pptp.c \ 179 print-radius.c \ 180 print-raw.c \ 181 print-rip.c \ 182 print-rpki-rtr.c \ 183 print-rrcp.c \ 184 print-rsvp.c \ 185 print-rtsp.c \ 186 print-rx.c \ 187 print-sctp.c \ 188 print-sflow.c \ 189 print-sip.c \ 190 print-sl.c \ 191 print-sll.c \ 192 print-slow.c \ 193 print-smtp.c \ 194 print-snmp.c \ 195 print-stp.c \ 196 print-sunatm.c \ 197 print-sunrpc.c \ 198 print-symantec.c \ 199 print-syslog.c \ 200 print-tcp.c \ 201 print-telnet.c \ 202 print-tftp.c \ 203 print-timed.c \ 204 print-tipc.c \ 205 print-token.c \ 206 print-udld.c \ 207 print-udp.c \ 208 print-usb.c \ 209 print-vjc.c \ 210 print-vqp.c \ 211 print-vrrp.c \ 212 print-vtp.c \ 213 print-vxlan.c \ 214 print-wb.c \ 215 print-zephyr.c \ 216 print-zeromq.c \ 217 signature.c \ 218 util.c 219 220 LOCALSRC = @LOCALSRC@ 221 GENSRC = version.c 222 LIBOBJS = @LIBOBJS@ 223 224 LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) ${LOCALSRC:.c=.o} ${LIBOBJS} 225 LIBNETDISSECT=libnetdissect.a 226 227 228 SRC = $(CSRC) $(GENSRC) $(LOCALSRC) $(LIBNETDISSECT_SRC) 229 230 # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot 231 # hack the extra indirection 232 OBJ = $(CSRC:.c=.o) $(GENSRC:.c=.o) $(LIBNETDISSECT_OBJ) 233 HDR = \ 234 addrtoname.h \ 235 af.h \ 236 ah.h \ 237 appletalk.h \ 238 atm.h \ 239 atmuni31.h \ 240 chdlc.h \ 241 cpack.h \ 242 ether.h \ 243 ethertype.h \ 244 extract.h \ 245 getopt_long.h \ 246 gmpls.h \ 247 gmt2local.h \ 248 interface.h \ 249 ip.h \ 250 ip6.h \ 251 ipproto.h \ 252 l2vpn.h \ 253 llc.h \ 254 machdep.h \ 255 mib.h \ 256 mpls.h \ 257 nameser.h \ 258 netdissect.h \ 259 nfs.h \ 260 nfsfh.h \ 261 nlpid.h \ 262 openflow.h \ 263 ospf.h \ 264 oui.h \ 265 pcap-missing.h \ 266 ppp.h \ 267 rpc_auth.h \ 268 rpc_msg.h \ 269 rpl.h \ 270 setsignal.h \ 271 signature.h \ 272 slcompress.h \ 273 smb.h \ 274 tcp.h \ 275 tcpdump-stdinc.h \ 276 udp.h 277 278 TAGHDR = \ 279 /usr/include/arpa/tftp.h \ 280 /usr/include/net/if_arp.h \ 281 /usr/include/net/slip.h \ 282 /usr/include/netinet/if_ether.h \ 283 /usr/include/netinet/in.h \ 284 /usr/include/netinet/ip_icmp.h \ 285 /usr/include/netinet/tcp.h \ 286 /usr/include/netinet/udp.h \ 287 /usr/include/protocols/routed.h 288 289 TAGFILES = $(SRC) $(HDR) $(TAGHDR) 290 291 CLEANFILES = $(PROG) $(OBJ) $(GENSRC) 292 293 EXTRA_DIST = \ 294 CHANGES \ 295 CREDITS \ 296 INSTALL.txt \ 297 LICENSE \ 298 Makefile.in \ 299 Makefile-devel-adds \ 300 README.md \ 301 Readme.Win32 \ 302 VERSION \ 303 aclocal.m4 \ 304 atime.awk \ 305 bpf_dump.c \ 306 config.guess \ 307 config.h.in \ 308 config.sub \ 309 configure \ 310 configure.in \ 311 install-sh \ 312 lbl/os-osf4.h \ 313 lbl/os-solaris2.h \ 314 lbl/os-sunos4.h \ 315 lbl/os-ultrix4.h \ 316 makemib \ 317 missing/addrinfo.h \ 318 missing/dlnames.c \ 319 missing/datalinks.c \ 320 missing/getnameinfo.c \ 321 missing/getopt_long.c \ 322 missing/inet_aton.c \ 323 missing/inet_ntop.c \ 324 missing/inet_pton.c \ 325 missing/snprintf.c \ 326 missing/strdup.c \ 327 missing/strlcat.c \ 328 missing/strlcpy.c \ 329 missing/strsep.c \ 330 mkdep \ 331 packetdat.awk \ 332 pcap_dump_ftell.c \ 333 print-babel.c \ 334 print-dhcp6.c \ 335 print-frag6.c \ 336 print-icmp6.c \ 337 print-ip6opts.c \ 338 print-mobility.c \ 339 print-ospf6.c \ 340 print-pflog.c \ 341 print-ripng.c \ 342 print-rt6.c \ 343 print-smb.c \ 344 send-ack.awk \ 345 smbutil.c \ 346 stime.awk \ 347 strcasecmp.c \ 348 tcpdump.1.in \ 349 vfprintf.c \ 350 win32/Include/w32_fzs.h \ 351 win32/prj/GNUmakefile \ 352 win32/prj/WinDump.dsp \ 353 win32/prj/WinDump.dsw 354 355 TEST_DIST= `find tests \( -name 'DIFF' -prune \) -o \( -name NEW -prune \) -o -type f \! -name '.*' \! -name '*~' -print` 356 357 all: $(PROG) $(LIBNETDISSECT) 358 359 $(PROG): $(OBJ) @V_PCAPDEP@ 360 @rm -f $@ 361 $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) 362 363 $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ) 364 @rm -f $@ 365 $(AR) cr $@ $(LIBNETDISSECT_OBJ) 366 $(RANLIB) $@ 367 368 datalinks.o: $(srcdir)/missing/datalinks.c 369 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c 370 dlnames.o: $(srcdir)/missing/dlnames.c 371 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/dlnames.c 372 getnameinfo.o: $(srcdir)/missing/getnameinfo.c 373 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getnameinfo.c 374 getopt_long.o: $(srcdir)/missing/getopt_long.c 375 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/getopt_long.c 376 inet_pton.o: $(srcdir)/missing/inet_pton.c 377 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_pton.c 378 inet_ntop.o: $(srcdir)/missing/inet_ntop.c 379 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_ntop.c 380 inet_aton.o: $(srcdir)/missing/inet_aton.c 381 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/inet_aton.c 382 snprintf.o: $(srcdir)/missing/snprintf.c 383 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c 384 strdup.o: $(srcdir)/missing/strdup.c 385 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strdup.c 386 strlcat.o: $(srcdir)/missing/strlcat.c 387 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcat.c 388 strlcpy.o: $(srcdir)/missing/strlcpy.c 389 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strlcpy.c 390 strsep.o: $(srcdir)/missing/strsep.c 391 $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/strsep.c 392 393 version.o: version.c 394 $(CC) $(FULL_CFLAGS) -c version.c 395 396 version.c: $(srcdir)/VERSION 397 @rm -f $@ 398 if grep GIT ${srcdir}/VERSION >/dev/null; then \ 399 read ver <${srcdir}/VERSION; \ 400 echo $$ver | tr -d '\012'; \ 401 date +_%Y_%m_%d; \ 402 else \ 403 cat ${srcdir}/VERSION; \ 404 fi | sed -e 's/.*/const char version[] = "&";/' > $@ 405 406 install: all 407 [ -d $(DESTDIR)$(sbindir) ] || \ 408 (mkdir -p $(DESTDIR)$(sbindir); chmod 755 $(DESTDIR)$(sbindir)) 409 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG) 410 $(INSTALL_PROGRAM) $(PROG) $(DESTDIR)$(sbindir)/$(PROG).`cat ${srcdir}/VERSION` 411 [ -d $(DESTDIR)$(mandir)/man1 ] || \ 412 (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1) 413 $(INSTALL_DATA) $(PROG).1 $(DESTDIR)$(mandir)/man1/$(PROG).1 414 415 uninstall: 416 rm -f $(DESTDIR)$(sbindir)/$(PROG) 417 rm -f $(DESTDIR)$(mandir)/man1/$(PROG).1 418 419 lint: $(GENSRC) 420 lint -hbxn $(SRC) | \ 421 grep -v 'struct/union .* never defined' | \ 422 grep -v 'possible pointer alignment problem' 423 424 clean: 425 rm -f $(CLEANFILES) $(PROG)-`cat VERSION`.tar.gz 426 427 distclean: 428 rm -f $(CLEANFILES) Makefile config.cache config.log config.status \ 429 config.h gnuc.h os-proto.h stamp-h stamp-h.in $(PROG).1 \ 430 libnetdissect.a tests/.failed tests/.passed \ 431 tests/failure-outputs.txt 432 rm -rf autom4te.cache tests/DIFF tests/NEW 433 434 check: tcpdump 435 (cd tests && ./TESTrun.sh) 436 437 tags: $(TAGFILES) 438 ctags -wtd $(TAGFILES) 439 440 TAGS: $(TAGFILES) 441 etags $(TAGFILES) 442 443 releasetar: 444 @cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \ 445 mkdir $$name; \ 446 tar cf - $(CSRC) $(HDR) $(LIBNETDISSECT_SRC) $(EXTRA_DIST) $(TEST_DIST) | (cd $$name; tar xf -); \ 447 tar -c -z -f $$name.tar.gz $$name; \ 448 rm -rf $$name 449 450 testlist: 451 echo $(TEST_DIST) 452 453 depend: $(GENSRC) 454 $(MKDEP) -c $(CC) -m $(DEPENDENCY_CFLAG) $(DEFS) $(INCLS) $(SRC) 455