1 # Copyright (c) 1993, 1994, 1995, 1996
2 # The Regents of the University of California. All rights reserved.
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
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.
21 # Various configurable paths (remember to edit Makefile.in, not Makefile)
26 exec_prefix = @
exec_prefix@
27 datarootdir
= @datarootdir@
28 # Pathname of directory to install the configure program
30 # Pathname of directory to install the rpcapd daemon
32 # Pathname of directory to install the include files
33 includedir = @
includedir@
34 # Pathname of directory to install the library
36 # Pathname of directory to install the man pages
41 top_srcdir
= @top_srcdir@
45 # You shouldn't need to edit anything below.
54 SHLIB_CCOPT
= @V_SHLIB_CCOPT@
56 DEFS
= -DBUILDING_PCAP
-Dpcap_EXPORTS @DEFS@ @V_DEFS@
58 ADDLARCHIVEOBJS
= @ADDLARCHIVEOBJS@
61 CFLAGS
= @CFLAGS@
${CROSSFLAGS}
62 LDFLAGS
= @LDFLAGS@
${CROSSFLAGS}
65 DEPENDENCY_CFLAG
= @DEPENDENCY_CFLAG@
67 PTHREAD_LIBS
=@PTHREAD_LIBS@
68 BUILD_RPCAPD
=@BUILD_RPCAPD@
69 INSTALL_RPCAPD
=@INSTALL_RPCAPD@
71 # Standard CFLAGS for building members of a shared library
72 FULL_CFLAGS
= $(CCOPT
) @V_LIB_CCOPT_FAT@
$(SHLIB_CCOPT
) $(INCLS
) $(DEFS
) $(CFLAGS
)
75 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
76 INSTALL_DATA
= @INSTALL_DATA@
80 BISON_BYACC
= @BISON_BYACC@
83 $(CC
) $(FULL_CFLAGS
) -c
-o
$@
$<
85 PLATFORM_C_SRC
= @PLATFORM_C_SRC@
86 MODULE_C_SRC
= @MODULE_C_SRC@
87 REMOTE_C_SRC
= @REMOTE_C_SRC@
88 COMMON_C_SRC
= pcap.c gencode.c optimize.c nametoaddr.c etherent.c \
89 fmtutils.c pcap-util.c \
90 savefile.c sf-pcap.c sf-pcapng.c pcap-common.c \
91 bpf_image.c bpf_filter.c bpf_dump.c
92 GENERATED_C_SRC
= scanner.c grammar.c
95 SRC
= $(PLATFORM_C_SRC
) \
96 $(MODULE_C_SRC
) $(REMOTE_C_SRC
) $(COMMON_C_SRC
) \
99 OBJ
= $(SRC
:.c
=.o
) $(LIBOBJS
)
107 pcap
/can_socketcan.h \
108 pcap
/compiler-tests.h \
114 pcap
/pcap-inttypes.h \
136 pcap-usb-linux-common.h \
153 CLEANFILES
= $(OBJ
) libpcap.a libpcap.so.
`cat $(srcdir)/VERSION` \
154 $(PROG
)-`cat $(srcdir)/VERSION`.
tar.gz
$(GENERATED_C_SRC
) $(GENHDR
) \
155 lex.yy.c pcap-config libpcap.
pc libpcap.
$(DYEXT
)
161 pcap_compile
.3pcap.in \
162 pcap_datalink
.3pcap.in \
163 pcap_dump_open
.3pcap.in \
164 pcap_get_tstamp_precision
.3pcap.in \
165 pcap_list_datalinks
.3pcap.in \
166 pcap_list_tstamp_types
.3pcap.in \
167 pcap_open_dead
.3pcap.in \
168 pcap_open_offline
.3pcap.in \
169 pcap_set_immediate_mode
.3pcap.in \
170 pcap_set_tstamp_precision
.3pcap.in \
171 pcap_set_tstamp_type
.3pcap.in
173 MAN3PCAP_NOEXPAND
= \
174 pcap_activate
.3pcap \
175 pcap_breakloop
.3pcap \
176 pcap_can_set_rfmon
.3pcap \
179 pcap_datalink_name_to_val
.3pcap \
180 pcap_datalink_val_to_name
.3pcap \
182 pcap_dump_close
.3pcap \
183 pcap_dump_file
.3pcap \
184 pcap_dump_flush
.3pcap \
185 pcap_dump_ftell
.3pcap \
188 pcap_findalldevs
.3pcap \
189 pcap_freecode
.3pcap \
190 pcap_get_required_select_timeout
.3pcap \
191 pcap_get_selectable_fd
.3pcap \
195 pcap_is_swapped
.3pcap \
196 pcap_lib_version
.3pcap \
197 pcap_lookupdev
.3pcap \
198 pcap_lookupnet
.3pcap \
200 pcap_major_version
.3pcap \
202 pcap_offline_filter
.3pcap \
203 pcap_open_live
.3pcap \
204 pcap_set_buffer_size
.3pcap \
205 pcap_set_datalink
.3pcap \
206 pcap_set_promisc
.3pcap \
207 pcap_set_protocol_linux
.3pcap \
208 pcap_set_rfmon
.3pcap \
209 pcap_set_snaplen
.3pcap \
210 pcap_set_timeout
.3pcap \
211 pcap_setdirection
.3pcap \
212 pcap_setfilter
.3pcap \
213 pcap_setnonblock
.3pcap \
214 pcap_snapshot
.3pcap \
216 pcap_statustostr
.3pcap \
217 pcap_strerror
.3pcap \
218 pcap_tstamp_type_name_to_val
.3pcap \
219 pcap_tstamp_type_val_to_name
.3pcap
221 MAN3PCAP
= $(MAN3PCAP_NOEXPAND
) $(MAN3PCAP_EXPAND
:.in
=)
224 cbpf-savefile.manfile.in \
225 pcap-savefile.manfile.in
228 pcap-filter.manmisc.in \
229 pcap-linktype.manmisc.in \
230 pcap-tstamp.manmisc.in
235 ChmodBPF
/StartupParameters.plist \
241 Makefile-devel-adds \
245 doc
/README.haiku.md \
251 doc
/README.solaris.md \
252 doc
/README.windows.md \
260 cmake_uninstall.cmake.in \
262 cmake
/Modules
/FindAirPcap.cmake \
263 cmake
/Modules
/FindDAG.cmake \
264 cmake
/Modules
/Finddpdk.cmake \
265 cmake
/Modules
/FindFseeko.cmake \
266 cmake
/Modules
/FindLFS.cmake \
267 cmake
/Modules
/FindPacket.cmake \
268 cmake
/Modules
/FindSNF.cmake \
269 cmake
/Modules
/FindTC.cmake \
270 cmake
/have_siocglifconf.c \
281 instrument-functions.c \
289 missing
/win_asprintf.c \
292 org.tcpdump.chmod_bpf.plist \
298 pcap-bt-monitor-linux.c \
299 pcap-bt-monitor-linux.h \
315 pcap-netfilter-linux.c \
316 pcap-netfilter-linux.h \
333 rpcapd
/CMakeLists.txt \
335 rpcapd
/config_params.h \
342 rpcapd
/org.tcpdump.rpcapd.plist \
345 rpcapd
/rpcapd.inetd.conf \
346 rpcapd
/rpcapd.manadmin.in \
347 rpcapd
/rpcapd-config.manfile.in \
349 rpcapd
/rpcapd.socket \
350 rpcapd
/rpcapd.xinetd.conf \
351 rpcapd
/rpcapd@.service \
359 testprogs
/CMakeLists.txt \
360 testprogs
/Makefile.in \
361 testprogs
/activatetest.c \
362 testprogs
/can_set_rfmon_test.c \
363 testprogs
/capturetest.c \
364 testprogs
/filtertest.c \
365 testprogs
/findalldevstest.c \
366 testprogs
/findalldevstest-perf.c \
367 testprogs
/fuzz
/CMakeLists.txt \
368 testprogs
/fuzz
/fuzz_both.c \
369 testprogs
/fuzz
/fuzz_both.options \
370 testprogs
/fuzz
/fuzz_filter.c \
371 testprogs
/fuzz
/fuzz_filter.options \
372 testprogs
/fuzz
/fuzz_pcap.c \
373 testprogs
/fuzz
/fuzz_pcap.options \
374 testprogs
/fuzz
/onefile.c \
375 testprogs
/nonblocktest.c \
376 testprogs
/opentest.c \
377 testprogs
/reactivatetest.c \
378 testprogs
/selpolltest.c \
379 testprogs
/threadsignaltest.c \
381 testprogs
/valgrindtest.c \
382 testprogs
/visopts.py \
383 testprogs
/writecaptest.c
385 TEST_DIST
= `git -C "$$DIR" ls-files tests | grep -v 'tests/\..*'`
387 RELEASE_FILES
= $(COMMON_C_SRC
) $(HDR
) $(MAN1
) $(MAN3PCAP_EXPAND
) \
388 $(MAN3PCAP_NOEXPAND
) $(MANFILE
) $(MANMISC
) $(EXTRA_DIST
) \
391 all: libpcap.a shared
$(BUILD_RPCAPD
) libpcap.
pc pcap-config
395 $(AR
) rc
$@
$(OBJ
) $(ADDLARCHIVEOBJS
)
398 shared
: libpcap.
$(DYEXT
)
402 VER
=`cat $(srcdir)/VERSION`; \
403 MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
404 @V_SHLIB_CMD@
$(LDFLAGS
) @V_SHLIB_OPT@ @V_SONAME_OPT@
$@.
$$MAJOR_VER \
405 -o
$@.
$$VER $(OBJ
) $(ADDLOBJS
) $(LIBS
)
408 # The following rule succeeds, but the result is untested.
410 # In macOS, the libpcap dylib has the name "libpcap.A.dylib", with its
411 # full path as the install_name, and with the compatibility and current
412 # version both set to 1. The compatibility version is set to 1 so that
413 # programs built with a newer version of the library will run against
414 # older versions if they don't use APIs available in the newer version
415 # but not in the older version.
417 # We also use "A" as the major version, and 1 as the compatibility version,
418 # but set the current version to the value in VERSION, with any non-numeric
419 # stuff stripped off (the compatibility and current version must be of the
420 # form X[.Y[.Z]], with Y and Z possibly absent, and with all components
423 libpcap.dylib
: $(OBJ
)
425 VER
=`cat $(srcdir)/VERSION`; \
428 CURRENT_VER
=`sed 's/[^0-9.].*$$//' $(srcdir)/VERSION`; \
429 $(CC
) -dynamiclib
-undefined error
$(LDFLAGS
) @V_LIB_LDFLAGS_FAT@ \
430 -o libpcap.
$$VER.dylib
$(OBJ
) $(ADDLOBJS
) $(LIBS
) \
431 -install_name
$(libdir)/libpcap.
$$MAJOR_VER.dylib \
432 -compatibility_version
$$COMPAT_VER \
433 -current_version
$$CURRENT_VER
436 # The HP-UX linker manual says that the convention for a versioned library
437 # is libXXX.{number}, not libXXX.sl.{number}. That appears to be the case
438 # on at least one HP-UX 11.00 system; libXXX.sl is a symlink to
441 # The manual also says "library-level versioning" (think "sonames") was
442 # added in HP-UX 10.0.
444 # XXX - this assumes we're using the HP linker, rather than the GNU
445 # linker, even with GCC.
448 @MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
449 rm -f libpcap.
$$MAJOR_VER
450 MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
451 ld -b
$(LDFLAGS
) -o libpcap.
$$MAJOR_VER +h libpcap.
$$MAJOR_VER \
452 $(OBJ
) $(ADDLOBJS
) $(LIBS
)
455 # AIX is different from everybody else. A shared library is an archive
456 # library with one or more shared-object components. We still build a
457 # normal static archive library on AIX, for the benefit of the traditional
458 # scheme of building libpcap and tcpdump in subdirectories of the
459 # same directory, with tcpdump statically linked with the libpcap
460 # in question, but we also build a shared library as "libpcap.shareda"
461 # and install *it*, rather than the static library, as "libpcap.a".
463 libpcap.shareda
: $(OBJ
)
465 $(CC
) $(LDFLAGS
) @V_SHLIB_OPT@
-o shr.o
$(OBJ
) $(ADDLOBJS
) $(LIBS
)
469 # For platforms that don't support shared libraries (or on which we
470 # don't support shared libraries).
474 scanner.c
: $(srcdir)/scanner.l
475 $(LEX
) -P pcap_
--header-file
=scanner.h
--nounput
-o scanner.c
$<
477 ## Recover from the removal of $@
478 @if
test -f
$@
; then
:; else \
480 $(MAKE
) $(MAKEFLAGS
) scanner.c
; \
483 scanner.o
: scanner.c grammar.h
484 $(CC
) $(FULL_CFLAGS
) -c scanner.c
487 # Generate the grammar.y file.
489 # Some Makes, e.g. AIX Make and Solaris Make, can't handle "--file=$@.tmp:$<";
490 # for example, the Solaris 9 make man page says
492 # Because make assigns $< and $* as it would for implicit rules
493 # (according to the suffixes list and the directory contents),
494 # they may be unreliable when used within explicit target entries.
496 # and this is an explicit target entry.
498 # Therefore, instead of using $<, we explicitly put in $(srcdir)/grammar.y.in.
500 grammar.y
: $(srcdir)/grammar.y.in .
/config.status
502 .
/config.status
--file
=$@.tmp
:$(srcdir)/grammar.y.in
506 $(BISON_BYACC
) -p pcap_
-o grammar.c
-d
$<
508 ## Recover from the removal of $@
509 @if
test -f
$@
; then
:; else \
511 $(MAKE
) $(MAKEFLAGS
) grammar.c
; \
514 grammar.o
: grammar.c scanner.h
515 $(CC
) $(FULL_CFLAGS
) -c grammar.c
517 gencode.o
: $(srcdir)/gencode.c grammar.h scanner.h
518 $(CC
) $(FULL_CFLAGS
) -c
$(srcdir)/gencode.c
520 asprintf.o
: $(srcdir)/missing
/asprintf.c
521 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/asprintf.c
523 strlcat.o
: $(srcdir)/missing
/strlcat.c
524 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/strlcat.c
526 strlcpy.o
: $(srcdir)/missing
/strlcpy.c
527 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/strlcpy.c
529 strtok_r.o
: $(srcdir)/missing
/strtok_r.c
530 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/strtok_r.c
533 # Generate the libpcap.pc file.
535 # Some Makes, e.g. AIX Make and Solaris Make, can't handle "--file=$@.tmp:$<";
536 # for example, the Solaris 9 make man page says
538 # Because make assigns $< and $* as it would for implicit rules
539 # (according to the suffixes list and the directory contents),
540 # they may be unreliable when used within explicit target entries.
542 # and this is an explicit target entry.
544 # Therefore, instead of using $<, we explicitly put in $(srcdir)/libpcap.pc.in.
546 libpcap.
pc: $(srcdir)/libpcap.
pc.in .
/config.status
548 .
/config.status
--file
=$@.tmp
:$(srcdir)/libpcap.
pc.in
552 # Generate the pcap-config script. See above.
554 pcap-config
: $(srcdir)/pcap-config.in .
/config.status
556 .
/config.status
--file
=$@.tmp
:$(srcdir)/pcap-config.in
561 # Remote pcap daemon.
563 build-rpcapd
: libpcap.a
567 # Test programs - not built by default, and not installed.
569 testprogs
: FORCE libpcap.a
570 (cd testprogs
; $(MAKE
) CFLAGS
="$(CFLAGS)")
574 install: install-shared install-archive libpcap.
pc pcap-config @INSTALL_RPCAPD@
575 [ -d
$(DESTDIR
)$(libdir) ] || \
576 (mkdir
-p
$(DESTDIR
)$(libdir); chmod
755 $(DESTDIR
)$(libdir))
577 [ -d
$(DESTDIR
)$(includedir) ] || \
578 (mkdir
-p
$(DESTDIR
)$(includedir); chmod
755 $(DESTDIR
)$(includedir))
579 [ -d
$(DESTDIR
)$(includedir)/pcap
] || \
580 (mkdir
-p
$(DESTDIR
)$(includedir)/pcap
; chmod
755 $(DESTDIR
)$(includedir)/pcap
)
581 [ -d
$(DESTDIR
)$(mandir)/man1
] || \
582 (mkdir
-p
$(DESTDIR
)$(mandir)/man1
; chmod
755 $(DESTDIR
)$(mandir)/man1
)
583 [ -d
$(DESTDIR
)$(mandir)/man3
] || \
584 (mkdir
-p
$(DESTDIR
)$(mandir)/man3
; chmod
755 $(DESTDIR
)$(mandir)/man3
)
585 [ -d
$(DESTDIR
)$(mandir)/man@MAN_FILE_FORMATS@
] || \
586 (mkdir
-p
$(DESTDIR
)$(mandir)/man@MAN_FILE_FORMATS@
; chmod
755 $(DESTDIR
)$(mandir)/man@MAN_FILE_FORMATS@
)
587 [ -d
$(DESTDIR
)$(mandir)/man@MAN_MISC_INFO@
] || \
588 (mkdir
-p
$(DESTDIR
)$(mandir)/man@MAN_MISC_INFO@
; chmod
755 $(DESTDIR
)$(mandir)/man@MAN_MISC_INFO@
)
589 for i in
$(PUBHDR
); do \
590 $(INSTALL_DATA
) $(srcdir)/$$i \
591 $(DESTDIR
)$(includedir)/$$i; done
592 [ -d
$(DESTDIR
)$(bindir) ] || \
593 (mkdir
-p
$(DESTDIR
)$(bindir); chmod
755 $(DESTDIR
)$(bindir))
594 $(INSTALL_PROGRAM
) pcap-config
$(DESTDIR
)$(bindir)/pcap-config
595 [ -d
$(DESTDIR
)$(libdir)/pkgconfig
] || \
596 (mkdir
-p
$(DESTDIR
)$(libdir)/pkgconfig
; chmod
755 $(DESTDIR
)$(libdir)/pkgconfig
)
597 $(INSTALL_DATA
) libpcap.
pc $(DESTDIR
)$(libdir)/pkgconfig
/libpcap.
pc
598 for i in
$(MAN1
); do \
599 $(INSTALL_DATA
) $(srcdir)/$$i \
600 $(DESTDIR
)$(mandir)/man1
/$$i; done
601 for i in
$(MAN3PCAP_NOEXPAND
); do \
602 $(INSTALL_DATA
) $(srcdir)/$$i \
603 $(DESTDIR
)$(mandir)/man3
/$$i; done
604 for i in
$(MAN3PCAP_EXPAND
:.in
=); do \
605 $(INSTALL_DATA
) $$i \
606 $(DESTDIR
)$(mandir)/man3
/$$i; done
607 (cd
$(DESTDIR
)$(mandir)/man3
&& \
608 rm -f pcap_datalink_val_to_description
.3pcap
&& \
609 $(LN_S
) pcap_datalink_val_to_name
.3pcap \
610 pcap_datalink_val_to_description
.3pcap
&& \
611 rm -f pcap_datalink_val_to_description_or_dlt
.3pcap
&& \
612 $(LN_S
) pcap_datalink_val_to_name
.3pcap \
613 pcap_datalink_val_to_description_or_dlt
.3pcap
&& \
614 rm -f pcap_dump_fopen
.3pcap
&& \
615 $(LN_S
) pcap_dump_open
.3pcap pcap_dump_fopen
.3pcap
&& \
616 rm -f pcap_freealldevs
.3pcap
&& \
617 $(LN_S
) pcap_findalldevs
.3pcap pcap_freealldevs
.3pcap
&& \
618 rm -f pcap_perror
.3pcap
&& \
619 $(LN_S
) pcap_geterr
.3pcap pcap_perror
.3pcap
&& \
620 rm -f pcap_sendpacket
.3pcap
&& \
621 $(LN_S
) pcap_inject
.3pcap pcap_sendpacket
.3pcap
&& \
622 rm -f pcap_free_datalinks
.3pcap
&& \
623 $(LN_S
) pcap_list_datalinks
.3pcap pcap_free_datalinks
.3pcap
&& \
624 rm -f pcap_free_tstamp_types
.3pcap
&& \
625 $(LN_S
) pcap_list_tstamp_types
.3pcap pcap_free_tstamp_types
.3pcap
&& \
626 rm -f pcap_dispatch
.3pcap
&& \
627 $(LN_S
) pcap_loop
.3pcap pcap_dispatch
.3pcap
&& \
628 rm -f pcap_minor_version
.3pcap
&& \
629 $(LN_S
) pcap_major_version
.3pcap pcap_minor_version
.3pcap
&& \
630 rm -f pcap_next
.3pcap
&& \
631 $(LN_S
) pcap_next_ex
.3pcap pcap_next
.3pcap
&& \
632 rm -f pcap_open_dead_with_tstamp_precision
.3pcap
&& \
633 $(LN_S
) pcap_open_dead
.3pcap \
634 pcap_open_dead_with_tstamp_precision
.3pcap
&& \
635 rm -f pcap_open_offline_with_tstamp_precision
.3pcap
&& \
636 $(LN_S
) pcap_open_offline
.3pcap pcap_open_offline_with_tstamp_precision
.3pcap
&& \
637 rm -f pcap_fopen_offline
.3pcap
&& \
638 $(LN_S
) pcap_open_offline
.3pcap pcap_fopen_offline
.3pcap
&& \
639 rm -f pcap_fopen_offline_with_tstamp_precision
.3pcap
&& \
640 $(LN_S
) pcap_open_offline
.3pcap pcap_fopen_offline_with_tstamp_precision
.3pcap
&& \
641 rm -f pcap_tstamp_type_val_to_description
.3pcap
&& \
642 $(LN_S
) pcap_tstamp_type_val_to_name
.3pcap pcap_tstamp_type_val_to_description
.3pcap
&& \
643 rm -f pcap_getnonblock
.3pcap
&& \
644 $(LN_S
) pcap_setnonblock
.3pcap pcap_getnonblock
.3pcap
)
645 for i in
$(MANFILE
); do \
646 $(INSTALL_DATA
) `echo $$i | sed 's/.manfile.in/.manfile/'` \
647 $(DESTDIR
)$(mandir)/man@MAN_FILE_FORMATS@
/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
648 for i in
$(MANMISC
); do \
649 $(INSTALL_DATA
) `echo $$i | sed 's/.manmisc.in/.manmisc/'` \
650 $(DESTDIR
)$(mandir)/man@MAN_MISC_INFO@
/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
652 install-shared
: install-shared-
$(DYEXT
)
653 install-shared-so
: libpcap.so
654 [ -d
$(DESTDIR
)$(libdir) ] || \
655 (mkdir
-p
$(DESTDIR
)$(libdir); chmod
755 $(DESTDIR
)$(libdir))
656 VER
=`cat $(srcdir)/VERSION`; \
657 MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
658 $(INSTALL_PROGRAM
) libpcap.so.
$$VER $(DESTDIR
)$(libdir)/libpcap.so.
$$VER; \
659 ln
-sf libpcap.so.
$$VER $(DESTDIR
)$(libdir)/libpcap.so.
$$MAJOR_VER; \
660 ln
-sf libpcap.so.
$$MAJOR_VER $(DESTDIR
)$(libdir)/libpcap.so
661 install-shared-dylib
: libpcap.dylib
662 [ -d
$(DESTDIR
)$(libdir) ] || \
663 (mkdir
-p
$(DESTDIR
)$(libdir); chmod
755 $(DESTDIR
)$(libdir))
664 VER
=`cat $(srcdir)/VERSION`; \
666 $(INSTALL_PROGRAM
) libpcap.
$$VER.dylib
$(DESTDIR
)$(libdir)/libpcap.
$$VER.dylib
; \
667 ln
-sf libpcap.
$$VER.dylib
$(DESTDIR
)$(libdir)/libpcap.
$$MAJOR_VER.dylib
; \
668 ln
-sf libpcap.
$$MAJOR_VER.dylib
$(DESTDIR
)$(libdir)/libpcap.dylib
669 install-shared-sl
: libpcap.sl
670 [ -d
$(DESTDIR
)$(libdir) ] || \
671 (mkdir
-p
$(DESTDIR
)$(libdir); chmod
755 $(DESTDIR
)$(libdir))
672 MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
673 $(INSTALL_PROGRAM
) libpcap.
$$MAJOR_VER $(DESTDIR
)$(libdir)
674 ln
-sf libpcap.
$$MAJOR_VER $(DESTDIR
)$(libdir)/libpcap.sl
676 # AIX shared libraries are weird. They're archive libraries
677 # with one or more shared object components.
679 install-shared-shareda
: libpcap.shareda
680 [ -d
$(DESTDIR
)$(libdir) ] || \
681 (mkdir
-p
$(DESTDIR
)$(libdir); chmod
755 $(DESTDIR
)$(libdir))
682 $(INSTALL_PROGRAM
) libpcap.shareda
$(DESTDIR
)$(libdir)/libpcap.a
685 install-archive
: install-archive-
$(DYEXT
)
687 # Most platforms have separate suffixes for shared and
688 # archive libraries, so we install both.
690 install-archive-so install-archive-dylib install-archive-sl install-archive-none
: libpcap.a
691 [ -d
$(DESTDIR
)$(libdir) ] || \
692 (mkdir
-p
$(DESTDIR
)$(libdir); chmod
755 $(DESTDIR
)$(libdir))
693 $(INSTALL_DATA
) libpcap.a
$(DESTDIR
)$(libdir)/libpcap.a
694 $(RANLIB
) $(DESTDIR
)$(libdir)/libpcap.a
696 # AIX, however, doesn't, so we don't install the archive
699 install-archive-shareda
:
702 (cd rpcapd
; $(MAKE
) DESTDIR
=$(DESTDIR
) install)
704 uninstall: uninstall-shared uninstall-rpcapd
705 rm -f
$(DESTDIR
)$(libdir)/libpcap.a
706 for i in
$(PUBHDR
); do \
707 rm -f
$(DESTDIR
)$(includedir)/$$i; done
708 -rmdir
$(DESTDIR
)$(includedir)/pcap
709 rm -f
$(DESTDIR
)/$(libdir)/pkgconfig
/libpcap.
pc
710 rm -f
$(DESTDIR
)/$(bindir)/pcap-config
711 for i in
$(MAN1
); do \
712 rm -f
$(DESTDIR
)$(mandir)/man1
/$$i; done
713 for i in
$(MAN3PCAP
); do \
714 rm -f
$(DESTDIR
)$(mandir)/man3
/$$i; done
715 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_datalink_val_to_description
.3pcap
716 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_datalink_val_to_description_or_dlt
.3pcap
717 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_dump_fopen
.3pcap
718 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_freealldevs
.3pcap
719 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_perror
.3pcap
720 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_sendpacket
.3pcap
721 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_free_datalinks
.3pcap
722 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_free_tstamp_types
.3pcap
723 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_dispatch
.3pcap
724 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_minor_version
.3pcap
725 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_next
.3pcap
726 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_open_dead_with_tstamp_precision
.3pcap
727 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_open_offline_with_tstamp_precision
.3pcap
728 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_fopen_offline
.3pcap
729 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_fopen_offline_with_tstamp_precision
.3pcap
730 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_getnonblock
.3pcap
731 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_tstamp_type_val_to_description
.3pcap
732 for i in
$(MANFILE
); do \
733 rm -f
$(DESTDIR
)$(mandir)/man@MAN_FILE_FORMATS@
/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
734 for i in
$(MANMISC
); do \
735 rm -f
$(DESTDIR
)$(mandir)/man@MAN_MISC_INFO@
/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
737 uninstall-shared
: uninstall-shared-
$(DYEXT
)
739 VER
=`cat $(srcdir)/VERSION`; \
740 MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
741 rm -f
$(DESTDIR
)$(libdir)/libpcap.so.
$$VER; \
742 rm -f
$(DESTDIR
)$(libdir)/libpcap.so.
$$MAJOR_VER; \
743 rm -f
$(DESTDIR
)$(libdir)/libpcap.so
744 uninstall-shared-dylib
:
745 VER
=`cat $(srcdir)/VERSION`; \
747 rm -f
$(DESTDIR
)$(libdir)/libpcap.
$$VER.dylib
; \
748 rm -f
$(DESTDIR
)$(libdir)/libpcap.
$$MAJOR_VER.dylib
; \
749 rm -f
$(DESTDIR
)$(libdir)/libpcap.dylib
751 MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
752 rm -f
$(DESTDIR
)$(libdir)/libpcap.
$$MAJOR_VER; \
753 rm -f
$(DESTDIR
)$(libdir)/libpcap.sl
754 uninstall-shared-shareda
:
755 rm -f
$(DESTDIR
)$(libdir)/libpcap.a
756 uninstall-shared-none
:
759 (cd rpcapd
; $(MAKE
) DESTDIR
=$(DESTDIR
) uninstall)
762 rm -f
$(CLEANFILES
) config.h.in~ configure~ configure.ac~
763 (cd rpcapd
; $(MAKE
) clean)
764 (cd testprogs
; $(MAKE
) clean)
767 rm -f Makefile grammar.y config.cache config.log config.status \
768 config.h os-proto.h libpcap.
pc pcap-config stamp-h stamp-h.in
769 rm -f
$(MAN3PCAP_EXPAND
:.in
=) $(MANFILE
:.in
=) $(MANMISC
:.in
=)
770 rm -rf autom4te.cache
771 (cd rpcapd
; $(MAKE
) distclean)
772 (cd testprogs
; $(MAKE
) distclean)
778 ctags
-wtd
$(TAGFILES
)
781 # Use git archive piped to tar to construct a subdirectory whose name
782 # is libpcap-{release}, containing all the checked-in source files,
783 # and then run autoreconf in that directory to generate the configure
784 # script and other files from that source. Then remove autom4te.cache,
785 # construct the release tarball from that subdirectory, and remove
788 # The --format=tar is to force git archive to write a non-compressed
789 # archive, in case the platform's tar command doesn't have built-in
792 # The ^{tree} is there to force git archive not to write out the
793 # "helpful" global extended pax header with a commit ID, as not all
794 # versions of tar can handle that (Solaris tar can't, for example).
795 # (It turns HEAD, or a tag, both of which are apparently "tree-ish"es,
796 # into a tree; apparently, unlike HEAD, or a tag, which have a commit
797 # ID associated with them, the tree associated with them doesn't have
798 # a commit ID, so no commit ID is available to write, and thus
799 # git archive doesn't write one.)
802 @TAG
=$(PROG
)-`cat VERSION` && \
803 if
[ ! -d .git
]; then echo
'Not in a git clone, stop.'; exit
1; fi
&& \
804 TMPTESTFILE
=`mktemp -t tmptestfile_XXXXXXXX` && \
805 rm -f
"$$TMPTESTFILE" && \
806 AUTORECONF_DIR
=`dirname "$$TMPTESTFILE"`/"$(PROG)"_build_autoreconf_
$$$$ && \
808 rm -rf
"$$AUTORECONF_DIR" && \
809 mkdir
"$$AUTORECONF_DIR" && \
810 cd
"$$AUTORECONF_DIR" && \
811 if git
-C
"$$DIR" show-ref
--tags --quiet
--verify
-- "refs/tags/$$TAG"; then \
812 (git
-C
"$$DIR" archive
--format
=tar --prefix="$$TAG"/ "$$TAG^{tree}" $(RELEASE_FILES
) | \
814 echo
"Archive build from tag $$TAG."; \
816 (git
-C
"$$DIR" archive
--format
=tar --prefix="$$TAG"/ "HEAD^{tree}" $(RELEASE_FILES
) | \
818 echo
"No $$TAG tag. Archive build from HEAD."; \
820 (cd
"$$TAG" && .
/autogen.sh
&& rm -rf autom4te.cache
) && \
821 tar cf
"$$DIR/$$TAG".
tar "$$TAG" && \
822 rm -f
"$$DIR/$$TAG".
tar.gz
&& \
823 gzip
--best
"$$DIR/$$TAG".
tar && \
825 rm -rf
"$$AUTORECONF_DIR"
827 releasecheck
: releasetar
828 @TAG
=$(PROG
)-`cat VERSION` && \
829 INSTALL_DIR
=/tmp
/install_
"$$TAG"_
$$$$ && \
833 rm -rf
"$$INSTALL_DIR" && \
834 tar xf
"$$DIR"/"$$TAG".
tar.gz
&& \
836 echo
"[$@] $$ touch .devel" && \
838 echo
"[$@] $$ ./configure --enable-remote --quiet --prefix=$$INSTALL_DIR" && \
839 .
/configure
--enable-remote
--quiet
--prefix="$$INSTALL_DIR" && \
840 echo
'[$@] $$ $(MAKE) -s all testprogs' && \
841 $(MAKE
) -s
all testprogs
&& \
842 echo
'[$@] $$ $(MAKE) -s install' && \
843 $(MAKE
) -s
install && \
846 rm -rf
"$$INSTALL_DIR" && \
847 tar xf
"$$DIR"/"$$TAG".
tar.gz
&& \
849 echo
"[$@] $$ touch .devel" && \
853 echo
'[$@] $$ cmake -DENABLE_REMOTE=yes [...] ..' && \
854 cmake
-DENABLE_REMOTE
=yes \
855 -DCMAKE_INSTALL_PREFIX
="$$INSTALL_DIR" \
856 -DCMAKE_MESSAGE_LOG_LEVEL
=NOTICE \
857 -DCMAKE_RULE_MESSAGES
=OFF \
858 -DCMAKE_INSTALL_MESSAGE
=NEVER \
860 echo
'[$@] $$ $(MAKE) -s all testprogs' && \
861 $(MAKE
) -s
all testprogs
&& \
862 echo
'[$@] $$ $(MAKE) -s install' && \
863 $(MAKE
) -s
install && \
866 rm -rf
"$$INSTALL_DIR" && \
870 @
# trailing space(s)?
871 @if git grep
-I
-n
' $$' $$(git ls-files|grep
-v
'^tests/'); then \
872 echo
'Error: Trailing space(s).'; \
876 @if git grep
-I
-n
' $$' $$(git ls-files|grep
-v
'^tests/'); then \
877 echo
'Error: Trailing tabs(s).'; \
880 @
# space(s) before tab(s)?
881 @if git grep
-I
-n
'[ ][ ]' $$(git ls-files|grep
-v
'^tests/'); then \
882 echo
'Error: space(s) before tab(s).'; \
886 depend
: $(GENERATED_C_SRC
) $(GENHDR
)
887 $(MKDEP
) -c
$(CC
) -m
"$(DEPENDENCY_CFLAG)" -s
"$(srcdir)" $(CFLAGS
) $(DEFS
) $(INCLS
) $(SRC
)
888 (cd rpcapd
; $(MAKE
) depend
)
889 (cd testprogs
; $(MAKE
) depend
)
892 shellcheck
-f gcc
-e SC2006 autogen.sh build.sh build_matrix.sh build_common.sh mkdep .ci-coverity-scan-build.sh