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