xref: /freebsd/lib/libpcap/Makefile (revision 13014ca04aad1931d41958b56f71a2c65b9a7a2c)
1# Makefile for libpcap
2# $FreeBSD$
3
4SHLIBDIR?= /lib
5
6.include <bsd.own.mk>
7
8LIB=	pcap
9SRCS=	grammar.y tokdefs.h version.h pcap-bpf.c \
10	pcap.c inet.c fad-getad.c gencode.c optimize.c nametoaddr.c \
11	etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c \
12	scanner.l version.c
13INCS=	pcap.h pcap-int.h pcap-namedb.h pcap-bpf.h
14MAN=	pcap.3
15MLINKS=	pcap.3 pcap_open_live.3 \
16	pcap.3 pcap_open_dead.3 \
17	pcap.3 pcap_open_offline.3 \
18	pcap.3 pcap_fopen_offline.3 \
19	pcap.3 pcap_dump_open.3 \
20	pcap.3 pcap_dump_fopen.3 \
21	pcap.3 pcap_setnonblock.3 \
22	pcap.3 pcap_getnonblock.3 \
23	pcap.3 pcap_findalldevs.3 \
24	pcap.3 pcap_freealldevs.3 \
25	pcap.3 pcap_lookupdev.3 \
26	pcap.3 pcap_lookupnet.3 \
27	pcap.3 pcap_dispatch.3 \
28	pcap.3 pcap_loop.3 \
29	pcap.3 pcap_dump.3 \
30	pcap.3 pcap_compile.3 \
31	pcap.3 pcap_setfilter.3 \
32	pcap.3 pcap_freecode.3 \
33	pcap.3 pcap_setdirection.3 \
34	pcap.3 pcap_next.3 \
35	pcap.3 pcap_next_ex.3 \
36	pcap.3 pcap_breakloop.3 \
37	pcap.3 pcap_inject.3 \
38	pcap.3 pcap_sendpacket.3 \
39	pcap.3 pcap_datalink.3 \
40	pcap.3 pcap_list_datalinks.3 \
41	pcap.3 pcap_set_datalink.3 \
42	pcap.3 pcap_datalink_name_to_val.3 \
43	pcap.3 pcap_datalink_val_to_name.3 \
44	pcap.3 pcap_datalink_val_to_description.3 \
45	pcap.3 pcap_snapshot.3 \
46	pcap.3 pcap_is_swapped.3 \
47	pcap.3 pcap_major_version.3 \
48	pcap.3 pcap_minor_version.3 \
49	pcap.3 pcap_stats.3 \
50	pcap.3 pcap_file.3 \
51	pcap.3 pcap_fileno.3 \
52	pcap.3 pcap_get_selectable_fd.3 \
53	pcap.3 pcap_perror.3 \
54	pcap.3 pcap_geterr.3 \
55	pcap.3 pcap_strerror.3 \
56	pcap.3 pcap_lib_version.3 \
57	pcap.3 pcap_close.3 \
58	pcap.3 pcap_dump_flush.3 \
59	pcap.3 pcap_dump_ftell.3 \
60	pcap.3 pcap_dump_file.3 \
61	pcap.3 pcap_dump_close.3
62
63CLEANFILES=tokdefs.h version.h version.c
64
65YFLAGS+=-p pcapyy
66LFLAGS+=-Ppcapyy
67CFLAGS+=-DHAVE_CONFIG_H -Dyylval=pcapyylval -I${.CURDIR} -I.
68CFLAGS+=-D_U_="__attribute__((unused))"
69CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF
70.if ${MK_INET6_SUPPORT} != "no"
71CFLAGS+=-DINET6
72.endif
73.if ${MK_PF} != "no"
74CFLAGS+=-DHAVE_NET_PFVAR_H
75.endif
76
77SHLIB_MAJOR=5
78
79#
80# Magic to grab sources out of src/contrib
81#
82PCAP_DISTDIR?=${.CURDIR}/../../contrib/libpcap
83CFLAGS+=-I${PCAP_DISTDIR}
84.PATH:	${PCAP_DISTDIR}
85.PATH:	${PCAP_DISTDIR}/bpf/net
86
87version.c: ${PCAP_DISTDIR}/VERSION
88	@rm -f $@
89	sed 's/.*/char pcap_version[] = "&";/' ${PCAP_DISTDIR}/VERSION > $@
90
91version.h: ${PCAP_DISTDIR}/VERSION
92	@rm -f $@
93	sed 's/.*/char pcap_version_string[] = "libpcap version &";/' ${PCAP_DISTDIR}/VERSION > $@
94
95tokdefs.h: grammar.h
96	ln -sf grammar.h tokdefs.h
97
98.include <bsd.lib.mk>
99