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