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