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