add winpcap 4.0.2 from url http://www.winpcap.org/
[natblaster.git] / winpcap / wpcap / libpcap / Makefile.in
blob5e20b90995ef8dba417150910611948f9d1cb5eb
1 # Copyright (c) 1993, 1994, 1995, 1996
2 # The Regents of the University of California. All rights reserved.
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.
20 # @(#) $Header: /tcpdump/master/libpcap/Makefile.in,v 1.99 2003/12/15 01:35:03 guy Exp $ (LBL)
23 # Various configurable paths (remember to edit Makefile.in, not Makefile)
26 # Top level hierarchy
27 prefix = @prefix@
28 exec_prefix = @exec_prefix@
29 # Pathname of directory to install the include files
30 includedir = @includedir@
31 # Pathname of directory to install the library
32 libdir = @libdir@
33 # Pathname of directory to install the man page
34 mandir = @mandir@
36 # VPATH
37 srcdir = @srcdir@
38 VPATH = @srcdir@
41 # You shouldn't need to edit anything below.
44 CC = @CC@
45 CCOPT = @V_CCOPT@
46 INCLS = -I. @V_INCLS@
47 # HAVE_REMOTE
48 DEFS = @DEFS@ @V_DEFS@ @V_HAVE_REMOTE@
49 LIBS = @V_LIBS@
50 DYEXT = @DYEXT@
52 # Standard CFLAGS
53 CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
55 INSTALL = @INSTALL@
56 INSTALL_PROGRAM = @INSTALL_PROGRAM@
57 INSTALL_DATA = @INSTALL_DATA@
58 RANLIB = @RANLIB@
61 # Flex and bison allow you to specify the prefixes of the global symbols
62 # used by the generated parser. This allows programs to use lex/yacc
63 # and link against libpcap. If you don't have flex or bison, get them.
65 LEX = @V_LEX@
66 YACC = @V_YACC@
68 # Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
69 # Also, gcc does not remove the .o before forking 'as', which can be a
70 # problem if you don't own the file but can write to the directory.
71 .c.o:
72 @rm -f $@
73 $(CC) $(CFLAGS) -c $(srcdir)/$*.c
75 PSRC = pcap-@V_PCAP@.c
76 FSRC = fad-@V_FINDALLDEVS@.c
77 SSRC = @SSRC@
78 CSRC = pcap.c inet.c gencode.c optimize.c nametoaddr.c \
79 etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c
80 GENSRC = scanner.c grammar.c version.c
81 # HAVE_REMOTE
82 REMOTESRC = @V_REMOTE_FILES@
83 LIBOBJS = @LIBOBJS@
85 # HAVE_REMOTE
86 SRC = $(PSRC) $(FSRC) $(CSRC) $(SSRC) $(GENSRC) $(REMOTESRC)
88 # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
89 # hack the extra indirection
90 # HAVE_REMOTE
91 OBJ = $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(REMOTESRC:.c=.o) $(LIBOBJS)
92 HDR = pcap.h pcap-int.h pcap-namedb.h pcap-nit.h pcap-pf.h \
93 ethertype.h gencode.h gnuc.h
94 GENHDR = \
95 tokdefs.h version.h
97 TAGHDR = \
98 pcap-bpf.h
100 TAGFILES = \
101 $(SRC) $(HDR) $(TAGHDR)
103 CLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
105 all: libpcap.a
107 libpcap.a: $(OBJ)
108 @rm -f $@
109 ar rc $@ $(OBJ) $(LIBS)
110 $(RANLIB) $@
112 shared: libpcap.$(DYEXT)
115 # XXX - this works with GNU ld, but won't necessarily work with native
116 # ld on, for example, various SVR4-flavored platforms, or Digital UNIX.
118 libpcap.so: $(OBJ)
119 @rm -f $@
120 ld -shared -o $@.`cat VERSION` $(OBJ)
122 # the following rule succeeds, but the result is untested.
123 libpcap.dylib: $(OBJ)
124 rm -f libpcap*.dylib
125 $(CC) -dynamiclib -undefined error -o libpcap.`cat VERSION`.dylib $(OBJ) \
126 -install_name $(libdir)/libpcap.0.dylib -compatibility_version `cat VERSION` \
127 -current_version `cat VERSION`
130 scanner.c: $(srcdir)/scanner.l
131 @rm -f $@
132 $(LEX) -t $< > $$$$.$@; mv $$$$.$@ $@
134 scanner.o: scanner.c tokdefs.h
135 $(CC) $(CFLAGS) -c scanner.c
137 pcap.o: version.h
139 tokdefs.h: grammar.c
140 grammar.c: $(srcdir)/grammar.y
141 @rm -f grammar.c tokdefs.h
142 $(YACC) -d $<
143 mv y.tab.c grammar.c
144 mv y.tab.h tokdefs.h
146 grammar.o: grammar.c
147 @rm -f $@
148 $(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c
150 version.o: version.c
151 $(CC) $(CFLAGS) -c version.c
153 snprintf.o: $(srcdir)/missing/snprintf.c
154 $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
156 version.c: $(srcdir)/VERSION
157 @rm -f $@
158 sed -e 's/.*/char pcap_version[] = "&";/' $(srcdir)/VERSION > $@
161 # NOTE: this really is supposed to be static; importing a string
162 # from a shared library does not work very well on many
163 # versions of UNIX (Solaris, Linux, and the BSDs, for example),
164 # so we make the version string static and return it from
165 # a function, which does work.
167 version.h: $(srcdir)/VERSION
168 @rm -f $@
169 sed -e 's/.*/static const char pcap_version_string[] = "libpcap version &";/' $(srcdir)/VERSION > $@
171 bpf_filter.c: $(srcdir)/bpf/net/bpf_filter.c
172 rm -f bpf_filter.c
173 ln -s $(srcdir)/bpf/net/bpf_filter.c bpf_filter.c
175 bpf_filter.o: bpf_filter.c
176 $(CC) $(CFLAGS) -c bpf_filter.c
178 install: libpcap.a
179 [ -d $(DESTDIR)$(libdir) ] || \
180 (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
181 $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
182 $(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
183 [ -d $(DESTDIR)$(includedir) ] || \
184 (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir))
185 $(INSTALL_DATA) $(srcdir)/pcap.h $(DESTDIR)$(includedir)/pcap.h
186 $(INSTALL_DATA) $(srcdir)/pcap-bpf.h \
187 $(DESTDIR)$(includedir)/pcap-bpf.h
188 $(INSTALL_DATA) $(srcdir)/pcap-namedb.h \
189 $(DESTDIR)$(includedir)/pcap-namedb.h
190 [ -d $(DESTDIR)$(mandir)/man3 ] || \
191 (mkdir -p $(DESTDIR)$(mandir)/man3; chmod 755 $(DESTDIR)$(mandir)/man3)
192 $(INSTALL_DATA) $(srcdir)/pcap.3 \
193 $(DESTDIR)$(mandir)/man3/pcap.3
195 install-shared: install-shared-$(DYEXT)
196 install-shared-so: libpcap.so
197 $(INSTALL_PROGRAM) libpcap.so.`cat VERSION` $(DESTDIR)$(libdir)/libpcap.so.`cat VERSION`
198 install-shared-dylib: libpcap.dylib
199 $(INSTALL_PROGRAM) libpcap.`cat VERSION`.dylib $(DESTDIR)$(libdir)/libpcap.`cat VERSION`.dylib
200 VER=`cat VERSION`; cd $(DESTDIR)$(libdir) && ln -sf libpcap.$$VER.dylib libpcap.0.dylib; ln -sf libpcap.0.dylib libpcap.dylib
202 uninstall:
203 rm -f $(DESTDIR)$(libdir)/libpcap.a
204 rm -f $(DESTDIR)$(includedir)/pcap.h
205 rm -f $(DESTDIR)$(includedir)/pcap-bpf.h
206 rm -f $(DESTDIR)$(includedir)/pcap-namedb.h
207 rm -f $(DESTDIR)$(mandir)/man3/pcap.3
209 clean:
210 rm -f $(CLEANFILES) libpcap*.dylib libpcap.so*
212 distclean: clean
213 rm -f Makefile config.cache config.log config.status \
214 config.h gnuc.h os-proto.h bpf_filter.c stamp-h stamp-h.in
215 rm -rf autom4te.cache
217 tags: $(TAGFILES)
218 ctags -wtd $(TAGFILES)
220 packaging/pcap.spec: packaging/pcap.spec.in VERSION
221 RPMVERSION=`cat VERSION | sed s/-.*//g`; \
222 sed -e s/@VERSION@/$$RPMVERSION/ -e s/@NAME@/libpcap-`cat VERSION`/ $< > $@
224 tar: Makefile packaging/pcap.spec
225 @cwd=`pwd` ; dir=`basename $$cwd` ; name=libpcap-`cat VERSION` ; \
226 list="" ; tar="tar chf" ; \
227 for i in `cat FILES` ; do list="$$list $$name/$$i" ; done; \
228 echo \
229 "rm -f ../$$name; ln -s $$dir ../$$name" ; \
230 rm -f ../$$name; ln -s $$dir ../$$name ; \
231 echo \
232 "(cd .. ; $$tar - [lots of files]) | gzip -c > /tmp/$$name.tar.gz" ; \
233 (cd .. ; $$tar - $$list) | gzip -c > /tmp/$$name.tar.gz ; \
234 echo \
235 "rm -f ../$$name" ; \
236 rm -f ../$$name
238 depend: $(GENSRC) $(GENHDR) bpf_filter.c
239 ./mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)
241 Makefile: Makefile.in config.status
242 ./config.status
243 @echo your Makefile was out of date, now run $(MAKE) again
244 exit 1