]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/libpcap/Makefile.in
This commit was generated by cvs2svn to compensate for changes in r38774,
[FreeBSD/FreeBSD.git] / contrib / libpcap / Makefile.in
1 #  Copyright (c) 1993, 1994, 1995, 1996
2 #       The Regents of the University of California.  All rights reserved.
3 #
4 #  Redistribution and use in source and binary forms, with or without
5 #  modification, are permitted provided that: (1) source code distributions
6 #  retain the above copyright notice and this paragraph in its entirety, (2)
7 #  distributions including binary code include the above copyright notice and
8 #  this paragraph in its entirety in the documentation or other materials
9 #  provided with the distribution, and (3) all advertising materials mentioning
10 #  features or use of this software display the following acknowledgement:
11 #  ``This product includes software developed by the University of California,
12 #  Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
13 #  the University nor the names of its contributors may be used to endorse
14 #  or promote products derived from this software without specific prior
15 #  written permission.
16 #  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
17 #  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
18 #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19 #
20 # @(#) $Header: Makefile.in,v 1.68 96/09/26 21:53:37 leres Exp $ (LBL)
21
22 #
23 # Various configurable paths (remember to edit Makefile.in, not Makefile)
24 #
25
26 # Top level hierarchy
27 prefix = @prefix@
28 exec_prefix = @exec_prefix@
29 # Pathname of directory to install the include files
30 INCLDEST = @includedir@
31 # Pathname of directory to install the library
32 LIBDEST =  @libdir@
33 # Pathname of directory to install the man page
34 MANDEST = @mandir@
35
36 # VPATH
37 srcdir = @srcdir@
38 VPATH = @srcdir@
39
40 #
41 # You shouldn't need to edit anything below.
42 #
43
44 CC = @CC@
45 CCOPT = @V_CCOPT@
46 INCLS = -I. @V_INCLS@
47 DEFS = @DEFS@
48
49 # Standard CFLAGS
50 CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
51
52 INSTALL = @INSTALL@
53 RANLIB = @V_RANLIB@
54
55 #
56 # Flex and bison allow you to specify the prefixes of the global symbols
57 # used by the generated parser.  This allows programs to use lex/yacc
58 # and link against libpcap.  If you don't have flex or bison, get them.
59 #
60 LEX = @V_LEX@
61 YACC = @V_YACC@
62
63 # Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
64 # Also, gcc does not remove the .o before forking 'as', which can be a
65 # problem if you don't own the file but can write to the directory.
66 .c.o:
67         @rm -f $@
68         $(CC) $(CFLAGS) -c $(srcdir)/$*.c
69
70 PSRC =  pcap-@V_PCAP@.c
71 CSRC =  pcap.c inet.c gencode.c optimize.c nametoaddr.c \
72         etherent.c savefile.c bpf_filter.c bpf_image.c
73 GENSRC = scanner.c grammar.c
74
75 SRC =   $(PSRC) $(CSRC) $(GENSRC)
76
77 # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
78 # hack the extra indirection
79 OBJ =   $(PSRC:.c=.o) $(CSRC:.c=.o) $(GENSRC:.c=.o)
80 HDR =   pcap.h pcap-int.h pcap-namedb.h pcap-nit.h pcap-pf.h \
81         ethertype.h gencode.h gnuc.h
82 GENHDR = \
83         tokdefs.h
84
85 TAGHDR = \
86         bpf/net/bpf.h
87
88 TAGFILES = \
89         $(SRC) $(HDR) $(TAGHDR)
90
91 CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
92
93 libpcap.a: $(OBJ)
94         @rm -f $@
95         ar rc $@ $(OBJ)
96         $(RANLIB) $@
97
98 scanner.c: $(srcdir)/scanner.l
99         @rm -f $@
100         $(LEX) -t $< > $$$$.$@; mv $$$$.$@ $@
101
102 scanner.o: scanner.c tokdefs.h
103 tokdefs.h: grammar.c
104 grammar.c: $(srcdir)/grammar.y
105         @rm -f grammar.c tokdefs.h
106         $(YACC) -d $<
107         mv y.tab.c grammar.c
108         mv y.tab.h tokdefs.h
109
110 grammar.o: grammar.c
111         @rm -f $@
112         $(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c
113
114 install: force
115         $(INSTALL) -m 444 -o bin -g bin libpcap.a $(DESTDIR)$(LIBDEST)
116         $(RANLIB) $(DESTDIR)$(LIBDEST)/libpcap.a
117
118 install-incl: force
119         $(INSTALL) -m 444 -o bin -g bin $(srcdir)/pcap.h $(DESTDIR)$(INCLDEST)
120         $(INSTALL) -m 444 -o bin -g bin $(srcdir)/pcap-namedb.h $(DESTDIR)$(INCLDEST)
121         $(INSTALL) -m 444 -o bin -g bin $(srcdir)/net/bpf.h $(DESTDIR)$(INCLDEST)/net
122
123 install-man: force
124         $(INSTALL) -m 444 -o bin -g bin $(srcdir)/pcap.3 $(DESTDIR)$(MANDEST)/man3
125
126 clean:
127         rm -f $(CLEANFILES)
128
129 distclean:
130         rm -f $(CLEANFILES) Makefile config.cache config.log config.status \
131             gnuc.h os-proto.h bpf_filter.c net
132
133 tags: $(TAGFILES)
134         ctags -wtd $(TAGFILES)
135
136 tar:    force
137         @cwd=`pwd` ; dir=`basename $$cwd` ; name=libpcap-`cat VERSION` ; \
138             list="" ; tar="tar chFFf" ; \
139             for i in `cat FILES` ; do list="$$list $$name/$$i" ; done; \
140             echo \
141             "rm -f ../$$name; ln -s $$dir ../$$name" ; \
142              rm -f ../$$name; ln -s $$dir ../$$name ; \
143             echo \
144             "(cd .. ; $$tar - [lots of files]) | compress > /tmp/$$name.tar.Z" ; \
145              (cd .. ; $$tar - $$list) | compress > /tmp/$$name.tar.Z ; \
146             echo \
147             "rm -f ../$$name" ; \
148              rm -f ../$$name
149
150 force:  /tmp
151 depend: $(GENSRC) force
152         ./mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)