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