1# Makefile for libpcap 2# $FreeBSD$ 3 4LIB= pcap 5SRCS= grammar.y tokdefs.h version.h pcap-bpf.c \ 6 pcap.c inet.c fad-getad.c gencode.c optimize.c nametoaddr.c \ 7 etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c \ 8 scanner.l version.c 9INCS= pcap.h pcap-int.h pcap-namedb.h 10MAN= pcap.3 11CLEANFILES=tokdefs.h version.h version.c 12 13YFLAGS+=-p pcapyy 14LFLAGS+=-Ppcapyy 15CFLAGS+=-DHAVE_CONFIG_H -Dyylval=pcapyylval -I${.CURDIR} -I. 16CFLAGS+=-D_U_="__attribute__((unused))" 17CFLAGS+=-DHAVE_SNPRINTF -DHAVE_VSNPRINTF 18.if !defined(NO_INET6) 19CFLAGS+=-DINET6 20.endif 21 22SHLIB_MAJOR=3 23 24# 25# Magic to grab sources out of src/contrib 26# 27PCAP_DISTDIR?=${.CURDIR}/../../contrib/libpcap 28CFLAGS+=-I${PCAP_DISTDIR} 29.PATH: ${PCAP_DISTDIR} 30.PATH: ${PCAP_DISTDIR}/bpf/net 31 32version.c: ${PCAP_DISTDIR}/VERSION 33 @rm -f $@ 34 sed 's/.*/char pcap_version[] = "&";/' ${PCAP_DISTDIR}/VERSION > $@ 35 36version.h: ${PCAP_DISTDIR}/VERSION 37 @rm -f $@ 38 sed 's/.*/char pcap_version_string[] = "libpcap version &";/' ${PCAP_DISTDIR}/VERSION > $@ 39 40tokdefs.h: grammar.h 41 ln -sf grammar.h tokdefs.h 42 43.include <bsd.lib.mk> 44