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
/FindDAG.cmake \
263 cmake
/Modules
/Finddpdk.cmake \
264 cmake
/Modules
/FindFseeko.cmake \
265 cmake
/Modules
/FindLFS.cmake \
266 cmake
/Modules
/FindPacket.cmake \
267 cmake
/Modules
/FindSNF.cmake \
268 cmake
/have_siocglifconf.c \
279 instrument-functions.c \
287 missing
/win_asprintf.c \
290 org.tcpdump.chmod_bpf.plist \
294 pcap-bt-monitor-linux.c \
295 pcap-bt-monitor-linux.h \
311 pcap-netfilter-linux.c \
312 pcap-netfilter-linux.h \
325 rpcapd
/CMakeLists.txt \
327 rpcapd
/config_params.h \
334 rpcapd
/org.tcpdump.rpcapd.plist \
337 rpcapd
/rpcapd.inetd.conf \
338 rpcapd
/rpcapd.manadmin.in \
339 rpcapd
/rpcapd-config.manfile.in \
341 rpcapd
/rpcapd.socket \
342 rpcapd
/rpcapd.xinetd.conf \
343 rpcapd
/rpcapd@.service \
351 testprogs
/CMakeLists.txt \
352 testprogs
/Makefile.in \
353 testprogs
/activatetest.c \
354 testprogs
/can_set_rfmon_test.c \
355 testprogs
/capturetest.c \
356 testprogs
/filtertest.c \
357 testprogs
/findalldevstest.c \
358 testprogs
/findalldevstest-perf.c \
359 testprogs
/fuzz
/CMakeLists.txt \
360 testprogs
/fuzz
/fuzz_both.c \
361 testprogs
/fuzz
/fuzz_both.options \
362 testprogs
/fuzz
/fuzz_filter.c \
363 testprogs
/fuzz
/fuzz_filter.options \
364 testprogs
/fuzz
/fuzz_pcap.c \
365 testprogs
/fuzz
/fuzz_pcap.options \
366 testprogs
/fuzz
/onefile.c \
367 testprogs
/nonblocktest.c \
368 testprogs
/opentest.c \
369 testprogs
/reactivatetest.c \
370 testprogs
/selpolltest.c \
371 testprogs
/threadsignaltest.c \
373 testprogs
/valgrindtest.c \
374 testprogs
/visopts.py \
375 testprogs
/writecaptest.c
377 TEST_DIST
= `git -C "$$DIR" ls-files tests | grep -v 'tests/\..*'`
379 RELEASE_FILES
= $(COMMON_C_SRC
) $(HDR
) $(MAN1
) $(MAN3PCAP_EXPAND
) \
380 $(MAN3PCAP_NOEXPAND
) $(MANFILE
) $(MANMISC
) $(EXTRA_DIST
) \
383 all: libpcap.a shared
$(BUILD_RPCAPD
) libpcap.
pc pcap-config
387 $(AR
) rc
$@
$(OBJ
) $(ADDLARCHIVEOBJS
)
390 shared
: libpcap.
$(DYEXT
)
394 VER
=`cat $(srcdir)/VERSION`; \
395 MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
396 @V_SHLIB_CMD@
$(LDFLAGS
) @V_SHLIB_OPT@ @V_SONAME_OPT@
$@.
$$MAJOR_VER \
397 -o
$@.
$$VER $(OBJ
) $(ADDLOBJS
) $(LIBS
)
400 # The following rule succeeds, but the result is untested.
402 # In macOS, the libpcap dylib has the name "libpcap.A.dylib", with its
403 # full path as the install_name, and with the compatibility and current
404 # version both set to 1. The compatibility version is set to 1 so that
405 # programs built with a newer version of the library will run against
406 # older versions if they don't use APIs available in the newer version
407 # but not in the older version.
409 # We also use "A" as the major version, and 1 as the compatibility version,
410 # but set the current version to the value in VERSION, with any non-numeric
411 # stuff stripped off (the compatibility and current version must be of the
412 # form X[.Y[.Z]], with Y and Z possibly absent, and with all components
415 libpcap.dylib
: $(OBJ
)
417 VER
=`cat $(srcdir)/VERSION`; \
420 CURRENT_VER
=`sed 's/[^0-9.].*$$//' $(srcdir)/VERSION`; \
421 $(CC
) -dynamiclib
-undefined error
$(LDFLAGS
) @V_LIB_LDFLAGS_FAT@ \
422 -o libpcap.
$$VER.dylib
$(OBJ
) $(ADDLOBJS
) $(LIBS
) \
423 -install_name
$(libdir)/libpcap.
$$MAJOR_VER.dylib \
424 -compatibility_version
$$COMPAT_VER \
425 -current_version
$$CURRENT_VER
428 # The HP-UX linker manual says that the convention for a versioned library
429 # is libXXX.{number}, not libXXX.sl.{number}. That appears to be the case
430 # on at least one HP-UX 11.00 system; libXXX.sl is a symlink to
433 # The manual also says "library-level versioning" (think "sonames") was
434 # added in HP-UX 10.0.
436 # XXX - this assumes we're using the HP linker, rather than the GNU
437 # linker, even with GCC.
440 @MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
441 rm -f libpcap.
$$MAJOR_VER
442 MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
443 ld -b
$(LDFLAGS
) -o libpcap.
$$MAJOR_VER +h libpcap.
$$MAJOR_VER \
444 $(OBJ
) $(ADDLOBJS
) $(LIBS
)
447 # AIX is different from everybody else. A shared library is an archive
448 # library with one or more shared-object components. We still build a
449 # normal static archive library on AIX, for the benefit of the traditional
450 # scheme of building libpcap and tcpdump in subdirectories of the
451 # same directory, with tcpdump statically linked with the libpcap
452 # in question, but we also build a shared library as "libpcap.shareda"
453 # and install *it*, rather than the static library, as "libpcap.a".
455 libpcap.shareda
: $(OBJ
)
457 $(CC
) $(LDFLAGS
) @V_SHLIB_OPT@
-o shr.o
$(OBJ
) $(ADDLOBJS
) $(LIBS
)
461 # For platforms that don't support shared libraries (or on which we
462 # don't support shared libraries).
466 scanner.c
: $(srcdir)/scanner.l
467 $(LEX
) -P pcap_
--header-file
=scanner.h
--nounput
-o scanner.c
$<
469 ## Recover from the removal of $@
470 @if
test -f
$@
; then
:; else \
472 $(MAKE
) $(MAKEFLAGS
) scanner.c
; \
475 scanner.o
: scanner.c grammar.h
476 $(CC
) $(FULL_CFLAGS
) -c scanner.c
479 # Generate the grammar.y file.
481 # Some Makes, e.g. AIX Make and Solaris Make, can't handle "--file=$@.tmp:$<";
482 # for example, the Solaris 9 make man page says
484 # Because make assigns $< and $* as it would for implicit rules
485 # (according to the suffixes list and the directory contents),
486 # they may be unreliable when used within explicit target entries.
488 # and this is an explicit target entry.
490 # Therefore, instead of using $<, we explicitly put in $(srcdir)/grammar.y.in.
492 grammar.y
: $(srcdir)/grammar.y.in .
/config.status
494 .
/config.status
--file
=$@.tmp
:$(srcdir)/grammar.y.in
498 $(BISON_BYACC
) -p pcap_
-o grammar.c
-d
$<
500 ## Recover from the removal of $@
501 @if
test -f
$@
; then
:; else \
503 $(MAKE
) $(MAKEFLAGS
) grammar.c
; \
506 grammar.o
: grammar.c scanner.h
507 $(CC
) $(FULL_CFLAGS
) -c grammar.c
509 gencode.o
: $(srcdir)/gencode.c grammar.h scanner.h
510 $(CC
) $(FULL_CFLAGS
) -c
$(srcdir)/gencode.c
512 asprintf.o
: $(srcdir)/missing
/asprintf.c
513 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/asprintf.c
515 strlcat.o
: $(srcdir)/missing
/strlcat.c
516 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/strlcat.c
518 strlcpy.o
: $(srcdir)/missing
/strlcpy.c
519 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/strlcpy.c
521 strtok_r.o
: $(srcdir)/missing
/strtok_r.c
522 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/strtok_r.c
525 # Generate the libpcap.pc file.
527 # Some Makes, e.g. AIX Make and Solaris Make, can't handle "--file=$@.tmp:$<";
528 # for example, the Solaris 9 make man page says
530 # Because make assigns $< and $* as it would for implicit rules
531 # (according to the suffixes list and the directory contents),
532 # they may be unreliable when used within explicit target entries.
534 # and this is an explicit target entry.
536 # Therefore, instead of using $<, we explicitly put in $(srcdir)/libpcap.pc.in.
538 libpcap.
pc: $(srcdir)/libpcap.
pc.in .
/config.status
540 .
/config.status
--file
=$@.tmp
:$(srcdir)/libpcap.
pc.in
544 # Generate the pcap-config script. See above.
546 pcap-config
: $(srcdir)/pcap-config.in .
/config.status
548 .
/config.status
--file
=$@.tmp
:$(srcdir)/pcap-config.in
553 # Remote pcap daemon.
555 build-rpcapd
: libpcap.a
559 # Test programs - not built by default, and not installed.
561 testprogs
: FORCE libpcap.a
562 (cd testprogs
; $(MAKE
) CFLAGS
="$(CFLAGS)")
566 install: install-shared install-archive libpcap.
pc pcap-config @INSTALL_RPCAPD@
567 [ -d
$(DESTDIR
)$(libdir) ] || \
568 (mkdir
-p
$(DESTDIR
)$(libdir); chmod
755 $(DESTDIR
)$(libdir))
569 [ -d
$(DESTDIR
)$(includedir) ] || \
570 (mkdir
-p
$(DESTDIR
)$(includedir); chmod
755 $(DESTDIR
)$(includedir))
571 [ -d
$(DESTDIR
)$(includedir)/pcap
] || \
572 (mkdir
-p
$(DESTDIR
)$(includedir)/pcap
; chmod
755 $(DESTDIR
)$(includedir)/pcap
)
573 [ -d
$(DESTDIR
)$(mandir)/man1
] || \
574 (mkdir
-p
$(DESTDIR
)$(mandir)/man1
; chmod
755 $(DESTDIR
)$(mandir)/man1
)
575 [ -d
$(DESTDIR
)$(mandir)/man3
] || \
576 (mkdir
-p
$(DESTDIR
)$(mandir)/man3
; chmod
755 $(DESTDIR
)$(mandir)/man3
)
577 [ -d
$(DESTDIR
)$(mandir)/man@MAN_FILE_FORMATS@
] || \
578 (mkdir
-p
$(DESTDIR
)$(mandir)/man@MAN_FILE_FORMATS@
; chmod
755 $(DESTDIR
)$(mandir)/man@MAN_FILE_FORMATS@
)
579 [ -d
$(DESTDIR
)$(mandir)/man@MAN_MISC_INFO@
] || \
580 (mkdir
-p
$(DESTDIR
)$(mandir)/man@MAN_MISC_INFO@
; chmod
755 $(DESTDIR
)$(mandir)/man@MAN_MISC_INFO@
)
581 for i in
$(PUBHDR
); do \
582 $(INSTALL_DATA
) $(srcdir)/$$i \
583 $(DESTDIR
)$(includedir)/$$i; done
584 [ -d
$(DESTDIR
)$(bindir) ] || \
585 (mkdir
-p
$(DESTDIR
)$(bindir); chmod
755 $(DESTDIR
)$(bindir))
586 $(INSTALL_PROGRAM
) pcap-config
$(DESTDIR
)$(bindir)/pcap-config
587 [ -d
$(DESTDIR
)$(libdir)/pkgconfig
] || \
588 (mkdir
-p
$(DESTDIR
)$(libdir)/pkgconfig
; chmod
755 $(DESTDIR
)$(libdir)/pkgconfig
)
589 $(INSTALL_DATA
) libpcap.
pc $(DESTDIR
)$(libdir)/pkgconfig
/libpcap.
pc
590 for i in
$(MAN1
); do \
591 $(INSTALL_DATA
) $(srcdir)/$$i \
592 $(DESTDIR
)$(mandir)/man1
/$$i; done
593 for i in
$(MAN3PCAP_NOEXPAND
); do \
594 $(INSTALL_DATA
) $(srcdir)/$$i \
595 $(DESTDIR
)$(mandir)/man3
/$$i; done
596 for i in
$(MAN3PCAP_EXPAND
:.in
=); do \
597 $(INSTALL_DATA
) $$i \
598 $(DESTDIR
)$(mandir)/man3
/$$i; done
599 (cd
$(DESTDIR
)$(mandir)/man3
&& \
600 rm -f pcap_datalink_val_to_description
.3pcap
&& \
601 $(LN_S
) pcap_datalink_val_to_name
.3pcap \
602 pcap_datalink_val_to_description
.3pcap
&& \
603 rm -f pcap_datalink_val_to_description_or_dlt
.3pcap
&& \
604 $(LN_S
) pcap_datalink_val_to_name
.3pcap \
605 pcap_datalink_val_to_description_or_dlt
.3pcap
&& \
606 rm -f pcap_dump_fopen
.3pcap
&& \
607 $(LN_S
) pcap_dump_open
.3pcap pcap_dump_fopen
.3pcap
&& \
608 rm -f pcap_freealldevs
.3pcap
&& \
609 $(LN_S
) pcap_findalldevs
.3pcap pcap_freealldevs
.3pcap
&& \
610 rm -f pcap_perror
.3pcap
&& \
611 $(LN_S
) pcap_geterr
.3pcap pcap_perror
.3pcap
&& \
612 rm -f pcap_sendpacket
.3pcap
&& \
613 $(LN_S
) pcap_inject
.3pcap pcap_sendpacket
.3pcap
&& \
614 rm -f pcap_free_datalinks
.3pcap
&& \
615 $(LN_S
) pcap_list_datalinks
.3pcap pcap_free_datalinks
.3pcap
&& \
616 rm -f pcap_free_tstamp_types
.3pcap
&& \
617 $(LN_S
) pcap_list_tstamp_types
.3pcap pcap_free_tstamp_types
.3pcap
&& \
618 rm -f pcap_dispatch
.3pcap
&& \
619 $(LN_S
) pcap_loop
.3pcap pcap_dispatch
.3pcap
&& \
620 rm -f pcap_minor_version
.3pcap
&& \
621 $(LN_S
) pcap_major_version
.3pcap pcap_minor_version
.3pcap
&& \
622 rm -f pcap_next
.3pcap
&& \
623 $(LN_S
) pcap_next_ex
.3pcap pcap_next
.3pcap
&& \
624 rm -f pcap_open_dead_with_tstamp_precision
.3pcap
&& \
625 $(LN_S
) pcap_open_dead
.3pcap \
626 pcap_open_dead_with_tstamp_precision
.3pcap
&& \
627 rm -f pcap_open_offline_with_tstamp_precision
.3pcap
&& \
628 $(LN_S
) pcap_open_offline
.3pcap pcap_open_offline_with_tstamp_precision
.3pcap
&& \
629 rm -f pcap_fopen_offline
.3pcap
&& \
630 $(LN_S
) pcap_open_offline
.3pcap pcap_fopen_offline
.3pcap
&& \
631 rm -f pcap_fopen_offline_with_tstamp_precision
.3pcap
&& \
632 $(LN_S
) pcap_open_offline
.3pcap pcap_fopen_offline_with_tstamp_precision
.3pcap
&& \
633 rm -f pcap_tstamp_type_val_to_description
.3pcap
&& \
634 $(LN_S
) pcap_tstamp_type_val_to_name
.3pcap pcap_tstamp_type_val_to_description
.3pcap
&& \
635 rm -f pcap_getnonblock
.3pcap
&& \
636 $(LN_S
) pcap_setnonblock
.3pcap pcap_getnonblock
.3pcap
)
637 for i in
$(MANFILE
); do \
638 $(INSTALL_DATA
) `echo $$i | sed 's/.manfile.in/.manfile/'` \
639 $(DESTDIR
)$(mandir)/man@MAN_FILE_FORMATS@
/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
640 for i in
$(MANMISC
); do \
641 $(INSTALL_DATA
) `echo $$i | sed 's/.manmisc.in/.manmisc/'` \
642 $(DESTDIR
)$(mandir)/man@MAN_MISC_INFO@
/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
644 install-shared
: install-shared-
$(DYEXT
)
645 install-shared-so
: libpcap.so
646 [ -d
$(DESTDIR
)$(libdir) ] || \
647 (mkdir
-p
$(DESTDIR
)$(libdir); chmod
755 $(DESTDIR
)$(libdir))
648 VER
=`cat $(srcdir)/VERSION`; \
649 MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
650 $(INSTALL_PROGRAM
) libpcap.so.
$$VER $(DESTDIR
)$(libdir)/libpcap.so.
$$VER; \
651 ln
-sf libpcap.so.
$$VER $(DESTDIR
)$(libdir)/libpcap.so.
$$MAJOR_VER; \
652 ln
-sf libpcap.so.
$$MAJOR_VER $(DESTDIR
)$(libdir)/libpcap.so
653 install-shared-dylib
: libpcap.dylib
654 [ -d
$(DESTDIR
)$(libdir) ] || \
655 (mkdir
-p
$(DESTDIR
)$(libdir); chmod
755 $(DESTDIR
)$(libdir))
656 VER
=`cat $(srcdir)/VERSION`; \
658 $(INSTALL_PROGRAM
) libpcap.
$$VER.dylib
$(DESTDIR
)$(libdir)/libpcap.
$$VER.dylib
; \
659 ln
-sf libpcap.
$$VER.dylib
$(DESTDIR
)$(libdir)/libpcap.
$$MAJOR_VER.dylib
; \
660 ln
-sf libpcap.
$$MAJOR_VER.dylib
$(DESTDIR
)$(libdir)/libpcap.dylib
661 install-shared-sl
: libpcap.sl
662 [ -d
$(DESTDIR
)$(libdir) ] || \
663 (mkdir
-p
$(DESTDIR
)$(libdir); chmod
755 $(DESTDIR
)$(libdir))
664 MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
665 $(INSTALL_PROGRAM
) libpcap.
$$MAJOR_VER $(DESTDIR
)$(libdir)
666 ln
-sf libpcap.
$$MAJOR_VER $(DESTDIR
)$(libdir)/libpcap.sl
668 # AIX shared libraries are weird. They're archive libraries
669 # with one or more shared object components.
671 install-shared-shareda
: libpcap.shareda
672 [ -d
$(DESTDIR
)$(libdir) ] || \
673 (mkdir
-p
$(DESTDIR
)$(libdir); chmod
755 $(DESTDIR
)$(libdir))
674 $(INSTALL_PROGRAM
) libpcap.shareda
$(DESTDIR
)$(libdir)/libpcap.a
677 install-archive
: install-archive-
$(DYEXT
)
679 # Most platforms have separate suffixes for shared and
680 # archive libraries, so we install both.
682 install-archive-so install-archive-dylib install-archive-sl install-archive-none
: libpcap.a
683 [ -d
$(DESTDIR
)$(libdir) ] || \
684 (mkdir
-p
$(DESTDIR
)$(libdir); chmod
755 $(DESTDIR
)$(libdir))
685 $(INSTALL_DATA
) libpcap.a
$(DESTDIR
)$(libdir)/libpcap.a
686 $(RANLIB
) $(DESTDIR
)$(libdir)/libpcap.a
688 # AIX, however, doesn't, so we don't install the archive
691 install-archive-shareda
:
694 (cd rpcapd
; $(MAKE
) DESTDIR
=$(DESTDIR
) install)
696 uninstall: uninstall-shared uninstall-rpcapd
697 rm -f
$(DESTDIR
)$(libdir)/libpcap.a
698 for i in
$(PUBHDR
); do \
699 rm -f
$(DESTDIR
)$(includedir)/$$i; done
700 -rmdir
$(DESTDIR
)$(includedir)/pcap
701 rm -f
$(DESTDIR
)/$(libdir)/pkgconfig
/libpcap.
pc
702 rm -f
$(DESTDIR
)/$(bindir)/pcap-config
703 for i in
$(MAN1
); do \
704 rm -f
$(DESTDIR
)$(mandir)/man1
/$$i; done
705 for i in
$(MAN3PCAP
); do \
706 rm -f
$(DESTDIR
)$(mandir)/man3
/$$i; done
707 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_datalink_val_to_description
.3pcap
708 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_datalink_val_to_description_or_dlt
.3pcap
709 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_dump_fopen
.3pcap
710 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_freealldevs
.3pcap
711 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_perror
.3pcap
712 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_sendpacket
.3pcap
713 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_free_datalinks
.3pcap
714 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_free_tstamp_types
.3pcap
715 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_dispatch
.3pcap
716 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_minor_version
.3pcap
717 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_next
.3pcap
718 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_open_dead_with_tstamp_precision
.3pcap
719 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_open_offline_with_tstamp_precision
.3pcap
720 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_fopen_offline
.3pcap
721 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_fopen_offline_with_tstamp_precision
.3pcap
722 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_getnonblock
.3pcap
723 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_tstamp_type_val_to_description
.3pcap
724 for i in
$(MANFILE
); do \
725 rm -f
$(DESTDIR
)$(mandir)/man@MAN_FILE_FORMATS@
/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
726 for i in
$(MANMISC
); do \
727 rm -f
$(DESTDIR
)$(mandir)/man@MAN_MISC_INFO@
/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
729 uninstall-shared
: uninstall-shared-
$(DYEXT
)
731 VER
=`cat $(srcdir)/VERSION`; \
732 MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
733 rm -f
$(DESTDIR
)$(libdir)/libpcap.so.
$$VER; \
734 rm -f
$(DESTDIR
)$(libdir)/libpcap.so.
$$MAJOR_VER; \
735 rm -f
$(DESTDIR
)$(libdir)/libpcap.so
736 uninstall-shared-dylib
:
737 VER
=`cat $(srcdir)/VERSION`; \
739 rm -f
$(DESTDIR
)$(libdir)/libpcap.
$$VER.dylib
; \
740 rm -f
$(DESTDIR
)$(libdir)/libpcap.
$$MAJOR_VER.dylib
; \
741 rm -f
$(DESTDIR
)$(libdir)/libpcap.dylib
743 MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
744 rm -f
$(DESTDIR
)$(libdir)/libpcap.
$$MAJOR_VER; \
745 rm -f
$(DESTDIR
)$(libdir)/libpcap.sl
746 uninstall-shared-shareda
:
747 rm -f
$(DESTDIR
)$(libdir)/libpcap.a
748 uninstall-shared-none
:
751 (cd rpcapd
; $(MAKE
) DESTDIR
=$(DESTDIR
) uninstall)
754 rm -f
$(CLEANFILES
) config.h.in~ configure~ configure.ac~
755 (cd rpcapd
; $(MAKE
) clean)
756 (cd testprogs
; $(MAKE
) clean)
759 rm -f Makefile grammar.y config.cache config.log config.status \
760 config.h os-proto.h libpcap.
pc pcap-config stamp-h stamp-h.in
761 rm -f
$(MAN3PCAP_EXPAND
:.in
=) $(MANFILE
:.in
=) $(MANMISC
:.in
=)
762 rm -rf autom4te.cache
763 (cd rpcapd
; $(MAKE
) distclean)
764 (cd testprogs
; $(MAKE
) distclean)
767 $(srcdir)/testprogs
/TESTrun
773 ctags
-wtd
$(TAGFILES
)
776 # Use git archive piped to tar to construct a subdirectory whose name
777 # is libpcap-{release}, containing all the checked-in source files,
778 # and then run autoreconf in that directory to generate the configure
779 # script and other files from that source. Then remove autom4te.cache,
780 # construct the release tarball from that subdirectory, and remove
783 # The --format=tar is to force git archive to write a non-compressed
784 # archive, in case the platform's tar command doesn't have built-in
787 # The ^{tree} is there to force git archive not to write out the
788 # "helpful" global extended pax header with a commit ID, as not all
789 # versions of tar can handle that (Solaris tar can't, for example).
790 # (It turns HEAD, or a tag, both of which are apparently "tree-ish"es,
791 # into a tree; apparently, unlike HEAD, or a tag, which have a commit
792 # ID associated with them, the tree associated with them doesn't have
793 # a commit ID, so no commit ID is available to write, and thus
794 # git archive doesn't write one.)
797 @TAG
=$(PROG
)-`cat VERSION` && \
798 if
[ ! -d .git
]; then echo
'Not in a git clone, stop.'; exit
1; fi
&& \
799 TMPTESTFILE
=`mktemp -t tmptestfile_XXXXXXXX` && \
800 rm -f
"$$TMPTESTFILE" && \
801 AUTORECONF_DIR
=`dirname "$$TMPTESTFILE"`/"$(PROG)"_build_autoreconf_
$$$$ && \
803 rm -rf
"$$AUTORECONF_DIR" && \
804 mkdir
"$$AUTORECONF_DIR" && \
805 cd
"$$AUTORECONF_DIR" && \
806 if git
-C
"$$DIR" show-ref
--tags --quiet
--verify
-- "refs/tags/$$TAG"; then \
807 (git
-C
"$$DIR" archive
--format
=tar --prefix="$$TAG"/ "$$TAG^{tree}" $(RELEASE_FILES
) | \
809 echo
"Archive build from tag $$TAG."; \
811 (git
-C
"$$DIR" archive
--format
=tar --prefix="$$TAG"/ "HEAD^{tree}" $(RELEASE_FILES
) | \
813 echo
"No $$TAG tag. Archive build from HEAD."; \
815 (cd
"$$TAG" && .
/autogen.sh
&& rm -rf autom4te.cache
) && \
816 tar cf
"$$DIR/$$TAG".
tar "$$TAG" && \
817 rm -f
"$$DIR/$$TAG".
tar.gz
&& \
818 gzip
--best
"$$DIR/$$TAG".
tar && \
820 rm -rf
"$$AUTORECONF_DIR"
822 releasecheck
: releasetar
823 @TAG
=$(PROG
)-`cat VERSION` && \
824 INSTALL_DIR
=/tmp
/install_
"$$TAG"_
$$$$ && \
828 rm -rf
"$$INSTALL_DIR" && \
829 tar xf
"$$DIR"/"$$TAG".
tar.gz
&& \
831 echo
"[$@] $$ touch .devel" && \
833 echo
"[$@] $$ ./configure --enable-remote --quiet --prefix=$$INSTALL_DIR" && \
834 .
/configure
--enable-remote
--quiet
--prefix="$$INSTALL_DIR" && \
835 echo
'[$@] $$ $(MAKE) -s all testprogs' && \
836 $(MAKE
) -s
all testprogs
&& \
837 echo
'[$@] $$ $(MAKE) -s install' && \
838 $(MAKE
) -s
install && \
841 rm -rf
"$$INSTALL_DIR" && \
842 tar xf
"$$DIR"/"$$TAG".
tar.gz
&& \
844 echo
"[$@] $$ touch .devel" && \
848 echo
'[$@] $$ cmake -DENABLE_REMOTE=yes [...] ..' && \
849 cmake
-DENABLE_REMOTE
=yes \
850 -DCMAKE_INSTALL_PREFIX
="$$INSTALL_DIR" \
851 -DCMAKE_MESSAGE_LOG_LEVEL
=NOTICE \
852 -DCMAKE_RULE_MESSAGES
=OFF \
853 -DCMAKE_INSTALL_MESSAGE
=NEVER \
855 echo
'[$@] $$ $(MAKE) -s all testprogs' && \
856 $(MAKE
) -s
all testprogs
&& \
857 echo
'[$@] $$ $(MAKE) -s install' && \
858 $(MAKE
) -s
install && \
861 rm -rf
"$$INSTALL_DIR" && \
865 @
# trailing space(s)?
866 @if git grep
-I
-n
' $$' $$(git ls-files|grep
-v
'^tests/'); then \
867 echo
'Error: Trailing space(s).'; \
871 @if git grep
-I
-n
' $$' $$(git ls-files|grep
-v
'^tests/'); then \
872 echo
'Error: Trailing tabs(s).'; \
875 @
# space(s) before tab(s)?
876 @if git grep
-I
-n
'[ ][ ]' $$(git ls-files|grep
-v
'^tests/'); then \
877 echo
'Error: space(s) before tab(s).'; \
881 depend
: $(GENERATED_C_SRC
) $(GENHDR
)
882 $(MKDEP
) -c
$(CC
) -m
"$(DEPENDENCY_CFLAG)" -s
"$(srcdir)" $(CFLAGS
) $(DEFS
) $(INCLS
) $(SRC
)
883 (cd rpcapd
; $(MAKE
) depend
)
884 (cd testprogs
; $(MAKE
) depend
)
887 shellcheck
-f gcc
-e SC2006 autogen.sh build.sh build_matrix.sh build_common.sh mkdep .ci-coverity-scan-build.sh