Makefile revision 42087
11573Srgrimes# Makefile for libpcap
21573Srgrimes# $Id: Makefile,v 1.21 1998/09/15 19:34:01 fenner Exp $
31573Srgrimes
41573SrgrimesLIB=    pcap
51573SrgrimesSRCS=	grammar.y tokdefs.h pcap-bpf.c \
61573Srgrimes        pcap.c inet.c gencode.c optimize.c nametoaddr.c \
71573Srgrimes	etherent.c savefile.c bpf_filter.c bpf_image.c \
81573Srgrimes        scanner.l version.c
91573SrgrimesMAN3=	pcap.3
101573SrgrimesCLEANFILES=tokdefs.h version.c
111573Srgrimes
121573SrgrimesDEFS=	-DHAVE_SYS_IOCCOM_H=1 -DHAVE_SYS_SOCKIO_H=1 \
131573Srgrimes	-DHAVE_ETHER_HOSTTON=1 -DHAVE_STRERROR=1 \
141573Srgrimes	-DHAVE_SOCKADDR_SA_LEN=1 -DLBL_ALIGN=1 
151573Srgrimes
161573SrgrimesCFLAGS+=-I. -Dyylval=pcap_lval ${DEFS}
171573Srgrimes
181573SrgrimesSHLIB_MAJOR=2
191573SrgrimesSHLIB_MINOR=3
201573Srgrimes
211573Srgrimes#
221573Srgrimes# Magic to grab sources out of src/contrib
231573Srgrimes#
241573SrgrimesPCAP_DISTDIR?=${.CURDIR}/../../contrib/libpcap
251573SrgrimesCFLAGS+=-I${PCAP_DISTDIR} -I${PCAP_DISTDIR}/lbl
261573Srgrimes.PATH:	${PCAP_DISTDIR}
271573Srgrimes.PATH:	${PCAP_DISTDIR}/bpf/net
2854770Sgreen
2954770Sgreenversion.c: ${PCAP_DISTDIR}/VERSION
301573Srgrimes	@rm -f $@
311573Srgrimes	sed 's/.*/char pcap_version[] = "&";/' ${PCAP_DISTDIR}/VERSION > $@
32129184Sbde
331573Srgrimesbeforeinstall:
3423668Speter.for i in pcap.h pcap-int.h pcap-namedb.h
351573Srgrimes	${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 ${PCAP_DISTDIR}/$i \
36129184Sbde		${DESTDIR}/usr/include
37129184Sbde.endfor
3890045Sobrien
3990045Sobrientokdefs.h: grammar.h
401573Srgrimes	ln -sf grammar.h tokdefs.h
4171579Sdeischen
421573Srgrimes.include <bsd.lib.mk>
43129161Speadar