Update libpcap to version 0.8.3
[dragonfly.git] / lib / libpcap / Makefile
1 # Makefile for libpcap
2 # $FreeBSD: src/lib/libpcap/Makefile,v 1.24.2.4 2002/07/22 14:21:50 ru Exp $
3 # $DragonFly: src/lib/libpcap/Makefile,v 1.4 2004/05/15 12:28:33 eirikn Exp $
4
5 LIB=    pcap
6 SRCS=   grammar.y tokdefs.h pcap-bpf.c version.h \
7         pcap.c inet.c fad-getad.c gencode.c optimize.c nametoaddr.c \
8         etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c \
9         scanner.l version.c
10 INCS=   pcap.h pcap-namedb.h pcap-bpf.h pcap-int.h
11 MAN=    pcap.3
12 CLEANFILES=tokdefs.h version.c version.h
13
14 CFLAGS+=-DHAVE_CONFIG_H -Dyylval=pcap_lval -I${.CURDIR} -I.
15 CFLAGS+=-D_U_="__attribute__((unused))"
16 .if !defined(NOINET6)
17 CFLAGS+=-DINET6
18 .endif
19
20 # workaround bogus libpcap 0.6.2 contrib code which tries to extern the
21 # system supplied function ether_hostton().  Setting __FreeBSD__ prevents
22 # it from declaring the extern.
23 #
24 CFLAGS+=-D__FreeBSD__
25
26 SHLIB_MAJOR=2
27 SHLIB_MINOR=5
28
29 #
30 # Magic to grab sources out of src/contrib
31 #
32 PCAP_DISTDIR?=${.CURDIR}/../../contrib/libpcap-0.8.3
33 CFLAGS+=-I${PCAP_DISTDIR}
34 .PATH:  ${PCAP_DISTDIR}
35 .PATH:  ${PCAP_DISTDIR}/bpf/net
36
37 version.c: ${PCAP_DISTDIR}/VERSION
38         @rm -f $@
39         sed 's/.*/char pcap_version[] = "&";/' ${PCAP_DISTDIR}/VERSION > $@
40
41 version.h: ${PCAP_DISTDIR}/VERSION
42         @rm -f $@
43         sed 's/.*/static const char pcap_version_string[] = "libpcap version &";/' \
44                 ${PCAP_DISTDIR}/VERSION > $@
45
46 tokdefs.h: grammar.h
47         ln -sf grammar.h tokdefs.h
48
49 .include <bsd.lib.mk>