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@
72 # Standard CFLAGS for building members of a shared library
73 FULL_CFLAGS
= $(CCOPT
) @V_LIB_CCOPT_FAT@
$(SHLIB_CCOPT
) $(INCLS
) $(DEFS
) $(CFLAGS
)
76 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
77 INSTALL_DATA
= @INSTALL_DATA@
81 BISON_BYACC
= @BISON_BYACC@
84 $(CC
) $(FULL_CFLAGS
) -c
-o
$@
$<
86 PLATFORM_C_SRC
= @PLATFORM_C_SRC@
87 MODULE_C_SRC
= @MODULE_C_SRC@
88 REMOTE_C_SRC
= @REMOTE_C_SRC@
89 COMMON_C_SRC
= pcap.c gencode.c optimize.c nametoaddr.c etherent.c \
90 fmtutils.c pcap-util.c \
91 savefile.c sf-pcap.c sf-pcapng.c pcap-common.c \
92 bpf_image.c bpf_filter.c bpf_dump.c
93 GENERATED_C_SRC
= scanner.c grammar.c
96 SRC
= $(PLATFORM_C_SRC
) \
97 $(MODULE_C_SRC
) $(REMOTE_C_SRC
) $(COMMON_C_SRC
) \
100 OBJ
= $(SRC
:.c
=.o
) $(LIBOBJS
)
108 pcap
/can_socketcan.h \
109 pcap
/compiler-tests.h \
115 pcap
/pcap-inttypes.h \
137 pcap-usb-linux-common.h \
154 CLEANFILES
= $(OBJ
) libpcap.a libpcap.so.
`cat $(srcdir)/VERSION` \
155 $(PROG
)-`cat $(srcdir)/VERSION`.
tar.gz
$(GENERATED_C_SRC
) $(GENHDR
) \
156 lex.yy.c pcap-config libpcap.
pc libpcap.
$(DYEXT
)
162 pcap_compile
.3pcap.in \
163 pcap_datalink
.3pcap.in \
164 pcap_dump_open
.3pcap.in \
165 pcap_get_tstamp_precision
.3pcap.in \
166 pcap_list_datalinks
.3pcap.in \
167 pcap_list_tstamp_types
.3pcap.in \
168 pcap_open_dead
.3pcap.in \
169 pcap_open_offline
.3pcap.in \
170 pcap_set_immediate_mode
.3pcap.in \
171 pcap_set_tstamp_precision
.3pcap.in \
172 pcap_set_tstamp_type
.3pcap.in
174 MAN3PCAP_NOEXPAND
= \
175 pcap_activate
.3pcap \
176 pcap_breakloop
.3pcap \
177 pcap_can_set_rfmon
.3pcap \
180 pcap_datalink_name_to_val
.3pcap \
181 pcap_datalink_val_to_name
.3pcap \
183 pcap_dump_close
.3pcap \
184 pcap_dump_file
.3pcap \
185 pcap_dump_flush
.3pcap \
186 pcap_dump_ftell
.3pcap \
189 pcap_findalldevs
.3pcap \
190 pcap_freecode
.3pcap \
191 pcap_get_required_select_timeout
.3pcap \
192 pcap_get_selectable_fd
.3pcap \
196 pcap_is_swapped
.3pcap \
197 pcap_lib_version
.3pcap \
198 pcap_lookupdev
.3pcap \
199 pcap_lookupnet
.3pcap \
201 pcap_major_version
.3pcap \
203 pcap_offline_filter
.3pcap \
204 pcap_open_live
.3pcap \
205 pcap_set_buffer_size
.3pcap \
206 pcap_set_datalink
.3pcap \
207 pcap_set_promisc
.3pcap \
208 pcap_set_protocol_linux
.3pcap \
209 pcap_set_rfmon
.3pcap \
210 pcap_set_snaplen
.3pcap \
211 pcap_set_timeout
.3pcap \
212 pcap_setdirection
.3pcap \
213 pcap_setfilter
.3pcap \
214 pcap_setnonblock
.3pcap \
215 pcap_snapshot
.3pcap \
217 pcap_statustostr
.3pcap \
218 pcap_strerror
.3pcap \
219 pcap_tstamp_type_name_to_val
.3pcap \
220 pcap_tstamp_type_val_to_name
.3pcap
222 MAN3PCAP
= $(MAN3PCAP_NOEXPAND
) $(MAN3PCAP_EXPAND
:.in
=)
225 cbpf-savefile.manfile.in \
226 pcap-savefile.manfile.in
229 pcap-filter.manmisc.in \
230 pcap-linktype.manmisc.in \
231 pcap-tstamp.manmisc.in
236 ChmodBPF
/StartupParameters.plist \
242 Makefile-devel-adds \
246 doc
/README.haiku.md \
252 doc
/README.solaris.md \
253 doc
/README.windows.md \
261 cmake_uninstall.cmake.in \
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
/have_siocglifconf.c \
280 instrument-functions.c \
288 missing
/win_asprintf.c \
291 org.tcpdump.chmod_bpf.plist \
295 pcap-bt-monitor-linux.c \
296 pcap-bt-monitor-linux.h \
312 pcap-netfilter-linux.c \
313 pcap-netfilter-linux.h \
326 rpcapd
/CMakeLists.txt \
328 rpcapd
/config_params.h \
335 rpcapd
/org.tcpdump.rpcapd.plist \
338 rpcapd
/rpcapd.inetd.conf \
339 rpcapd
/rpcapd.manadmin.in \
340 rpcapd
/rpcapd-config.manfile.in \
342 rpcapd
/rpcapd.socket \
343 rpcapd
/rpcapd.xinetd.conf \
344 rpcapd
/rpcapd@.service \
352 testprogs
/CMakeLists.txt \
353 testprogs
/Makefile.in \
355 testprogs
/TESTlib.pm \
356 testprogs
/TESTmt.pm \
357 testprogs
/TESTst.pm \
358 testprogs
/activatetest.c \
359 testprogs
/can_set_rfmon_test.c \
360 testprogs
/capturetest.c \
361 testprogs
/filtertest.c \
362 testprogs
/findalldevstest.c \
363 testprogs
/findalldevstest-perf.c \
364 testprogs
/nonblocktest.c \
365 testprogs
/opentest.c \
366 testprogs
/reactivatetest.c \
367 testprogs
/selpolltest.c \
368 testprogs
/threadsignaltest.c \
370 testprogs
/valgrindtest.c \
371 testprogs
/visopts.py \
372 testprogs
/writecaptest.c
374 TEST_DIST
= `git -C "$$DIR" ls-files tests | grep -v 'tests/\..*'`
376 RELEASE_FILES
= $(COMMON_C_SRC
) $(HDR
) $(MAN1
) $(MAN3PCAP_EXPAND
) \
377 $(MAN3PCAP_NOEXPAND
) $(MANFILE
) $(MANMISC
) $(EXTRA_DIST
) \
380 all: libpcap.a shared
$(BUILD_RPCAPD
) libpcap.
pc pcap-config
384 $(AR
) rc
$@
$(OBJ
) $(ADDLARCHIVEOBJS
)
387 shared
: libpcap.
$(DYEXT
)
391 VER
=`cat $(srcdir)/VERSION`; \
392 MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
393 @V_SHLIB_CMD@
$(LDFLAGS
) @V_SHLIB_OPT@ @V_SONAME_OPT@
$@.
$$MAJOR_VER \
394 -o
$@.
$$VER $(OBJ
) $(ADDLOBJS
) $(LIBS
)
397 # The following rule succeeds, but the result is untested.
399 # In macOS, the libpcap dylib has the name "libpcap.A.dylib", with its
400 # full path as the install_name, and with the compatibility and current
401 # version both set to 1. The compatibility version is set to 1 so that
402 # programs built with a newer version of the library will run against
403 # older versions if they don't use APIs available in the newer version
404 # but not in the older version.
406 # We also use "A" as the major version, and 1 as the compatibility version,
407 # but set the current version to the value in VERSION, with any non-numeric
408 # stuff stripped off (the compatibility and current version must be of the
409 # form X[.Y[.Z]], with Y and Z possibly absent, and with all components
412 libpcap.dylib
: $(OBJ
)
414 VER
=`cat $(srcdir)/VERSION`; \
417 CURRENT_VER
=`sed 's/[^0-9.].*$$//' $(srcdir)/VERSION`; \
418 $(CC
) -dynamiclib
-undefined error
$(LDFLAGS
) @V_LIB_LDFLAGS_FAT@ \
419 -o libpcap.
$$VER.dylib
$(OBJ
) $(ADDLOBJS
) $(LIBS
) \
420 -install_name
$(libdir)/libpcap.
$$MAJOR_VER.dylib \
421 -compatibility_version
$$COMPAT_VER \
422 -current_version
$$CURRENT_VER
425 # The HP-UX linker manual says that the convention for a versioned library
426 # is libXXX.{number}, not libXXX.sl.{number}. That appears to be the case
427 # on at least one HP-UX 11.00 system; libXXX.sl is a symlink to
430 # The manual also says "library-level versioning" (think "sonames") was
431 # added in HP-UX 10.0.
433 # XXX - this assumes we're using the HP linker, rather than the GNU
434 # linker, even with GCC.
437 @MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
438 rm -f libpcap.
$$MAJOR_VER
439 MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
440 ld -b
$(LDFLAGS
) -o libpcap.
$$MAJOR_VER +h libpcap.
$$MAJOR_VER \
441 $(OBJ
) $(ADDLOBJS
) $(LIBS
)
444 # AIX is different from everybody else. A shared library is an archive
445 # library with one or more shared-object components. We still build a
446 # normal static archive library on AIX, for the benefit of the traditional
447 # scheme of building libpcap and tcpdump in subdirectories of the
448 # same directory, with tcpdump statically linked with the libpcap
449 # in question, but we also build a shared library as "libpcap.shareda"
450 # and install *it*, rather than the static library, as "libpcap.a".
452 libpcap.shareda
: $(OBJ
)
454 $(CC
) $(LDFLAGS
) @V_SHLIB_OPT@
-o shr.o
$(OBJ
) $(ADDLOBJS
) $(LIBS
)
458 # For platforms that don't support shared libraries (or on which we
459 # don't support shared libraries).
463 scanner.c
: $(srcdir)/scanner.l
464 $(LEX
) -P pcap_
--header-file
=scanner.h
--nounput
-o scanner.c
$<
466 ## Recover from the removal of $@
467 @if
test -f
$@
; then
:; else \
469 $(MAKE
) $(MAKEFLAGS
) scanner.c
; \
472 scanner.o
: scanner.c grammar.h
473 $(CC
) $(FULL_CFLAGS
) -c scanner.c
476 # Generate the grammar.y file.
478 # Some Makes, e.g. AIX Make and Solaris Make, can't handle "--file=$@.tmp:$<";
479 # for example, the Solaris 9 make man page says
481 # Because make assigns $< and $* as it would for implicit rules
482 # (according to the suffixes list and the directory contents),
483 # they may be unreliable when used within explicit target entries.
485 # and this is an explicit target entry.
487 # Therefore, instead of using $<, we explicitly put in $(srcdir)/grammar.y.in.
489 grammar.y
: $(srcdir)/grammar.y.in .
/config.status
491 .
/config.status
--file
=$@.tmp
:$(srcdir)/grammar.y.in
495 $(BISON_BYACC
) -p pcap_
-o grammar.c
-d
$<
497 ## Recover from the removal of $@
498 @if
test -f
$@
; then
:; else \
500 $(MAKE
) $(MAKEFLAGS
) grammar.c
; \
503 grammar.o
: grammar.c scanner.h
504 $(CC
) $(FULL_CFLAGS
) -c grammar.c
506 gencode.o
: $(srcdir)/gencode.c grammar.h scanner.h
507 $(CC
) $(FULL_CFLAGS
) -c
$(srcdir)/gencode.c
509 asprintf.o
: $(srcdir)/missing
/asprintf.c
510 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/asprintf.c
512 strlcat.o
: $(srcdir)/missing
/strlcat.c
513 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/strlcat.c
515 strlcpy.o
: $(srcdir)/missing
/strlcpy.c
516 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/strlcpy.c
518 strtok_r.o
: $(srcdir)/missing
/strtok_r.c
519 $(CC
) $(FULL_CFLAGS
) -o
$@
-c
$(srcdir)/missing
/strtok_r.c
522 # Generate the libpcap.pc file.
524 # Some Makes, e.g. AIX Make and Solaris Make, can't handle "--file=$@.tmp:$<";
525 # for example, the Solaris 9 make man page says
527 # Because make assigns $< and $* as it would for implicit rules
528 # (according to the suffixes list and the directory contents),
529 # they may be unreliable when used within explicit target entries.
531 # and this is an explicit target entry.
533 # Therefore, instead of using $<, we explicitly put in $(srcdir)/libpcap.pc.in.
535 libpcap.
pc: $(srcdir)/libpcap.
pc.in .
/config.status
537 .
/config.status
--file
=$@.tmp
:$(srcdir)/libpcap.
pc.in
541 # Generate the pcap-config script. See above.
543 pcap-config
: $(srcdir)/pcap-config.in .
/config.status
545 .
/config.status
--file
=$@.tmp
:$(srcdir)/pcap-config.in
550 # Remote pcap daemon.
552 build-rpcapd
: libpcap.a
556 # Test programs - not built by default, and not installed.
558 testprogs
: FORCE libpcap.a
559 (cd testprogs
; $(MAKE
) CFLAGS
="$(CFLAGS)")
563 install: install-shared install-archive libpcap.
pc pcap-config @INSTALL_RPCAPD@
564 [ -d
$(DESTDIR
)$(libdir) ] || \
565 (mkdir
-p
$(DESTDIR
)$(libdir); chmod
755 $(DESTDIR
)$(libdir))
566 [ -d
$(DESTDIR
)$(includedir) ] || \
567 (mkdir
-p
$(DESTDIR
)$(includedir); chmod
755 $(DESTDIR
)$(includedir))
568 [ -d
$(DESTDIR
)$(includedir)/pcap
] || \
569 (mkdir
-p
$(DESTDIR
)$(includedir)/pcap
; chmod
755 $(DESTDIR
)$(includedir)/pcap
)
570 [ -d
$(DESTDIR
)$(mandir)/man1
] || \
571 (mkdir
-p
$(DESTDIR
)$(mandir)/man1
; chmod
755 $(DESTDIR
)$(mandir)/man1
)
572 [ -d
$(DESTDIR
)$(mandir)/man3
] || \
573 (mkdir
-p
$(DESTDIR
)$(mandir)/man3
; chmod
755 $(DESTDIR
)$(mandir)/man3
)
574 [ -d
$(DESTDIR
)$(mandir)/man@MAN_FILE_FORMATS@
] || \
575 (mkdir
-p
$(DESTDIR
)$(mandir)/man@MAN_FILE_FORMATS@
; chmod
755 $(DESTDIR
)$(mandir)/man@MAN_FILE_FORMATS@
)
576 [ -d
$(DESTDIR
)$(mandir)/man@MAN_MISC_INFO@
] || \
577 (mkdir
-p
$(DESTDIR
)$(mandir)/man@MAN_MISC_INFO@
; chmod
755 $(DESTDIR
)$(mandir)/man@MAN_MISC_INFO@
)
578 for i in
$(PUBHDR
); do \
579 $(INSTALL_DATA
) $(srcdir)/$$i \
580 $(DESTDIR
)$(includedir)/$$i; done
581 [ -d
$(DESTDIR
)$(bindir) ] || \
582 (mkdir
-p
$(DESTDIR
)$(bindir); chmod
755 $(DESTDIR
)$(bindir))
583 $(INSTALL_PROGRAM
) pcap-config
$(DESTDIR
)$(bindir)/pcap-config
584 [ -d
$(DESTDIR
)$(libdir)/pkgconfig
] || \
585 (mkdir
-p
$(DESTDIR
)$(libdir)/pkgconfig
; chmod
755 $(DESTDIR
)$(libdir)/pkgconfig
)
586 $(INSTALL_DATA
) libpcap.
pc $(DESTDIR
)$(libdir)/pkgconfig
/libpcap.
pc
587 for i in
$(MAN1
); do \
588 $(INSTALL_DATA
) $(srcdir)/$$i \
589 $(DESTDIR
)$(mandir)/man1
/$$i; done
590 for i in
$(MAN3PCAP_NOEXPAND
); do \
591 $(INSTALL_DATA
) $(srcdir)/$$i \
592 $(DESTDIR
)$(mandir)/man3
/$$i; done
593 for i in
$(MAN3PCAP_EXPAND
:.in
=); do \
594 $(INSTALL_DATA
) $$i \
595 $(DESTDIR
)$(mandir)/man3
/$$i; done
596 (cd
$(DESTDIR
)$(mandir)/man3
&& \
597 rm -f pcap_datalink_val_to_description
.3pcap
&& \
598 $(LN_S
) pcap_datalink_val_to_name
.3pcap \
599 pcap_datalink_val_to_description
.3pcap
&& \
600 rm -f pcap_datalink_val_to_description_or_dlt
.3pcap
&& \
601 $(LN_S
) pcap_datalink_val_to_name
.3pcap \
602 pcap_datalink_val_to_description_or_dlt
.3pcap
&& \
603 rm -f pcap_dump_fopen
.3pcap
&& \
604 $(LN_S
) pcap_dump_open
.3pcap pcap_dump_fopen
.3pcap
&& \
605 rm -f pcap_freealldevs
.3pcap
&& \
606 $(LN_S
) pcap_findalldevs
.3pcap pcap_freealldevs
.3pcap
&& \
607 rm -f pcap_perror
.3pcap
&& \
608 $(LN_S
) pcap_geterr
.3pcap pcap_perror
.3pcap
&& \
609 rm -f pcap_sendpacket
.3pcap
&& \
610 $(LN_S
) pcap_inject
.3pcap pcap_sendpacket
.3pcap
&& \
611 rm -f pcap_free_datalinks
.3pcap
&& \
612 $(LN_S
) pcap_list_datalinks
.3pcap pcap_free_datalinks
.3pcap
&& \
613 rm -f pcap_free_tstamp_types
.3pcap
&& \
614 $(LN_S
) pcap_list_tstamp_types
.3pcap pcap_free_tstamp_types
.3pcap
&& \
615 rm -f pcap_dispatch
.3pcap
&& \
616 $(LN_S
) pcap_loop
.3pcap pcap_dispatch
.3pcap
&& \
617 rm -f pcap_minor_version
.3pcap
&& \
618 $(LN_S
) pcap_major_version
.3pcap pcap_minor_version
.3pcap
&& \
619 rm -f pcap_next
.3pcap
&& \
620 $(LN_S
) pcap_next_ex
.3pcap pcap_next
.3pcap
&& \
621 rm -f pcap_open_dead_with_tstamp_precision
.3pcap
&& \
622 $(LN_S
) pcap_open_dead
.3pcap \
623 pcap_open_dead_with_tstamp_precision
.3pcap
&& \
624 rm -f pcap_open_offline_with_tstamp_precision
.3pcap
&& \
625 $(LN_S
) pcap_open_offline
.3pcap pcap_open_offline_with_tstamp_precision
.3pcap
&& \
626 rm -f pcap_fopen_offline
.3pcap
&& \
627 $(LN_S
) pcap_open_offline
.3pcap pcap_fopen_offline
.3pcap
&& \
628 rm -f pcap_fopen_offline_with_tstamp_precision
.3pcap
&& \
629 $(LN_S
) pcap_open_offline
.3pcap pcap_fopen_offline_with_tstamp_precision
.3pcap
&& \
630 rm -f pcap_tstamp_type_val_to_description
.3pcap
&& \
631 $(LN_S
) pcap_tstamp_type_val_to_name
.3pcap pcap_tstamp_type_val_to_description
.3pcap
&& \
632 rm -f pcap_getnonblock
.3pcap
&& \
633 $(LN_S
) pcap_setnonblock
.3pcap pcap_getnonblock
.3pcap
)
634 for i in
$(MANFILE
); do \
635 $(INSTALL_DATA
) `echo $$i | sed 's/.manfile.in/.manfile/'` \
636 $(DESTDIR
)$(mandir)/man@MAN_FILE_FORMATS@
/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
637 for i in
$(MANMISC
); do \
638 $(INSTALL_DATA
) `echo $$i | sed 's/.manmisc.in/.manmisc/'` \
639 $(DESTDIR
)$(mandir)/man@MAN_MISC_INFO@
/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
641 install-shared
: install-shared-
$(DYEXT
)
642 install-shared-so
: libpcap.so
643 [ -d
$(DESTDIR
)$(libdir) ] || \
644 (mkdir
-p
$(DESTDIR
)$(libdir); chmod
755 $(DESTDIR
)$(libdir))
645 VER
=`cat $(srcdir)/VERSION`; \
646 MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
647 $(INSTALL_PROGRAM
) libpcap.so.
$$VER $(DESTDIR
)$(libdir)/libpcap.so.
$$VER; \
648 ln
-sf libpcap.so.
$$VER $(DESTDIR
)$(libdir)/libpcap.so.
$$MAJOR_VER; \
649 ln
-sf libpcap.so.
$$MAJOR_VER $(DESTDIR
)$(libdir)/libpcap.so
650 install-shared-dylib
: libpcap.dylib
651 [ -d
$(DESTDIR
)$(libdir) ] || \
652 (mkdir
-p
$(DESTDIR
)$(libdir); chmod
755 $(DESTDIR
)$(libdir))
653 VER
=`cat $(srcdir)/VERSION`; \
655 $(INSTALL_PROGRAM
) libpcap.
$$VER.dylib
$(DESTDIR
)$(libdir)/libpcap.
$$VER.dylib
; \
656 ln
-sf libpcap.
$$VER.dylib
$(DESTDIR
)$(libdir)/libpcap.
$$MAJOR_VER.dylib
; \
657 ln
-sf libpcap.
$$MAJOR_VER.dylib
$(DESTDIR
)$(libdir)/libpcap.dylib
658 install-shared-sl
: libpcap.sl
659 [ -d
$(DESTDIR
)$(libdir) ] || \
660 (mkdir
-p
$(DESTDIR
)$(libdir); chmod
755 $(DESTDIR
)$(libdir))
661 MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
662 $(INSTALL_PROGRAM
) libpcap.
$$MAJOR_VER $(DESTDIR
)$(libdir)
663 ln
-sf libpcap.
$$MAJOR_VER $(DESTDIR
)$(libdir)/libpcap.sl
665 # AIX shared libraries are weird. They're archive libraries
666 # with one or more shared object components.
668 install-shared-shareda
: libpcap.shareda
669 [ -d
$(DESTDIR
)$(libdir) ] || \
670 (mkdir
-p
$(DESTDIR
)$(libdir); chmod
755 $(DESTDIR
)$(libdir))
671 $(INSTALL_PROGRAM
) libpcap.shareda
$(DESTDIR
)$(libdir)/libpcap.a
674 install-archive
: install-archive-
$(DYEXT
)
676 # Most platforms have separate suffixes for shared and
677 # archive libraries, so we install both.
679 install-archive-so install-archive-dylib install-archive-sl install-archive-none
: libpcap.a
680 [ -d
$(DESTDIR
)$(libdir) ] || \
681 (mkdir
-p
$(DESTDIR
)$(libdir); chmod
755 $(DESTDIR
)$(libdir))
682 $(INSTALL_DATA
) libpcap.a
$(DESTDIR
)$(libdir)/libpcap.a
683 $(RANLIB
) $(DESTDIR
)$(libdir)/libpcap.a
685 # AIX, however, doesn't, so we don't install the archive
688 install-archive-shareda
:
691 (cd rpcapd
; $(MAKE
) DESTDIR
=$(DESTDIR
) install)
693 uninstall: uninstall-shared uninstall-rpcapd
694 rm -f
$(DESTDIR
)$(libdir)/libpcap.a
695 for i in
$(PUBHDR
); do \
696 rm -f
$(DESTDIR
)$(includedir)/$$i; done
697 -rmdir
$(DESTDIR
)$(includedir)/pcap
698 rm -f
$(DESTDIR
)/$(libdir)/pkgconfig
/libpcap.
pc
699 rm -f
$(DESTDIR
)/$(bindir)/pcap-config
700 for i in
$(MAN1
); do \
701 rm -f
$(DESTDIR
)$(mandir)/man1
/$$i; done
702 for i in
$(MAN3PCAP
); do \
703 rm -f
$(DESTDIR
)$(mandir)/man3
/$$i; done
704 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_datalink_val_to_description
.3pcap
705 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_datalink_val_to_description_or_dlt
.3pcap
706 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_dump_fopen
.3pcap
707 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_freealldevs
.3pcap
708 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_perror
.3pcap
709 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_sendpacket
.3pcap
710 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_free_datalinks
.3pcap
711 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_free_tstamp_types
.3pcap
712 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_dispatch
.3pcap
713 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_minor_version
.3pcap
714 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_next
.3pcap
715 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_open_dead_with_tstamp_precision
.3pcap
716 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_open_offline_with_tstamp_precision
.3pcap
717 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_fopen_offline
.3pcap
718 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_fopen_offline_with_tstamp_precision
.3pcap
719 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_getnonblock
.3pcap
720 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_tstamp_type_val_to_description
.3pcap
721 for i in
$(MANFILE
); do \
722 rm -f
$(DESTDIR
)$(mandir)/man@MAN_FILE_FORMATS@
/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
723 for i in
$(MANMISC
); do \
724 rm -f
$(DESTDIR
)$(mandir)/man@MAN_MISC_INFO@
/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
726 uninstall-shared
: uninstall-shared-
$(DYEXT
)
728 VER
=`cat $(srcdir)/VERSION`; \
729 MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
730 rm -f
$(DESTDIR
)$(libdir)/libpcap.so.
$$VER; \
731 rm -f
$(DESTDIR
)$(libdir)/libpcap.so.
$$MAJOR_VER; \
732 rm -f
$(DESTDIR
)$(libdir)/libpcap.so
733 uninstall-shared-dylib
:
734 VER
=`cat $(srcdir)/VERSION`; \
736 rm -f
$(DESTDIR
)$(libdir)/libpcap.
$$VER.dylib
; \
737 rm -f
$(DESTDIR
)$(libdir)/libpcap.
$$MAJOR_VER.dylib
; \
738 rm -f
$(DESTDIR
)$(libdir)/libpcap.dylib
740 MAJOR_VER
=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
741 rm -f
$(DESTDIR
)$(libdir)/libpcap.
$$MAJOR_VER; \
742 rm -f
$(DESTDIR
)$(libdir)/libpcap.sl
743 uninstall-shared-shareda
:
744 rm -f
$(DESTDIR
)$(libdir)/libpcap.a
745 uninstall-shared-none
:
748 (cd rpcapd
; $(MAKE
) DESTDIR
=$(DESTDIR
) uninstall)
751 rm -f
$(CLEANFILES
) config.h.in~ configure~ configure.ac~
752 (cd rpcapd
; $(MAKE
) clean)
753 (cd testprogs
; $(MAKE
) clean)
756 rm -f Makefile grammar.y config.cache config.log config.status \
757 config.h os-proto.h libpcap.
pc pcap-config stamp-h stamp-h.in
758 rm -f
$(MAN3PCAP_EXPAND
:.in
=) $(MANFILE
:.in
=) $(MANMISC
:.in
=)
759 rm -rf autom4te.cache
760 (cd rpcapd
; $(MAKE
) distclean)
761 (cd testprogs
; $(MAKE
) distclean)
764 $(PERL
) $(srcdir)/testprogs
/TESTrun
770 ctags
-wtd
$(TAGFILES
)
773 # Use git archive piped to tar to construct a subdirectory whose name
774 # is libpcap-{release}, containing all the checked-in source files,
775 # and then run autoreconf in that directory to generate the configure
776 # script and other files from that source. Then remove autom4te.cache,
777 # construct the release tarball from that subdirectory, and remove
780 # The --format=tar is to force git archive to write a non-compressed
781 # archive, in case the platform's tar command doesn't have built-in
784 # The ^{tree} is there to force git archive not to write out the
785 # "helpful" global extended pax header with a commit ID, as not all
786 # versions of tar can handle that (Solaris tar can't, for example).
787 # (It turns HEAD, or a tag, both of which are apparently "tree-ish"es,
788 # into a tree; apparently, unlike HEAD, or a tag, which have a commit
789 # ID associated with them, the tree associated with them doesn't have
790 # a commit ID, so no commit ID is available to write, and thus
791 # git archive doesn't write one.)
794 @TAG
=$(PROG
)-`cat VERSION` && \
795 if
[ ! -d .git
]; then echo
'Not in a git clone, stop.'; exit
1; fi
&& \
796 TMPTESTFILE
=`mktemp -t tmptestfile_XXXXXXXX` && \
797 rm -f
"$$TMPTESTFILE" && \
798 AUTORECONF_DIR
=`dirname "$$TMPTESTFILE"`/"$(PROG)"_build_autoreconf_
$$$$ && \
800 rm -rf
"$$AUTORECONF_DIR" && \
801 mkdir
"$$AUTORECONF_DIR" && \
802 cd
"$$AUTORECONF_DIR" && \
803 if git
-C
"$$DIR" show-ref
--tags --quiet
--verify
-- "refs/tags/$$TAG"; then \
804 (git
-C
"$$DIR" archive
--format
=tar --prefix="$$TAG"/ "$$TAG^{tree}" $(RELEASE_FILES
) | \
806 echo
"Archive build from tag $$TAG."; \
808 (git
-C
"$$DIR" archive
--format
=tar --prefix="$$TAG"/ "HEAD^{tree}" $(RELEASE_FILES
) | \
810 echo
"No $$TAG tag. Archive build from HEAD."; \
812 (cd
"$$TAG" && .
/autogen.sh
&& rm -rf autom4te.cache
) && \
813 tar cf
"$$DIR/$$TAG".
tar "$$TAG" && \
814 rm -f
"$$DIR/$$TAG".
tar.gz
&& \
815 gzip
--best
"$$DIR/$$TAG".
tar && \
817 rm -rf
"$$AUTORECONF_DIR"
819 releasecheck
: releasetar
820 @TAG
=$(PROG
)-`cat VERSION` && \
821 INSTALL_DIR
=/tmp
/install_
"$$TAG"_
$$$$ && \
825 rm -rf
"$$INSTALL_DIR" && \
826 tar xf
"$$DIR"/"$$TAG".
tar.gz
&& \
828 echo
"[$@] $$ touch .devel" && \
830 echo
"[$@] $$ ./configure --enable-remote --quiet --prefix=$$INSTALL_DIR" && \
831 .
/configure
--enable-remote
--quiet
--prefix="$$INSTALL_DIR" && \
832 echo
'[$@] $$ $(MAKE) -s all testprogs' && \
833 $(MAKE
) -s
all testprogs
&& \
834 echo
'[$@] $$ $(MAKE) -s check' && \
835 $(MAKE
) -s
check >/dev
/null
&& \
836 echo
'[$@] $$ $(MAKE) -s install' && \
837 $(MAKE
) -s
install && \
840 rm -rf
"$$INSTALL_DIR" && \
841 tar xf
"$$DIR"/"$$TAG".
tar.gz
&& \
843 echo
"[$@] $$ touch .devel" && \
847 echo
'[$@] $$ cmake -DENABLE_REMOTE=yes [...] ..' && \
848 cmake
-DENABLE_REMOTE
=yes \
849 -DCMAKE_INSTALL_PREFIX
="$$INSTALL_DIR" \
850 -DCMAKE_MESSAGE_LOG_LEVEL
=NOTICE \
851 -DCMAKE_RULE_MESSAGES
=OFF \
852 -DCMAKE_INSTALL_MESSAGE
=NEVER \
854 echo
'[$@] $$ $(MAKE) -s all testprogs' && \
855 $(MAKE
) -s
all testprogs
&& \
856 echo
'[$@] $$ $(MAKE) -s check' && \
857 $(MAKE
) -s
check >/dev
/null
&& \
858 echo
'[$@] $$ $(MAKE) -s install' && \
859 $(MAKE
) -s
install && \
862 rm -rf
"$$INSTALL_DIR" && \
866 @
# trailing space(s)?
867 @if git grep
-I
-n
' $$' $$(git ls-files|grep
-v
'^tests/'); then \
868 echo
'Error: Trailing space(s).'; \
872 @if git grep
-I
-n
' $$' $$(git ls-files|grep
-v
'^tests/'); then \
873 echo
'Error: Trailing tabs(s).'; \
876 @
# space(s) before tab(s)?
877 @if git grep
-I
-n
'[ ][ ]' $$(git ls-files|grep
-v
'^tests/'); then \
878 echo
'Error: space(s) before tab(s).'; \
882 depend
: $(GENERATED_C_SRC
) $(GENHDR
)
883 $(MKDEP
) -c
$(CC
) -m
"$(DEPENDENCY_CFLAG)" -s
"$(srcdir)" $(CFLAGS
) $(DEFS
) $(INCLS
) $(SRC
)
884 (cd rpcapd
; $(MAKE
) depend
)
885 (cd testprogs
; $(MAKE
) depend
)
888 shellcheck
-f gcc
-e SC2006 autogen.sh build.sh build_matrix.sh build_common.sh mkdep .ci-coverity-scan-build.sh