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