pkg: reorder man3 files in manifest
[unleashed/lotheac.git] / lib / libpcap / Makefile
blob6cff44c09aabf0e70d5975735a64240c83be8edf
1 .include <unleashed.mk>
3 PCAP_DISTDIR= ${SRCTOP}/contrib/libpcap
5 LIB= pcap
7 GENSRCS = grammar.c scanner.c version.c
9 SRCS= ${GENSRCS}
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 \
16 dlpisubs.c ${GENSRCS}
18 # Old compatibility headers
19 INCS= ${PCAP_DISTDIR}/pcap.h ${PCAP_DISTDIR}/pcap-namedb.h ${PCAP_DISTDIR}/pcap-bpf.h
21 MAN= pcap.3 \
22 pcap_activate.3 \
23 pcap_breakloop.3 \
24 pcap_can_set_rfmon.3 \
25 pcap_close.3 \
26 pcap_compile.3 \
27 pcap_create.3 \
28 pcap_datalink.3 \
29 pcap_datalink_name_to_val.3 \
30 pcap_datalink_val_to_name.3 \
31 pcap_dump.3 \
32 pcap_dump_close.3 \
33 pcap_dump_file.3 \
34 pcap_dump_flush.3 \
35 pcap_dump_ftell.3 \
36 pcap_dump_open.3 \
37 pcap_file.3 \
38 pcap_fileno.3 \
39 pcap_findalldevs.3 \
40 pcap_freecode.3 \
41 pcap_get_selectable_fd.3 \
42 pcap_get_tstamp_precision.3 \
43 pcap_geterr.3 \
44 pcap_inject.3 \
45 pcap_is_swapped.3 \
46 pcap_lib_version.3 \
47 pcap_list_datalinks.3 \
48 pcap_list_tstamp_types.3 \
49 pcap_lookupdev.3 \
50 pcap_lookupnet.3 \
51 pcap_loop.3 \
52 pcap_major_version.3 \
53 pcap_next_ex.3 \
54 pcap_offline_filter.3 \
55 pcap_open_dead.3 \
56 pcap_open_live.3 \
57 pcap_open_offline.3 \
58 pcap_set_buffer_size.3 \
59 pcap_set_datalink.3 \
60 pcap_set_immediate_mode.3 \
61 pcap_set_promisc.3 \
62 pcap_set_rfmon.3 \
63 pcap_set_snaplen.3 \
64 pcap_set_timeout.3 \
65 pcap_set_tstamp_precision.3 \
66 pcap_set_tstamp_type.3 \
67 pcap_setdirection.3 \
68 pcap_setfilter.3 \
69 pcap_setnonblock.3 \
70 pcap_snapshot.3 \
71 pcap_stats.3 \
72 pcap_statustostr.3 \
73 pcap_strerror.3 \
74 pcap-savefile.5 \
75 pcap_tstamp_type_name_to_val.3 \
76 pcap_tstamp_type_val_to_name.3 \
77 pcap-filter.7 \
78 pcap-linktype.7
80 # Our man pages are a special copy from the distdir. See below.
81 CLEANFILES+=${MAN}
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}
89 WARNS?= 0
91 SHLIB_MAJOR= 1
92 SHLIB_MINOR= 8
93 SHLIB_TEENY= 1
95 SHLIB_LDADD+= -M${PCAP_DISTDIR}/mapfile
97 .PATH: ${PCAP_DISTDIR}
99 grammar.c:
100 bison -Wno-conflicts-sr -y -p pcap_ -o grammar.c -d ${PCAP_DISTDIR}/grammar.y
102 scanner.c: grammar.c
103 flex -P pcap_ --header-file=scanner.h --nounput -o scanner.c ${PCAP_DISTDIR}/scanner.l
105 version.c: ${PCAP_DISTDIR}/VERSION
106 @rm -f $@
107 sed 's/.*/char pcap_version[] = "&";/' ${PCAP_DISTDIR}/VERSION > $@
110 # Magic to convert the man pages to something non Solarish
112 .for _page in ${MAN}
113 ${_page}:
114 if [ -f ${PCAP_DISTDIR}/${_page:S/3$/3pcap/} ]; then \
115 F=${_page:S/3$/3pcap/}; \
116 fi; \
117 sed -e 's/3PCAP/3/g' ${PCAP_DISTDIR}/$$F > ${_page}
118 .endfor
120 afterinstall:
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"; \
127 echo $$j; \
128 eval "$$j"; \
129 done;
132 .include <bsd.lib.mk>