Makefile.in revision 26175
117683Spst#  Copyright (c) 1993, 1994, 1995, 1996
217683Spst# 	The Regents of the University of California.  All rights reserved.
317683Spst#
417683Spst#  Redistribution and use in source and binary forms, with or without
517683Spst#  modification, are permitted provided that: (1) source code distributions
617683Spst#  retain the above copyright notice and this paragraph in its entirety, (2)
717683Spst#  distributions including binary code include the above copyright notice and
817683Spst#  this paragraph in its entirety in the documentation or other materials
917683Spst#  provided with the distribution, and (3) all advertising materials mentioning
1017683Spst#  features or use of this software display the following acknowledgement:
1117683Spst#  ``This product includes software developed by the University of California,
1217683Spst#  Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
1317683Spst#  the University nor the names of its contributors may be used to endorse
1417683Spst#  or promote products derived from this software without specific prior
1517683Spst#  written permission.
1617683Spst#  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
1717683Spst#  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
1817683Spst#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1917683Spst#
2026175Sfenner# @(#) $Header: Makefile.in,v 1.68 96/09/26 21:53:37 leres Exp $ (LBL)
2117683Spst
2217683Spst#
2317683Spst# Various configurable paths (remember to edit Makefile.in, not Makefile)
2417683Spst#
2517683Spst
2617683Spst# Top level hierarchy
2717683Spstprefix = @prefix@
2817683Spstexec_prefix = @exec_prefix@
2917683Spst# Pathname of directory to install the include files
3017683SpstINCLDEST = @includedir@
3117683Spst# Pathname of directory to install the library
3217683SpstLIBDEST =  @libdir@
3317683Spst# Pathname of directory to install the man page
3417683SpstMANDEST = @mandir@
3517683Spst
3626175Sfenner# VPATH
3726175Sfennersrcdir = @srcdir@
3826175SfennerVPATH = @srcdir@
3926175Sfenner
4017683Spst#
4117683Spst# You shouldn't need to edit anything below.
4217683Spst#
4317683Spst
4417683SpstCC = @CC@
4517683SpstCCOPT = @V_CCOPT@
4617683SpstINCLS = -I. @V_INCLS@
4717683SpstDEFS = @DEFS@
4817683Spst
4917683Spst# Standard CFLAGS
5017683SpstCFLAGS = $(CCOPT) $(INCLS) $(DEFS)
5117683Spst
5217683SpstINSTALL = @INSTALL@
5317683SpstRANLIB = @V_RANLIB@
5417683Spst
5517683Spst#
5617683Spst# Flex and bison allow you to specify the prefixes of the global symbols
5717683Spst# used by the generated parser.  This allows programs to use lex/yacc
5817683Spst# and link against libpcap.  If you don't have flex or bison, get them.
5917683Spst#
6017683SpstLEX = @V_LEX@
6117683SpstYACC = @V_YACC@
6217683Spst
6317683Spst# Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
6417683Spst# Also, gcc does not remove the .o before forking 'as', which can be a
6517683Spst# problem if you don't own the file but can write to the directory.
6617683Spst.c.o:
6717683Spst	@rm -f $@
6826175Sfenner	$(CC) $(CFLAGS) -c $(srcdir)/$*.c
6917683Spst
7017683SpstPSRC =	pcap-@V_PCAP@.c
7117683SpstCSRC =	pcap.c inet.c gencode.c optimize.c nametoaddr.c \
7217683Spst	etherent.c savefile.c bpf_filter.c bpf_image.c
7317683SpstGENSRC = scanner.c grammar.c
7417683Spst
7517683SpstSRC =	$(PSRC) $(CSRC) $(GENSRC)
7617683Spst
7717683Spst# We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
7817683Spst# hack the extra indirection
7917683SpstOBJ =	$(PSRC:.c=.o) $(CSRC:.c=.o) $(GENSRC:.c=.o)
8017683SpstHDR =	pcap.h pcap-int.h pcap-namedb.h pcap-nit.h pcap-pf.h \
8117683Spst	ethertype.h gencode.h gnuc.h
8217683SpstGENHDR = \
8317683Spst	tokdefs.h
8417683Spst
8517683SpstTAGHDR = \
8617683Spst	bpf/net/bpf.h
8717683Spst
8817683SpstTAGFILES = \
8917683Spst	$(SRC) $(HDR) $(TAGHDR)
9017683Spst
9117683SpstCLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
9217683Spst
9317683Spstlibpcap.a: $(OBJ)
9426175Sfenner	@rm -f $@
9517683Spst	ar rc $@ $(OBJ)
9617683Spst	$(RANLIB) $@
9717683Spst
9826175Sfennerscanner.c: $(srcdir)/scanner.l
9926175Sfenner	@rm -f $@
10026175Sfenner	$(LEX) -t $< > $$$$.$@; mv $$$$.$@ $@
10117683Spst
10217683Spstscanner.o: scanner.c tokdefs.h
10317683Spsttokdefs.h: grammar.c
10426175Sfennergrammar.c: $(srcdir)/grammar.y
10526175Sfenner	@rm -f grammar.c tokdefs.h
10617683Spst	$(YACC) -d $<
10717683Spst	mv y.tab.c grammar.c
10817683Spst	mv y.tab.h tokdefs.h
10917683Spst
11017683Spstgrammar.o: grammar.c
11126175Sfenner	@rm -f $@
11226175Sfenner	$(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c
11317683Spst
11417683Spstinstall: force
11517683Spst	$(INSTALL) -m 444 -o bin -g bin libpcap.a $(DESTDIR)$(LIBDEST)
11617683Spst	$(RANLIB) $(DESTDIR)$(LIBDEST)/libpcap.a
11717683Spst
11817683Spstinstall-incl: force
11926175Sfenner	$(INSTALL) -m 444 -o bin -g bin $(srcdir)/pcap.h $(DESTDIR)$(INCLDEST)
12026175Sfenner	$(INSTALL) -m 444 -o bin -g bin $(srcdir)/pcap-namedb.h $(DESTDIR)$(INCLDEST)
12126175Sfenner	$(INSTALL) -m 444 -o bin -g bin $(srcdir)/net/bpf.h $(DESTDIR)$(INCLDEST)/net
12217683Spst
12317683Spstinstall-man: force
12426175Sfenner	$(INSTALL) -m 444 -o bin -g bin $(srcdir)/pcap.3 $(DESTDIR)$(MANDEST)/man3
12517683Spst
12617683Spstclean:
12717683Spst	rm -f $(CLEANFILES)
12817683Spst
12917683Spstdistclean:
13017683Spst	rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
13117683Spst	    gnuc.h os-proto.h bpf_filter.c net
13217683Spst
13317683Spsttags: $(TAGFILES)
13417683Spst	ctags -wtd $(TAGFILES)
13517683Spst
13617683Spsttar:	force
13717683Spst	@cwd=`pwd` ; dir=`basename $$cwd` ; name=libpcap-`cat VERSION` ; \
13817683Spst	    list="" ; tar="tar chFFf" ; \
13917683Spst	    for i in `cat FILES` ; do list="$$list $$name/$$i" ; done; \
14017683Spst	    echo \
14117683Spst	    "rm -f ../$$name; ln -s $$dir ../$$name" ; \
14217683Spst	     rm -f ../$$name; ln -s $$dir ../$$name ; \
14317683Spst	    echo \
14417683Spst	    "(cd .. ; $$tar - [lots of files]) | compress > /tmp/$$name.tar.Z" ; \
14517683Spst	     (cd .. ; $$tar - $$list) | compress > /tmp/$$name.tar.Z ; \
14617683Spst	    echo \
14717683Spst	    "rm -f ../$$name" ; \
14817683Spst	     rm -f ../$$name
14917683Spst
15017683Spstforce:	/tmp
15117683Spstdepend:	$(GENSRC) force
15217683Spst	./mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)
153