1 .
include <unleashed.mk
>
3 PCAP_DISTDIR
= ${SRCTOP}/contrib
/libpcap
7 GENSRCS
= grammar.c scanner.c version.c
11 BUILDFIRST
= ${GENSRCS}
13 SRCS
+= pcap-bpf.c fad-getad.c pcap.c inet.c fad-helpers.c \
14 gencode.c optimize.c nametoaddr.c etherent.c savefile.c \
15 sf-pcap.c sf-pcap-ng.c pcap-common.c bpf_image.c bpf_dump.c bpf_filter.c \
18 # Old compatibility headers
19 INCS
= ${PCAP_DISTDIR}/pcap.h
${PCAP_DISTDIR}/pcap-namedb.h
${PCAP_DISTDIR}/pcap-bpf.h
24 pcap_can_set_rfmon
.3 \
29 pcap_datalink_name_to_val
.3 \
30 pcap_datalink_val_to_name
.3 \
41 pcap_get_selectable_fd
.3 \
42 pcap_get_tstamp_precision
.3 \
47 pcap_list_datalinks
.3 \
48 pcap_list_tstamp_types
.3 \
52 pcap_major_version
.3 \
54 pcap_offline_filter
.3 \
58 pcap_set_buffer_size
.3 \
60 pcap_set_immediate_mode
.3 \
65 pcap_set_tstamp_precision
.3 \
66 pcap_set_tstamp_type
.3 \
75 pcap_tstamp_type_name_to_val
.3 \
76 pcap_tstamp_type_val_to_name
.3 \
80 # Our man pages are a special copy from the distdir. See below.
82 CLEANFILES
+=${GENSRCS} grammar.h scanner.h
84 CFLAGS
+=-DHAVE_CONFIG_H
-I
${.CURDIR
} -I
${.OBJDIR
}
85 CFLAGS
+=-D_U_
="__attribute__((unused))"
86 CFLAGS
+=-DBUILDING_PCAP
87 CFLAGS
+=-I
${PCAP_DISTDIR}
95 SHLIB_LDADD
+= -M
${PCAP_DISTDIR}/mapfile
97 .PATH
: ${PCAP_DISTDIR}
100 bison
-Wno-conflicts-sr
-y
-p pcap_
-o grammar.c
-d
${PCAP_DISTDIR}/grammar.y
103 flex
-P pcap_
--header-file
=scanner.h
--nounput
-o scanner.c
${PCAP_DISTDIR}/scanner.l
105 version.c
: ${PCAP_DISTDIR}/VERSION
107 sed
's/.*/char pcap_version[] = "&";/' ${PCAP_DISTDIR}/VERSION
> $@
110 # Magic to convert the man pages to something non Solarish
114 if
[ -f
${PCAP_DISTDIR}/${_page
:S
/3$/3pcap
/} ]; then \
115 F
=${_page
:S
/3$/3pcap
/}; \
117 sed
-e
's/3PCAP/3/g' ${PCAP_DISTDIR}/$$F > ${_page}
121 @
test -d
${DESTDIR}/usr
/include/pcap || \
122 mkdir
${DESTDIR}/usr
/include/pcap
123 @for i in
${PCAP_DISTDIR}/pcap
/*; do \
124 j
="cmp -s $$i ${DESTDIR}/usr/include/pcap/`basename $$i` || \
125 ${INSTALL} ${INSTALL_COPY} ${INC_INSTALL_OWN} -m 444 $$i\
126 ${DESTDIR}/usr/include/pcap"; \
132 .
include <bsd.lib.mk
>