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 14MAN= pcap.3 15CLEANFILES=tokdefs.h version.h version.c 16 17YFLAGS+=-p pcapyy 18LFLAGS+=-Ppcapyy 19CFLAGS+=-DHAVE_CONFIG_H -Dyylval=pcapyylval -I${.CURDIR} -I. 20CFLAGS+=-D_U_="__attribute__((unused))" 21CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF 22.if ${MK_INET6_SUPPORT} != "no" 23CFLAGS+=-DINET6 24.endif 25 26SHLIB_MAJOR=4 27 28# 29# Magic to grab sources out of src/contrib 30# 31PCAP_DISTDIR?=${.CURDIR}/../../contrib/libpcap 32CFLAGS+=-I${PCAP_DISTDIR} 33.PATH: ${PCAP_DISTDIR} 34.PATH: ${PCAP_DISTDIR}/bpf/net 35 36version.c: ${PCAP_DISTDIR}/VERSION 37 @rm -f $@ 38 sed 's/.*/char pcap_version[] = "&";/' ${PCAP_DISTDIR}/VERSION > $@ 39 40version.h: ${PCAP_DISTDIR}/VERSION 41 @rm -f $@ 42 sed 's/.*/char pcap_version_string[] = "libpcap version &";/' ${PCAP_DISTDIR}/VERSION > $@ 43 44tokdefs.h: grammar.h 45 ln -sf grammar.h tokdefs.h 46 47.include <bsd.lib.mk> 48