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