]> The Tcpdump Group git mirrors - libpcap/blob - Makefile.in
Improve dag_platform_finddevs range and efficiency.
[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: /tcpdump/master/libpcap/Makefile.in,v 1.142 2008-11-22 17:30:24 guy 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 datarootdir = @datarootdir@
30 # Pathname of directory to install the configure program
31 bindir = @bindir@
32 # Pathname of directory to install the include files
33 includedir = @includedir@
34 # Pathname of directory to install the library
35 libdir = @libdir@
36 # Pathname of directory to install the man pages
37 mandir = @mandir@
38
39 # VPATH
40 srcdir = @srcdir@
41 VPATH = @srcdir@
42
43 #
44 # You shouldn't need to edit anything below.
45 #
46
47 CC = @CC@
48 CCOPT = @V_CCOPT@
49 INCLS = -I. @V_INCLS@
50 DEFS = @DEFS@ @V_DEFS@
51 ADDLOBJS = @ADDLOBJS@
52 ADDLARCHIVEOBJS = @ADDLARCHIVEOBJS@
53 LIBS = @LIBS@
54 LDFLAGS = @LDFLAGS@
55 DYEXT = @DYEXT@
56 V_RPATH_OPT = @V_RPATH_OPT@
57 PROG=libpcap
58
59 # Standard CFLAGS
60 CFLAGS = $(CCOPT) $(INCLS) $(DEFS)
61
62 INSTALL = @INSTALL@
63 INSTALL_PROGRAM = @INSTALL_PROGRAM@
64 INSTALL_DATA = @INSTALL_DATA@
65 RANLIB = @RANLIB@
66
67 #
68 # Flex and bison allow you to specify the prefixes of the global symbols
69 # used by the generated parser. This allows programs to use lex/yacc
70 # and link against libpcap. If you don't have flex or bison, get them.
71 #
72 LEX = @V_LEX@
73 YACC = @V_YACC@
74
75 # Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
76 # Also, gcc does not remove the .o before forking 'as', which can be a
77 # problem if you don't own the file but can write to the directory.
78 .c.o:
79 @rm -f $@
80 $(CC) $(CFLAGS) -c $(srcdir)/$*.c
81
82 PSRC = pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@
83 FSRC = fad-@V_FINDALLDEVS@.c
84 SSRC = @SSRC@
85 CSRC = pcap.c inet.c gencode.c optimize.c nametoaddr.c \
86 etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c
87 GENSRC = scanner.c grammar.c version.c
88 LIBOBJS = @LIBOBJS@
89
90 SRC = $(PSRC) $(FSRC) $(CSRC) $(SSRC) $(GENSRC)
91
92 # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
93 # hack the extra indirection
94 OBJ = $(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS)
95 PUBHDR = \
96 pcap.h \
97 pcap-bpf.h \
98 pcap-namedb.h \
99 pcap/bpf.h \
100 pcap/bluetooth.h \
101 pcap/namedb.h \
102 pcap/pcap.h \
103 pcap/sll.h \
104 pcap/vlan.h \
105 pcap/usb.h
106
107 HDR = $(PUBHDR) \
108 arcnet.h \
109 atmuni31.h \
110 ethertype.h \
111 gencode.h \
112 ieee80211.h \
113 llc.h \
114 nlpid.h \
115 pcap-int.h \
116 pcap-stdinc.h \
117 ppp.h \
118 sunatmpos.h
119
120 GENHDR = \
121 scanner.h tokdefs.h version.h
122
123 TAGFILES = \
124 $(SRC) $(HDR)
125
126 CLEANFILES = $(OBJ) libpcap.* filtertest findalldevstest selpolltest \
127 opentest $(PROG)-`cat VERSION`.tar.gz $(GENSRC) $(GENHDR) \
128 lex.yy.c pcap-config
129
130 MAN1 = pcap-config.1
131
132 MAN3PCAP_EXPAND = \
133 pcap.3pcap.in \
134 pcap_compile.3pcap.in \
135 pcap_datalink.3pcap.in \
136 pcap_dump_open.3pcap.in \
137 pcap_list_datalinks.3pcap.in \
138 pcap_open_dead.3pcap.in \
139 pcap_open_offline.3pcap.in
140
141 MAN3PCAP_NOEXPAND = \
142 pcap_activate.3pcap \
143 pcap_breakloop.3pcap \
144 pcap_can_set_rfmon.3pcap \
145 pcap_close.3pcap \
146 pcap_create.3pcap \
147 pcap_datalink_name_to_val.3pcap \
148 pcap_datalink_val_to_name.3pcap \
149 pcap_dump.3pcap \
150 pcap_dump_close.3pcap \
151 pcap_dump_file.3pcap \
152 pcap_dump_flush.3pcap \
153 pcap_dump_ftell.3pcap \
154 pcap_file.3pcap \
155 pcap_fileno.3pcap \
156 pcap_findalldevs.3pcap \
157 pcap_freealldevs.3pcap \
158 pcap_freecode.3pcap \
159 pcap_free_datalinks.3pcap \
160 pcap_get_selectable_fd.3pcap \
161 pcap_geterr.3pcap \
162 pcap_inject.3pcap \
163 pcap_is_swapped.3pcap \
164 pcap_lib_version.3pcap \
165 pcap_lookupdev.3pcap \
166 pcap_lookupnet.3pcap \
167 pcap_loop.3pcap \
168 pcap_major_version.3pcap \
169 pcap_next_ex.3pcap \
170 pcap_offline_filter.3pcap \
171 pcap_open_live.3pcap \
172 pcap_set_buffer_size.3pcap \
173 pcap_set_datalink.3pcap \
174 pcap_set_promisc.3pcap \
175 pcap_set_rfmon.3pcap \
176 pcap_set_snaplen.3pcap \
177 pcap_set_timeout.3pcap \
178 pcap_setdirection.3pcap \
179 pcap_setfilter.3pcap \
180 pcap_setnonblock.3pcap \
181 pcap_snapshot.3pcap \
182 pcap_stats.3pcap \
183 pcap_statustostr.3pcap \
184 pcap_strerror.3pcap
185
186 MAN3PCAP = $(MAN3PCAP_NOEXPAND) $(MAN3PCAP_EXPAND:.in=)
187
188 MANFILE = \
189 pcap-savefile.manfile.in
190
191 MANMISC = \
192 pcap-filter.manmisc.in \
193 pcap-linktype.manmisc.in
194
195 EXTRA_DIST = \
196 CHANGES \
197 ChmodBPF/ChmodBPF \
198 ChmodBPF/StartupParameters.plist \
199 CREDITS \
200 INSTALL.txt \
201 LICENSE \
202 Makefile.in \
203 README \
204 README.aix \
205 README.dag \
206 README.hpux \
207 README.linux \
208 README.macosx \
209 README.septel \
210 README.sita \
211 README.tru64 \
212 README.Win32 \
213 SUNOS4/nit_if.o.sparc \
214 SUNOS4/nit_if.o.sun3 \
215 SUNOS4/nit_if.o.sun4c.4.0.3c \
216 TODO \
217 VERSION \
218 aclocal.m4 \
219 bpf/net/bpf_filter.c \
220 chmod_bpf \
221 config.guess \
222 config.h.in \
223 config.sub \
224 configure \
225 configure.in \
226 dlpisubs.c \
227 dlpisubs.h \
228 fad-getad.c \
229 fad-gifc.c \
230 fad-glifc.c \
231 fad-null.c \
232 fad-sita.c \
233 fad-win32.c \
234 filtertest.c \
235 findalldevstest.c \
236 grammar.y \
237 install-sh \
238 lbl/os-aix4.h \
239 lbl/os-hpux11.h \
240 lbl/os-osf4.h \
241 lbl/os-osf5.h \
242 lbl/os-solaris2.h \
243 lbl/os-sunos4.h \
244 lbl/os-ultrix4.h \
245 missing/snprintf.c \
246 mkdep \
247 msdos/bin2c.c \
248 msdos/common.dj \
249 msdos/makefile \
250 msdos/makefile.dj \
251 msdos/makefile.wc \
252 msdos/ndis2.c \
253 msdos/ndis2.h \
254 msdos/ndis_0.asm \
255 msdos/pkt_rx0.asm \
256 msdos/pkt_rx1.s \
257 msdos/pktdrvr.c \
258 msdos/pktdrvr.h \
259 msdos/readme.dos \
260 opentest.c \
261 org.tcpdump.chmod_bpf.plist \
262 packaging/pcap.spec.in \
263 pcap-bpf.c \
264 pcap-bt-linux.c \
265 pcap-bt-linux.h \
266 pcap-config.in \
267 pcap-dag.c \
268 pcap-dag.h \
269 pcap-dlpi.c \
270 pcap-dos.c \
271 pcap-dos.h \
272 pcap-enet.c \
273 pcap-int.h \
274 pcap-libdlpi.c \
275 pcap-linux.c \
276 pcap-namedb.h \
277 pcap-nit.c \
278 pcap-null.c \
279 pcap-pf.c \
280 pcap-septel.c \
281 pcap-septel.h \
282 pcap-sita.h \
283 pcap-sita.c \
284 pcap-sita.html \
285 pcap-snit.c \
286 pcap-snoop.c \
287 pcap-usb-linux.c \
288 pcap-usb-linux.h \
289 pcap-win32.c \
290 runlex.sh \
291 scanner.l \
292 selpolltest.c \
293 Win32/Include/Gnuc.h \
294 Win32/Include/addrinfo.h \
295 Win32/Include/bittypes.h \
296 Win32/Include/cdecl_ext.h \
297 Win32/Include/inetprivate.h \
298 Win32/Include/ip6_misc.h \
299 Win32/Include/sockstorage.h \
300 Win32/Include/arpa/nameser.h \
301 Win32/Include/net/if.h \
302 Win32/Include/net/netdb.h \
303 Win32/Include/net/paths.h \
304 Win32/Prj/libpcap.dsp \
305 Win32/Prj/libpcap.dsw \
306 Win32/Src/ffs.c \
307 Win32/Src/gai_strerror.c \
308 Win32/Src/getaddrinfo.c \
309 Win32/Src/getnetbynm.c \
310 Win32/Src/getnetent.c \
311 Win32/Src/getopt.c \
312 Win32/Src/getservent.c \
313 Win32/Src/inet_aton.c \
314 Win32/Src/inet_net.c \
315 Win32/Src/inet_pton.c
316
317 all: libpcap.a shared pcap-config
318
319 libpcap.a: $(OBJ)
320 @rm -f $@
321 ar rc $@ $(OBJ) $(ADDLARCHIVEOBJS)
322 $(RANLIB) $@
323
324 shared: libpcap.$(DYEXT)
325
326 libpcap.so: $(OBJ)
327 @rm -f $@
328 VER=`cat $(srcdir)/VERSION`; \
329 MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
330 @V_SHLIB_CMD@ @V_SHLIB_OPT@ @V_SONAME_OPT@$@.$$MAJOR_VER $(LDFLAGS) \
331 -o $@.$$VER $(OBJ) $(ADDLOBJS) $(LIBS)
332
333 #
334 # The following rule succeeds, but the result is untested.
335 #
336 # In Mac OS X, the libpcap dylib has the name "libpcap.A.dylib", with
337 # its full path as the install_name, and with the compatibility and
338 # current version both set to 1. The compatibility version is set to
339 # 1 so that programs built with a newer version of the library will run
340 # against older versions; multi-platform software probably will fail if
341 # it uses APIs added in the newer version, but Mac OS X-specific software
342 # will use weak linking and check at run time whether those APIs are
343 # available.
344 #
345 # We also use "A" as the major version, and 1 as the compatibility version,
346 # but set the current version to the value in VERSION, with any non-numeric
347 # stuff stripped off (the compatibility and current version must be of the
348 # form X[.Y[.Z]], with Y and Z possibly absent, and with all components
349 # numeric).
350 #
351 libpcap.dylib: $(OBJ)
352 rm -f libpcap*.dylib
353 VER=`cat $(srcdir)/VERSION`; \
354 MAJOR_VER=A; \
355 COMPAT_VER=1; \
356 CURRENT_VER=`sed 's/[^0-9.].*$$//' $(srcdir)/VERSION`; \
357 $(CC) -dynamiclib -undefined error $(LDFLAGS) \
358 -o libpcap.$$VER.dylib $(OBJ) $(ADDLOBJS) $(LIBS) \
359 -install_name $(libdir)/libpcap.$$MAJOR_VER.dylib \
360 -compatibility_version $$COMPAT_VER \
361 -current_version $$CURRENT_VER
362
363 #
364 # The HP-UX linker manual says that the convention for a versioned library
365 # is libXXX.{number}, not libXXX.sl.{number}. That appears to be the case
366 # on at least one HP-UX 11.00 system; libXXX.sl is a symlink to
367 # libXXX.{number}.
368 #
369 # The manual also says "library-level versioning" (think "sonames") was
370 # added in HP-UX 10.0.
371 #
372 # XXX - this assumes we're using the HP linker, rather than the GNU
373 # linker, even with GCC.
374 #
375 libpcap.sl: $(OBJ)
376 @MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
377 rm -f libpcap.$$MAJOR_VER
378 MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
379 ld -b $(LDFLAGS) -o libpcap.$$MAJOR_VER +h libpcap.$$MAJOR_VER \
380 $(OBJ) $(ADDLOBJS) $(LIBS)
381
382 #
383 # AIX is different from everybody else. A shared library is an archive
384 # library with one or more shared-object components. We still build a
385 # normal static archive library on AIX, for the benefit of the traditional
386 # scheme of building libpcap and tcpdump in subdirectories of the
387 # same directory, with tcpdump statically linked with the libpcap
388 # in question, but we also build a shared library as "libpcap.shareda"
389 # and install *it*, rather than the static library, as "libpcap.a".
390 #
391 libpcap.shareda: $(OBJ)
392 @rm -f $@ shr.o
393 $(CC) @V_SHLIB_OPT@ -o shr.o $(OBJ) $(ADDLOBJS) $(LIBS)
394 ar rc $@ shr.o
395
396 #
397 # For platforms that don't support shared libraries (or on which we
398 # don't support shared libraries).
399 #
400 libpcap.none:
401
402 scanner.c: $(srcdir)/scanner.l
403 @rm -f $@
404 $(srcdir)/runlex.sh $(LEX) -o$@ $<
405
406 scanner.o: scanner.c tokdefs.h
407 $(CC) $(CFLAGS) -c scanner.c
408
409 pcap.o: version.h
410
411 tokdefs.h: grammar.c
412 grammar.c: $(srcdir)/grammar.y
413 @rm -f grammar.c tokdefs.h
414 $(YACC) -d $<
415 mv y.tab.c grammar.c
416 mv y.tab.h tokdefs.h
417
418 grammar.o: grammar.c
419 @rm -f $@
420 $(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c
421
422 version.o: version.c
423 $(CC) $(CFLAGS) -c version.c
424
425 snprintf.o: $(srcdir)/missing/snprintf.c
426 $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
427
428 version.c: $(srcdir)/VERSION
429 @rm -f $@
430 sed -e 's/.*/char pcap_version[] = "&";/' $(srcdir)/VERSION > $@
431
432 #
433 # NOTE: this really is supposed to be static; importing a string
434 # from a shared library does not work very well on many
435 # versions of UNIX (Solaris, Linux, and the BSDs, for example),
436 # so we make the version string static and return it from
437 # a function, which does work.
438 #
439 version.h: $(srcdir)/VERSION
440 @rm -f $@
441 sed -e 's/.*/static const char pcap_version_string[] = "libpcap version &";/' $(srcdir)/VERSION > $@
442
443 bpf_filter.c: $(srcdir)/bpf/net/bpf_filter.c
444 rm -f bpf_filter.c
445 ln -s $(srcdir)/bpf/net/bpf_filter.c bpf_filter.c
446
447 bpf_filter.o: bpf_filter.c
448 $(CC) $(CFLAGS) -c bpf_filter.c
449
450 #
451 # Generate the pcap-config script.
452 #
453 pcap-config: $(srcdir)/pcap-config.in
454 @rm -f $@ $@.tmp
455 sed -e 's|@includedir[@]|$(includedir)|g' \
456 -e 's|@libdir[@]|$(libdir)|g' \
457 -e 's|@LIBS[@]|$(LIBS)|g' \
458 -e 's|@V_RPATH_OPT[@]|$(V_RPATH_OPT)|g' \
459 $(srcdir)/pcap-config.in >$@.tmp
460 mv $@.tmp $@
461 chmod a+x $@
462
463 #
464 # Test programs - not built by default, and not installed.
465 #
466 filtertest: filtertest.c libpcap.a
467 $(CC) $(CFLAGS) -I. -L. -o filtertest filtertest.c libpcap.a $(LIBS)
468
469 findalldevstest: findalldevstest.c libpcap.a
470 $(CC) $(CFLAGS) -I. -L. -o findalldevstest findalldevstest.c libpcap.a $(LIBS)
471
472 selpolltest: selpolltest.c libpcap.a
473 $(CC) $(CFLAGS) -I. -L. -o selpolltest selpolltest.c libpcap.a $(LIBS)
474
475 opentest: opentest.c libpcap.a
476 $(CC) $(CFLAGS) -I. -L. -o opentest opentest.c libpcap.a $(LIBS)
477
478 install: install-shared install-archive pcap-config
479 [ -d $(DESTDIR)$(libdir) ] || \
480 (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
481 [ -d $(DESTDIR)$(includedir) ] || \
482 (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir))
483 [ -d $(DESTDIR)$(includedir)/pcap ] || \
484 (mkdir -p $(DESTDIR)$(includedir)/pcap; chmod 755 $(DESTDIR)$(includedir)/pcap)
485 [ -d $(DESTDIR)$(mandir)/man1 ] || \
486 (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1)
487 [ -d $(DESTDIR)$(mandir)/man3 ] || \
488 (mkdir -p $(DESTDIR)$(mandir)/man3; chmod 755 $(DESTDIR)$(mandir)/man3)
489 [ -d $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@ ] || \
490 (mkdir -p $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@)
491 [ -d $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@ ] || \
492 (mkdir -p $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@)
493 for i in $(PUBHDR); do \
494 $(INSTALL_DATA) $(srcdir)/$$i \
495 $(DESTDIR)$(includedir)/$$i; done
496 [ -d $(DESTDIR)$(bindir) ] || \
497 (mkdir -p $(DESTDIR)$(bindir); chmod 755 $(DESTDIR)$(bindir))
498 $(INSTALL_PROGRAM) pcap-config $(DESTDIR)$(bindir)/pcap-config
499 for i in $(MAN1); do \
500 $(INSTALL_DATA) $(srcdir)/$$i \
501 $(DESTDIR)$(mandir)/man1/$$i; done
502 for i in $(MAN3PCAP_NOEXPAND); do \
503 $(INSTALL_DATA) $(srcdir)/$$i \
504 $(DESTDIR)$(mandir)/man3/$$i; done
505 for i in $(MAN3PCAP_EXPAND:.in=); do \
506 $(INSTALL_DATA) $$i \
507 $(DESTDIR)$(mandir)/man3/$$i; done
508 rm -f $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap
509 ln $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_name.3pcap \
510 $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap
511 rm -f $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
512 ln $(DESTDIR)$(mandir)/man3/pcap_dump_open.3pcap \
513 $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
514 rm -f $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
515 ln $(DESTDIR)$(mandir)/man3/pcap_geterr.3pcap \
516 $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
517 rm -f $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
518 ln $(DESTDIR)$(mandir)/man3/pcap_inject.3pcap \
519 $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
520 rm -f $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
521 ln $(DESTDIR)$(mandir)/man3/pcap_loop.3pcap \
522 $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
523 rm -f $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap
524 ln $(DESTDIR)$(mandir)/man3/pcap_major_version.3pcap \
525 $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap
526 rm -f $(DESTDIR)$(mandir)/man3/pcap_next.3pcap
527 ln $(DESTDIR)$(mandir)/man3/pcap_next_ex.3pcap \
528 $(DESTDIR)$(mandir)/man3/pcap_next.3pcap
529 rm -f $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap
530 ln $(DESTDIR)$(mandir)/man3/pcap_open_offline.3pcap \
531 $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap
532 rm -f $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap
533 ln $(DESTDIR)$(mandir)/man3/pcap_setnonblock.3pcap \
534 $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap
535 for i in $(MANFILE); do \
536 $(INSTALL_DATA) `echo $$i | sed 's/.manfile.in/.manfile/'` \
537 $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
538 for i in $(MANMISC); do \
539 $(INSTALL_DATA) `echo $$i | sed 's/.manmisc.in/.manmisc/'` \
540 $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
541
542 install-shared: install-shared-$(DYEXT)
543 install-shared-so: libpcap.so
544 [ -d $(DESTDIR)$(libdir) ] || \
545 (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
546 VER=`cat $(srcdir)/VERSION`; \
547 MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
548 $(INSTALL_PROGRAM) libpcap.so.$$VER $(DESTDIR)$(libdir)/libpcap.so.$$VER; \
549 ln -sf libpcap.so.$$VER $(DESTDIR)$(libdir)/libpcap.so.$$MAJOR_VER; \
550 ln -sf libpcap.so.$$MAJOR_VER $(DESTDIR)$(libdir)/libpcap.so
551 install-shared-dylib: libpcap.dylib
552 [ -d $(DESTDIR)$(libdir) ] || \
553 (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
554 VER=`cat $(srcdir)/VERSION`; \
555 MAJOR_VER=A; \
556 $(INSTALL_PROGRAM) libpcap.$$VER.dylib $(DESTDIR)$(libdir)/libpcap.$$VER.dylib; \
557 ln -sf libpcap.$$VER.dylib $(DESTDIR)$(libdir)/libpcap.$$MAJOR_VER.dylib; \
558 ln -sf libpcap.$$MAJOR_VER.dylib $(DESTDIR)$(libdir)/libpcap.dylib
559 install-shared-sl: libpcap.sl
560 [ -d $(DESTDIR)$(libdir) ] || \
561 (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
562 MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
563 $(INSTALL_PROGRAM) libpcap.$$MAJOR_VER $(DESTDIR)$(libdir)
564 ln -sf libpcap.$$MAJOR_VER $(DESTDIR)$(libdir)/libpcap.sl
565 install-shared-shareda: libpcap.shareda
566 #
567 # AIX shared libraries are weird. They're archive libraries
568 # with one or more shared object components.
569 #
570 [ -d $(DESTDIR)$(libdir) ] || \
571 (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
572 $(INSTALL_PROGRAM) libpcap.shareda $(DESTDIR)$(libdir)/libpcap.a
573 install-shared-none:
574
575 install-archive: install-archive-$(DYEXT)
576 install-archive-so install-archive-dylib install-archive-sl install-archive-none: libpcap.a
577 #
578 # Most platforms have separate suffixes for shared and
579 # archive libraries, so we install both.
580 #
581 [ -d $(DESTDIR)$(libdir) ] || \
582 (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
583 $(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
584 $(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
585 install-archive-shareda:
586 #
587 # AIX, however, doesn't, so we don't install the archive
588 # library on AIX.
589 #
590
591 uninstall: uninstall-shared
592 rm -f $(DESTDIR)$(libdir)/libpcap.a
593 for i in $(PUBHDR); do \
594 rm -f $(DESTDIR)$(includedir)/$$i; done
595 -rmdir $(DESTDIR)$(includedir)/pcap
596 rm -f $(DESTDIR)/$(bindir)/pcap-config
597 for i in $(MAN1); do \
598 rm -f $(DESTDIR)$(mandir)/man1/$$i; done
599 for i in $(MAN3PCAP); do \
600 rm -f $(DESTDIR)$(mandir)/man3/$$i; done
601 rm -f $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap
602 rm -f $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
603 rm -f $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
604 rm -f $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
605 rm -f $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
606 rm -f $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap
607 rm -f $(DESTDIR)$(mandir)/man3/pcap_next.3pcap
608 rm -f $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap
609 rm -f $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap
610 for i in $(MANFILE); do \
611 rm -f $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
612 for i in $(MANMISC); do \
613 rm -f $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
614
615 uninstall-shared: uninstall-shared-$(DYEXT)
616 uninstall-shared-so:
617 VER=`cat $(srcdir)/VERSION`; \
618 MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
619 rm -f $(DESTDIR)$(libdir)/libpcap.so.$$VER; \
620 rm -f $(DESTDIR)$(libdir)/libpcap.so.$$MAJOR_VER; \
621 rm -f $(DESTDIR)$(libdir)/libpcap.so
622 uninstall-shared-dylib:
623 VER=`cat $(srcdir)/VERSION`; \
624 MAJOR_VER=A; \
625 rm -f $(DESTDIR)$(libdir)/libpcap.$$VER.dylib; \
626 rm -f $(DESTDIR)$(libdir)/libpcap.$$MAJOR_VER.dylib; \
627 rm -f $(DESTDIR)$(libdir)/libpcap.dylib
628 uninstall-shared-sl:
629 MAJOR_VER=`sed 's/\([0-9][0-9]*\)\..*/\1/' $(srcdir)/VERSION`; \
630 rm -f $(DESTDIR)$(libdir)/libpcap.$$MAJOR_VER; \
631 rm -f $(DESTDIR)$(libdir)/libpcap.sl
632 uninstall-shared-shareda:
633 rm -f $(DESTDIR)$(libdir)/libpcap.a
634 uninstall-shared-none:
635
636 clean:
637 rm -f $(CLEANFILES)
638
639 distclean: clean
640 rm -f Makefile config.cache config.log config.status \
641 config.h gnuc.h os-proto.h bpf_filter.c pcap-config \
642 stamp-h stamp-h.in
643 rm -f $(MAN3PCAP_EXPAND:.in=) $(MANFILE:.in=) $(MANMISC:.in=)
644 rm -rf autom4te.cache
645
646 tags: $(TAGFILES)
647 ctags -wtd $(TAGFILES)
648
649 packaging/pcap.spec: packaging/pcap.spec.in VERSION
650 RPMVERSION=`cat VERSION | sed s/-.*//g`; \
651 sed -e s/@VERSION@/$$RPMVERSION/ -e s/@NAME@/libpcap-`cat VERSION`/ $< > $@
652
653 releasetar:
654 @cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \
655 mkdir $$name; \
656 tar cf - $(CSRC) $(HDR) $(MAN1) $(MAN3PCAP_EXPAND) \
657 $(MAN3PCAP_NOEXPAND) $(MANFILE) $(MANMISC) $(EXTRA_DIST) | \
658 (cd $$name; tar xf -); \
659 tar -c -z -f $$name.tar.gz $$name; \
660 rm -rf $$name
661
662 depend: $(GENSRC) $(GENHDR) bpf_filter.c
663 ./mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)
664
665 Makefile: Makefile.in config.status
666 ./config.status
667 @echo your Makefile was out of date, now run $(MAKE) again
668 exit 1