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