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