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