NetBSD/lib/libpcap/Makefile.in

194 lines
5.4 KiB
Makefile

# Copyright (c) 1993, 1994
# 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.
#
# @(#) Header: Makefile.in,v 1.36 94/06/23 14:05:11 leres Exp (LBL)
#
# Edit these paths. INCLUDE_DIR is where the installed pcap
# include files should go. LIB_DIR is where libpcap.a should go.
#
INCLUDE_DIR = /usr/local/include
LIB_DIR = /usr/local/lib
#
# You shouldn't need to edit anything below.
#
#have-ethers#ETHERS_DEFINES = -DETHER_SERVICE
#have-solaris#OS_DEFINES = -DSOLARIS
DEFINE_STDC = -D__STDC__
#have-gcc#DEFINE_STDC =
#have-irix#OS_DEFINES = -Dvolatile= $(DEFINE_STDC)
#have-pf#PCAP_DEFINES = -DPCAP_PF
#have-bpf#PCAP = bpf
#have-pf#PCAP = pf
#have-nit#PCAP = nit
#have-snit#PCAP = snit
#have-snoop#PCAP = snoop
#have-dlpi#PCAP = dlpi
CCOPT = -O
INCLUDES = -I.
DEFINES = -DFDDI $(ETHERS_DEFINES) $(PCAP_DEFINES) $(OS_DEFINES)
# Standard CFLAGS
CFLAGS = $(CCOPT) $(DEFINES) $(INCLUDES)
CC = cc
#have-gcc#CC = gcc -g -Wall -Wmissing-prototypes -Wstrict-prototypes
# The installed binary is owned by this group.
GROUP = bpf
#
# 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 = lex
YACC = yacc
#have-flex#LEX = flex -Ppcap_
#have-bison#YACC = bison -y -p pcap_
MAKE = make
SHELL = /bin/sh
RANLIB = echo
#have-ranlib#RANLIB = ranlib
# Explicitly define compiliation 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 $@; $(CC) $(CFLAGS) -c $*.c
PCAPSRC = \
pcap-$(PCAP).c
CSRC = pcap.c inet.c gencode.c optimize.c nametoaddr.c etherent.c savefile.c \
bpf_filter.c bpf_image.c
LSRC = scanner.l
YSRC = grammar.y
GEN = $(LSRC:.l=.c) $(YSRC:.y=.c)
SRC = $(PCAPSRC) $(CSRC) $(GEN)
ALLSRC = \
pcap-bpf.c pcap-dlpi.c pcap-enet.c pcap-nit.c pcap-pf.c \
pcap-snit.c pcap-snoop.c \
$(CSRC) $(LSRC) $(YSRC)
OBJ = $(SRC:.c=.o)
HDR = pcap.h pcap-int.h pcap-namedb.h pcap-nit.h pcap-pf.h \
ethertype.h gencode.h
GENHDR = \
tokdefs.h
TAGFILES = \
$(SRC) $(HDR)
TARFILES = \
README CHANGES INSTALL VERSION Makefile.in pcap.3 mkdep \
$(ALLSRC) $(HDR) \
net bpf/net/bpf_filter.c bpf/net/bpf.h SUNOS4 configure
libpcap.a: $(OBJ)
rm -f libpcap.a
ar rc $@ $(OBJ)
$(RANLIB) $@
scanner.c: scanner.l
rm -f $@
$(LEX) -t $< > $@
scanner.o: scanner.c
rm -f $@; $(CC) $(CFLAGS) $(LEX_DEFINES) -c $*.c
tokdefs.h: grammar.c
grammar.c: 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
$(CC) -c $(CFLAGS) -Dyylval=pcap_lval grammar.c
install: force
@for i in $(INCLUDE_DIR) $(LIB_DIR) ; do \
if [ ! -d $$i ] ; then \
echo "mkdir $$i"; \
mkdir $$i; \
chmod 755 $$i; \
else true; \
fi; \
done
cp libpcap.a $(LIB_DIR); \
chmod 444 $(LIB_DIR)/libpcap.a; \
chown bin $(LIB_DIR)/libpcap.a; \
chgrp bin $(LIB_DIR)/libpcap.a
-$(RANLIB) $(LIB_DIR)/libpcap.a
cp pcap.h pcap-namedb.h $(INCLUDE_DIR); \
chmod 444 $(INCLUDE_DIR)/pcap.h $(INCLUDE_DIR)/pcap-namedb.h; \
chown bin $(INCLUDE_DIR)/pcap.h $(INCLUDE_DIR)/pcap-namedb.h; \
chgrp bin $(INCLUDE_DIR)/pcap.h $(INCLUDE_DIR)/pcap-namedb.h
if [ ! -f /usr/include/net/bpf.h ]; then \
i=$(INCLUDE_DIR)/net; \
if [ ! -d $$i ] ; then \
echo "mkdir $$i"; \
mkdir $$i; \
chmod 755 $$i; \
else true; \
fi; \
cp net/bpf.h $(INCLUDE_DIR)/net; \
chmod 444 $(INCLUDE_DIR)/net/bpf.h; \
chown bin $(INCLUDE_DIR)/net/bpf.h; \
chgrp bin $(INCLUDE_DIR)/net/bpf.h; \
fi
clean:
rm -f $(OBJ) libpcap.a lex.yy.c $(GEN) $(GENHDR)
realclean:
rm -f $(OBJ) libpcap.a lex.yy.c $(GEN) $(GENHDR) Makefile tags
tags: $(TAGFILES)
ctags -wtd $(TAGFILES)
tar: force
@cwd=`pwd` ; dir=`basename $$cwd` ; name=libpcap-`cat VERSION` ; \
list="" ; tar="tar cf" ; \
for i in $(TARFILES) ; 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
force: /tmp
depend: $(GEN) force
./mkdep $(DEFINES) $(INCLUDES) $(SRC)