1999-10-07 23:46:40 +00:00
|
|
|
# Copyright (c) 1993, 1994, 1995, 1996
|
|
|
|
# The Regents of the University of California. All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that: (1) source code distributions
|
|
|
|
# retain the above copyright notice and this paragraph in its entirety, (2)
|
|
|
|
# distributions including binary code include the above copyright notice and
|
|
|
|
# this paragraph in its entirety in the documentation or other materials
|
|
|
|
# provided with the distribution, and (3) all advertising materials mentioning
|
|
|
|
# features or use of this software display the following acknowledgement:
|
|
|
|
# ``This product includes software developed by the University of California,
|
|
|
|
# Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
|
|
|
|
# the University nor the names of its contributors may be used to endorse
|
|
|
|
# or promote products derived from this software without specific prior
|
|
|
|
# written permission.
|
|
|
|
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
|
|
|
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
|
|
|
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
#
|
2003-07-23 05:29:19 +00:00
|
|
|
# @(#) $Header: /tcpdump/master/libpcap/Makefile.in,v 1.96 2003-07-23 05:29:20 guy Exp $ (LBL)
|
1999-10-07 23:46:40 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Various configurable paths (remember to edit Makefile.in, not Makefile)
|
|
|
|
#
|
|
|
|
|
|
|
|
# Top level hierarchy
|
|
|
|
prefix = @prefix@
|
|
|
|
exec_prefix = @exec_prefix@
|
|
|
|
# Pathname of directory to install the include files
|
2000-07-30 05:56:49 +00:00
|
|
|
includedir = @includedir@
|
1999-10-07 23:46:40 +00:00
|
|
|
# Pathname of directory to install the library
|
2000-07-30 05:56:49 +00:00
|
|
|
libdir = @libdir@
|
1999-10-07 23:46:40 +00:00
|
|
|
# Pathname of directory to install the man page
|
2000-07-30 05:56:49 +00:00
|
|
|
mandir = @mandir@
|
1999-10-07 23:46:40 +00:00
|
|
|
|
|
|
|
# VPATH
|
|
|
|
srcdir = @srcdir@
|
|
|
|
VPATH = @srcdir@
|
|
|
|
|
|
|
|
#
|
|
|
|
# You shouldn't need to edit anything below.
|
|
|
|
#
|
|
|
|
|
|
|
|
CC = @CC@
|
|
|
|
CCOPT = @V_CCOPT@
|
|
|
|
INCLS = -I. @V_INCLS@
|
2003-07-23 05:29:19 +00:00
|
|
|
DEFS = @DEFS@ @V_DEFS@
|
|
|
|
LIBS = @V_LIBS@
|
1999-10-07 23:46:40 +00:00
|
|
|
|
|
|
|
# Standard CFLAGS
|
|
|
|
CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
|
|
|
|
|
|
|
|
INSTALL = @INSTALL@
|
2000-07-30 05:56:49 +00:00
|
|
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
|
|
INSTALL_DATA = @INSTALL_DATA@
|
2000-06-10 14:20:24 +00:00
|
|
|
RANLIB = @RANLIB@
|
1999-10-07 23:46:40 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Flex and bison allow you to specify the prefixes of the global symbols
|
|
|
|
# used by the generated parser. This allows programs to use lex/yacc
|
|
|
|
# and link against libpcap. If you don't have flex or bison, get them.
|
|
|
|
#
|
|
|
|
LEX = @V_LEX@
|
|
|
|
YACC = @V_YACC@
|
|
|
|
|
|
|
|
# Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
|
|
|
|
# Also, gcc does not remove the .o before forking 'as', which can be a
|
|
|
|
# problem if you don't own the file but can write to the directory.
|
|
|
|
.c.o:
|
|
|
|
@rm -f $@
|
1999-10-19 15:18:28 +00:00
|
|
|
$(CC) $(CFLAGS) -c $(srcdir)/$*.c
|
1999-10-07 23:46:40 +00:00
|
|
|
|
|
|
|
PSRC = pcap-@V_PCAP@.c
|
2002-07-27 18:45:34 +00:00
|
|
|
FSRC = fad-@V_FINDALLDEVS@.c
|
2003-07-23 05:29:19 +00:00
|
|
|
SSRC = @SSRC@
|
1999-10-07 23:46:40 +00:00
|
|
|
CSRC = pcap.c inet.c gencode.c optimize.c nametoaddr.c \
|
2000-06-26 04:16:04 +00:00
|
|
|
etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c
|
1999-10-07 23:46:40 +00:00
|
|
|
GENSRC = scanner.c grammar.c version.c
|
2000-07-29 07:05:20 +00:00
|
|
|
LIBOBJS = @LIBOBJS@
|
1999-10-07 23:46:40 +00:00
|
|
|
|
2003-07-23 05:29:19 +00:00
|
|
|
SRC = $(PSRC) $(FSRC) $(CSRC) $(SSRC) $(GENSRC)
|
1999-10-07 23:46:40 +00:00
|
|
|
|
|
|
|
# We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
|
|
|
|
# hack the extra indirection
|
2003-07-23 05:29:19 +00:00
|
|
|
OBJ = $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) # $(LIBOBJS)
|
1999-10-07 23:46:40 +00:00
|
|
|
HDR = pcap.h pcap-int.h pcap-namedb.h pcap-nit.h pcap-pf.h \
|
|
|
|
ethertype.h gencode.h gnuc.h
|
|
|
|
GENHDR = \
|
2003-02-11 07:40:09 +00:00
|
|
|
tokdefs.h version.h
|
1999-10-07 23:46:40 +00:00
|
|
|
|
|
|
|
TAGHDR = \
|
2003-02-11 01:46:05 +00:00
|
|
|
pcap-bpf.h
|
1999-10-07 23:46:40 +00:00
|
|
|
|
|
|
|
TAGFILES = \
|
|
|
|
$(SRC) $(HDR) $(TAGHDR)
|
|
|
|
|
|
|
|
CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
|
|
|
|
|
|
|
|
all: libpcap.a
|
|
|
|
|
|
|
|
libpcap.a: $(OBJ)
|
|
|
|
@rm -f $@
|
2003-07-23 05:29:19 +00:00
|
|
|
ar rc $@ $(OBJ) $(LIBS)
|
1999-10-07 23:46:40 +00:00
|
|
|
$(RANLIB) $@
|
|
|
|
|
|
|
|
scanner.c: $(srcdir)/scanner.l
|
|
|
|
@rm -f $@
|
|
|
|
$(LEX) -t $< > $$$$.$@; mv $$$$.$@ $@
|
|
|
|
|
|
|
|
scanner.o: scanner.c tokdefs.h
|
1999-10-30 05:33:45 +00:00
|
|
|
$(CC) $(CFLAGS) -c scanner.c
|
|
|
|
|
2003-02-21 03:19:19 +00:00
|
|
|
pcap.o: version.h
|
|
|
|
|
1999-10-07 23:46:40 +00:00
|
|
|
tokdefs.h: grammar.c
|
|
|
|
grammar.c: $(srcdir)/grammar.y
|
|
|
|
@rm -f grammar.c tokdefs.h
|
|
|
|
$(YACC) -d $<
|
|
|
|
mv y.tab.c grammar.c
|
|
|
|
mv y.tab.h tokdefs.h
|
|
|
|
|
|
|
|
grammar.o: grammar.c
|
|
|
|
@rm -f $@
|
|
|
|
$(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c
|
|
|
|
|
|
|
|
version.o: version.c
|
1999-10-30 05:33:45 +00:00
|
|
|
$(CC) $(CFLAGS) -c version.c
|
|
|
|
|
2000-07-29 07:05:20 +00:00
|
|
|
snprintf.o: $(srcdir)/../tcpdump/missing/snprintf.c
|
|
|
|
$(CC) $(CFLAGS) -o $@ -c $(srcdir)/../tcpdump/missing/snprintf.c
|
|
|
|
|
1999-10-07 23:46:40 +00:00
|
|
|
version.c: $(srcdir)/VERSION
|
|
|
|
@rm -f $@
|
|
|
|
sed -e 's/.*/char pcap_version[] = "&";/' $(srcdir)/VERSION > $@
|
|
|
|
|
2003-02-13 07:56:38 +00:00
|
|
|
#
|
|
|
|
# NOTE: this really is supposed to be static; importing a string
|
|
|
|
# from a shared library does not work very well on many
|
|
|
|
# versions of UNIX (Solaris, Linux, and the BSDs, for example),
|
|
|
|
# so we make the version string static and return it from
|
|
|
|
# a function, which does work.
|
|
|
|
#
|
2003-02-11 07:40:09 +00:00
|
|
|
version.h: $(srcdir)/VERSION
|
|
|
|
@rm -f $@
|
At least on SunOS 5.x, Digital UNIX 4.0, AIX 4.3, FreeBSD 3.4, some
version of Red Hat Linux, HP-UX 11.00, and MacOS X 10.1, if a string in
a shared library is static, and returned by a function in that library,
the return value of that function, when called from a program, will
reflect the contents of the string in the version of the shared library
with which the program is running, not the version with which it's
linked.
Therefore we can just generate a definition of the version string and
put it into "version.h", which means that VERSION can contain any string
(as long as " and \ are escaped with \) rather than having to be N.M or
N.M.MM.
2003-02-13 07:54:59 +00:00
|
|
|
sed -e 's/.*/static const char pcap_version_string[] = "libpcap version &";/' $(srcdir)/VERSION > $@
|
2003-02-11 07:40:09 +00:00
|
|
|
|
2000-03-31 16:59:43 +00:00
|
|
|
bpf_filter.c: $(srcdir)/bpf/net/bpf_filter.c
|
|
|
|
rm -f bpf_filter.c
|
|
|
|
ln -s $(srcdir)/bpf/net/bpf_filter.c bpf_filter.c
|
|
|
|
|
|
|
|
bpf_filter.o: bpf_filter.c
|
|
|
|
$(CC) $(CFLAGS) -c bpf_filter.c
|
1999-10-30 05:33:45 +00:00
|
|
|
|
2000-07-29 07:05:20 +00:00
|
|
|
install:
|
2000-09-19 14:52:41 +00:00
|
|
|
[ -d $(DESTDIR)$(libdir) ] || \
|
|
|
|
(mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
|
2000-07-30 05:56:49 +00:00
|
|
|
$(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
|
|
|
|
$(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
|
2000-09-19 14:52:41 +00:00
|
|
|
[ -d $(DESTDIR)$(includedir) ] || \
|
|
|
|
(mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir))
|
2000-07-30 05:56:49 +00:00
|
|
|
$(INSTALL_DATA) $(srcdir)/pcap.h $(DESTDIR)$(includedir)/pcap.h
|
2003-02-11 01:46:05 +00:00
|
|
|
$(INSTALL_DATA) $(srcdir)/pcap-bpf.h \
|
|
|
|
$(DESTDIR)$(includedir)/pcap-bpf.h
|
2000-07-30 05:56:49 +00:00
|
|
|
$(INSTALL_DATA) $(srcdir)/pcap-namedb.h \
|
|
|
|
$(DESTDIR)$(includedir)/pcap-namedb.h
|
2001-01-18 04:05:12 +00:00
|
|
|
[ -d $(DESTDIR)$(mandir)/man3 ] || \
|
|
|
|
(mkdir -p $(DESTDIR)$(mandir)/man3; chmod 755 $(DESTDIR)$(mandir)/man3)
|
2000-07-30 05:56:49 +00:00
|
|
|
$(INSTALL_DATA) $(srcdir)/pcap.3 \
|
|
|
|
$(DESTDIR)$(mandir)/man3/pcap.3
|
1999-10-07 23:46:40 +00:00
|
|
|
|
2000-07-29 07:05:20 +00:00
|
|
|
uninstall:
|
2000-07-30 05:56:49 +00:00
|
|
|
rm -f $(DESTDIR)$(libdir)/libpcap.a
|
|
|
|
rm -f $(DESTDIR)$(includedir)/pcap.h
|
2003-02-11 01:46:05 +00:00
|
|
|
rm -f $(DESTDIR)$(includedir)/pcap-bpf.h
|
2000-07-30 05:56:49 +00:00
|
|
|
rm -f $(DESTDIR)$(includedir)/pcap-namedb.h
|
|
|
|
rm -f $(DESTDIR)$(mandir)/man3/pcap.3
|
2000-07-29 07:05:20 +00:00
|
|
|
|
1999-10-07 23:46:40 +00:00
|
|
|
clean:
|
|
|
|
rm -f $(CLEANFILES)
|
|
|
|
|
|
|
|
distclean:
|
|
|
|
rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
|
2003-02-11 01:46:05 +00:00
|
|
|
config.h gnuc.h os-proto.h bpf_filter.c stamp-h stamp-h.in
|
1999-10-07 23:46:40 +00:00
|
|
|
|
|
|
|
tags: $(TAGFILES)
|
|
|
|
ctags -wtd $(TAGFILES)
|
|
|
|
|
2000-07-29 07:05:20 +00:00
|
|
|
tar:
|
1999-10-07 23:46:40 +00:00
|
|
|
@cwd=`pwd` ; dir=`basename $$cwd` ; name=libpcap-`cat VERSION` ; \
|
As "make tar" runs tar with a list of files to include in the tarball,
the classic BSD "F" flag, which tells it to *exclude* certain files, is
unnecessary; furthermore, some versions of tar may not support it, and
GNU tar, as appears in FreeBSD and perhaps other BSDs, and in Linux,
interprets the "F" flag as meaning "run, at the end of each archive
volume, the script whose name is given as an argument to the flag", so
it's not even syntactically compatible with the classic "F" flag.
The latter problem causes "make tar" to fail; we remove the "F" flags to
fix the problem.
2000-07-16 19:08:29 +00:00
|
|
|
list="" ; tar="tar chf" ; \
|
1999-10-07 23:46:40 +00:00
|
|
|
for i in `cat FILES` ; do list="$$list $$name/$$i" ; done; \
|
|
|
|
echo \
|
|
|
|
"rm -f ../$$name; ln -s $$dir ../$$name" ; \
|
|
|
|
rm -f ../$$name; ln -s $$dir ../$$name ; \
|
|
|
|
echo \
|
|
|
|
"(cd .. ; $$tar - [lots of files]) | compress > /tmp/$$name.tar.Z" ; \
|
|
|
|
(cd .. ; $$tar - $$list) | compress > /tmp/$$name.tar.Z ; \
|
|
|
|
echo \
|
|
|
|
"rm -f ../$$name" ; \
|
|
|
|
rm -f ../$$name
|
|
|
|
|
2003-02-11 08:01:40 +00:00
|
|
|
depend: $(GENSRC) $(GENHDR) bpf_filter.c
|
1999-10-07 23:46:40 +00:00
|
|
|
./mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)
|