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 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.if ${MK_PF} != "no" 26CFLAGS+=-DHAVE_NET_PFVAR_H 27.endif 28 29SHLIB_MAJOR=5 30 31# 32# Magic to grab sources out of src/contrib 33# 34PCAP_DISTDIR?=${.CURDIR}/../../contrib/libpcap 35CFLAGS+=-I${PCAP_DISTDIR} 36.PATH: ${PCAP_DISTDIR} 37.PATH: ${PCAP_DISTDIR}/bpf/net 38 39version.c: ${PCAP_DISTDIR}/VERSION 40 @rm -f $@ 41 sed 's/.*/char pcap_version[] = "&";/' ${PCAP_DISTDIR}/VERSION > $@ 42 43version.h: ${PCAP_DISTDIR}/VERSION 44 @rm -f $@ 45 sed 's/.*/char pcap_version_string[] = "libpcap version &";/' ${PCAP_DISTDIR}/VERSION > $@ 46 47tokdefs.h: grammar.h 48 ln -sf grammar.h tokdefs.h 49 50.include <bsd.lib.mk> 51