1# Makefile for libpcap 2# $FreeBSD$ 3 4LIB= pcap 5SRCS= grammar.y tokdefs.h pcap-bpf.c \ 6 pcap.c inet.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 9MAN= pcap.3 10CLEANFILES=tokdefs.h version.c 11 12CFLAGS+=-DHAVE_CONFIG_H -Dyylval=pcap_lval -I${.CURDIR} -I. 13.if !defined(NOINET6) 14CFLAGS+=-DINET6 15.endif 16 17SHLIB_MAJOR=2 18SHLIB_MINOR=5 19 20# 21# Magic to grab sources out of src/contrib 22# 23PCAP_DISTDIR?=${.CURDIR}/../../contrib/libpcap 24CFLAGS+=-I${PCAP_DISTDIR} -I${PCAP_DISTDIR}/lbl -I${PCAP_DISTDIR}/bpf 25.PATH: ${PCAP_DISTDIR} 26.PATH: ${PCAP_DISTDIR}/bpf/net 27 28version.c: ${PCAP_DISTDIR}/VERSION 29 @rm -f $@ 30 sed 's/.*/char pcap_version[] = "&";/' ${PCAP_DISTDIR}/VERSION > $@ 31 32beforeinstall: 33.for i in pcap.h pcap-int.h pcap-namedb.h 34 ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ${PCAP_DISTDIR}/$i \ 35 ${DESTDIR}/usr/include 36.endfor 37 38tokdefs.h: grammar.h 39 ln -sf grammar.h tokdefs.h 40 41.include <bsd.lib.mk> 42