Remove wrong getvfsbytype.3 MLINK. The manpage doesn't document it.
[dragonfly.git] / lib / libpcap / Makefile
1 SRCDIR= ${.CURDIR}/../../contrib/libpcap
2
3 LIB=    pcap
4 SRCS=   pcap-bpf.c \
5         fad-getad.c \
6         pcap.c inet.c gencode.c optimize.c nametoaddr.c etherent.c \
7         savefile.c sf-pcap.c sf-pcap-ng.c pcap-common.c \
8         bpf_image.c bpf_dump.c \
9         scanner.l grammar.y bpf_filter.c version.c \
10         fad-helpers.c sockutils.c \
11         pcap_version.h tokdefs.h
12
13 INCS=   pcap.h \
14         pcap-bpf.h \
15         pcap-namedb.h
16
17 PCAPINCS= \
18         pcap/bluetooth.h \
19         pcap/bpf.h \
20         pcap/can_socketcan.h \
21         pcap/dlt.h \
22         pcap/export-defs.h \
23         pcap/ipnet.h \
24         pcap/namedb.h \
25         pcap/nflog.h \
26         pcap/pcap.h \
27         pcap/sll.h \
28         pcap/usb.h \
29         pcap/vlan.h
30
31 PCAPINCSDIR=    ${INCLUDEDIR}/pcap
32 INCSGROUPS=     INCS PCAPINCS
33
34 MAN=    pcap.3 \
35         pcap_compile.3 \
36         pcap_datalink.3 \
37         pcap_dump_open.3 \
38         pcap_list_datalinks.3 \
39         pcap_list_tstamp_types.3 \
40         pcap_open_dead.3 \
41         pcap_open_offline.3 \
42         pcap_set_tstamp_type.3
43 MAN+=   pcap_activate.3 \
44         pcap_breakloop.3 \
45         pcap_can_set_rfmon.3 \
46         pcap_close.3 \
47         pcap_create.3 \
48         pcap_datalink_name_to_val.3 \
49         pcap_datalink_val_to_name.3 \
50         pcap_dump.3 \
51         pcap_dump_close.3 \
52         pcap_dump_file.3 \
53         pcap_dump_flush.3 \
54         pcap_dump_ftell.3 \
55         pcap_file.3 \
56         pcap_fileno.3 \
57         pcap_findalldevs.3 \
58         pcap_freecode.3 \
59         pcap_get_selectable_fd.3 \
60         pcap_get_tstamp_precision.3 \
61         pcap_geterr.3 \
62         pcap_inject.3 \
63         pcap_is_swapped.3 \
64         pcap_lib_version.3 \
65         pcap_lookupdev.3 \
66         pcap_lookupnet.3 \
67         pcap_loop.3 \
68         pcap_major_version.3 \
69         pcap_next_ex.3 \
70         pcap_offline_filter.3 \
71         pcap_open_live.3 \
72         pcap_set_buffer_size.3 \
73         pcap_set_datalink.3 \
74         pcap_set_immediate_mode.3 \
75         pcap_set_promisc.3 \
76         pcap_set_rfmon.3 \
77         pcap_set_snaplen.3 \
78         pcap_set_timeout.3 \
79         pcap_set_tstamp_precision.3 \
80         pcap_setdirection.3 \
81         pcap_setfilter.3 \
82         pcap_setnonblock.3 \
83         pcap_snapshot.3 \
84         pcap_stats.3 \
85         pcap_statustostr.3 \
86         pcap_strerror.3 \
87         pcap_tstamp_type_name_to_val.3 \
88         pcap_tstamp_type_val_to_name.3
89 MAN+=   pcap-savefile.5
90 MAN+=   pcap-filter.7 \
91         pcap-linktype.7 \
92         pcap-tstamp.7
93 MLINKS= pcap_datalink_val_to_name.3 pcap_datalink_val_to_description.3 \
94         pcap_dump_open.3 pcap_dump_fopen.3 \
95         pcap_findalldevs.3 pcap_freealldevs.3 \
96         pcap_geterr.3 pcap_perror.3 \
97         pcap_inject.3 pcap_sendpacket.3 \
98         pcap_list_datalinks.3 pcap_free_datalinks.3 \
99         pcap_list_tstamp_types.3 pcap_free_tstamp_types.3 \
100         pcap_loop.3 pcap_dispatch.3 \
101         pcap_major_version.3 pcap_minor_version.3 \
102         pcap_next_ex.3 pcap_next.3 \
103         pcap_open_offline.3 pcap_fopen_offline.3 \
104         pcap_setnonblock.3 pcap_getnonblock.3
105
106 CLEANFILES=tokdefs.h version.c pcap_version.h
107 CLEANFILES+=${MAN}
108 CLEANFILES+=scanner.h
109 WARNS?= 2
110
111 LFLAGS+=-Ppcap_ --header-file=${.OBJDIR}/scanner.h --nounput
112 YFLAGS+=-p pcap_
113 CFLAGS+=-DHAVE_CONFIG_H -I${.CURDIR} -I${.OBJDIR}
114 CFLAGS+=-D_U_="__attribute__((unused))"
115 CFLAGS+=-DHAVE_STRUCT_ETHER_ADDR -DHAVE_NET_PFVAR_H
116 .if !defined(NOINET6)
117 CFLAGS+=-DINET6
118 .endif
119
120 SHLIB_MAJOR=3
121
122 #
123 # Magic to grab sources out of src/contrib
124 #
125 PCAP_DISTDIR?=${SRCDIR}
126 CFLAGS+=-I${PCAP_DISTDIR}
127 .PATH:  ${PCAP_DISTDIR}
128 .PATH:  ${PCAP_DISTDIR}/bpf/net
129
130 version.c: VERSION
131         echo '#include <pcap/export-defs.h>' > ${.TARGET}
132         echo 'PCAP_API_DEF' >> ${.TARGET}
133         sed -e 's/.*/char pcap_version[] = "&";/' ${.ALLSRC} > ${.TARGET}
134
135 pcap_version.h: VERSION
136         sed -e 's/.*/static const char pcap_version_string[] = "libpcap version &";/' \
137                 ${.ALLSRC} > ${.TARGET}
138
139 tokdefs.h: grammar.h
140         ${LN} -sf grammar.h tokdefs.h
141
142 #
143 # Magic to convert the man pages to something non Solarish
144 #
145 .for _page in ${MAN}
146 ${_page}:
147         if [ -f ${PCAP_DISTDIR}/${_page:S/3$/3pcap/} ]; then            \
148                 F=${_page:S/3$/3pcap/};                                 \
149         elif [ -f ${PCAP_DISTDIR}/${_page:S/3$/3pcap.in/} ]; then       \
150                 F=${_page:S/3$/3pcap.in/};                              \
151         elif [ -f ${PCAP_DISTDIR}/${_page:S/5$/manfile/} ]; then        \
152                 F=${_page:S/5$/manfile/};                               \
153         elif [ -f ${PCAP_DISTDIR}/${_page:S/5$/manfile.in/} ]; then     \
154                 F=${_page:S/5$/manfile.in/};                            \
155         elif [ -f ${PCAP_DISTDIR}/${_page:S/7$/manmisc/} ]; then        \
156                 F=${_page:S/7$/manmisc/};                               \
157         elif [ -f ${PCAP_DISTDIR}/${_page:S/7$/manmisc.in/} ]; then     \
158                 F=${_page:S/7$/manmisc.in/};                            \
159         fi;                                                             \
160         sed -e 's/3PCAP/3/g' -e 's/@MAN_FILE_FORMATS@/5/g'              \
161                 -e 's/@MAN_MISC_INFO@/7/g' ${PCAP_DISTDIR}/$$F > ${_page}
162 .endfor
163
164 .include <bsd.lib.mk>