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