1 # Copyright (c) 1993, 1994, 1995, 1996
2 # The Regents of the University of California. All rights reserved.
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
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.
20 # @(#) $Header: /tcpdump/master/libpcap/Makefile.in,v 1.124 2008-05-28 02:14:10 guy Exp $ (LBL)
23 # Various configurable paths (remember to edit Makefile.in, not Makefile)
28 exec_prefix = @
exec_prefix@
29 datarootdir
= @datarootdir@
30 # Pathname of directory to install the include files
31 includedir = @
includedir@
32 # Pathname of directory to install the library
34 # Pathname of directory to install the man page
42 # You shouldn't need to edit anything below.
48 DEFS
= @DEFS@ @V_DEFS@
55 CFLAGS
= $(CCOPT
) $(INCLS
) $(DEFS
)
58 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
59 INSTALL_DATA
= @INSTALL_DATA@
63 # Flex and bison allow you to specify the prefixes of the global symbols
64 # used by the generated parser. This allows programs to use lex/yacc
65 # and link against libpcap. If you don't have flex or bison, get them.
70 # Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
71 # Also, gcc does not remove the .o before forking 'as', which can be a
72 # problem if you don't own the file but can write to the directory.
75 $(CC
) $(CFLAGS
) -c
$(srcdir)/$*.c
77 PSRC
= pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@
78 FSRC
= fad-@V_FINDALLDEVS@.c
80 CSRC
= pcap.c inet.c gencode.c optimize.c nametoaddr.c \
81 etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c
82 GENSRC
= scanner.c grammar.c version.c
85 SRC
= $(PSRC
) $(FSRC
) $(CSRC
) $(SSRC
) $(GENSRC
)
87 # We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
88 # hack the extra indirection
89 OBJ
= $(PSRC
:.c
=.o
) $(FSRC
:.c
=.o
) $(CSRC
:.c
=.o
) $(SSRC
:.c
=.o
) $(GENSRC
:.c
=.o
) $(LIBOBJS
)
113 scanner.h tokdefs.h version.h
119 $(SRC
) $(HDR
) $(TAGHDR
)
121 CLEANFILES
= $(OBJ
) libpcap.a
$(GENSRC
) $(GENHDR
) lex.yy.c
123 MAN3PCAP
= pcap
.3pcap \
124 pcap_activate
.3pcap \
125 pcap_breakloop
.3pcap \
126 pcap_can_set_rfmon
.3pcap \
130 pcap_datalink
.3pcap \
131 pcap_datalink_name_to_val
.3pcap \
132 pcap_datalink_val_to_name
.3pcap \
134 pcap_dump_close
.3pcap \
135 pcap_dump_file
.3pcap \
136 pcap_dump_flush
.3pcap \
137 pcap_dump_ftell
.3pcap \
138 pcap_dump_open
.3pcap \
141 pcap_findalldevs
.3pcap \
142 pcap_freealldevs
.3pcap \
143 pcap_freecode
.3pcap \
144 pcap_free_datalinks
.3pcap \
145 pcap_get_selectable_fd
.3pcap \
148 pcap_is_swapped
.3pcap \
149 pcap_lib_version
.3pcap \
150 pcap_list_datalinks
.3pcap \
151 pcap_lookupdev
.3pcap \
152 pcap_lookupnet
.3pcap \
154 pcap_major_version
.3pcap \
156 pcap_offline_filter
.3pcap \
157 pcap_open_dead
.3pcap \
158 pcap_open_live
.3pcap \
159 pcap_open_offline
.3pcap \
160 pcap_set_buffer_size
.3pcap \
161 pcap_set_datalink
.3pcap \
162 pcap_set_promisc
.3pcap \
163 pcap_set_rfmon
.3pcap \
164 pcap_set_snaplen
.3pcap \
165 pcap_set_timeout
.3pcap \
166 pcap_setdirection
.3pcap \
167 pcap_setfilter
.3pcap \
168 pcap_setnonblock
.3pcap \
169 pcap_snapshot
.3pcap \
171 pcap_statustostr
.3pcap \
174 MAN4
= pcap-filter
.4 \
180 ChmodBPF
/StartupParameters.plist \
195 SUNOS4
/nit_if.o.sparc \
196 SUNOS4
/nit_if.o.sun3 \
197 SUNOS4
/nit_if.o.sun4c
.4.0.3c \
201 bpf
/net
/bpf_filter.c \
243 org.tcpdump.chmod_bpf.plist \
244 packaging
/pcap.spec \
245 packaging
/pcap.spec.in \
275 Win32
/Include
/Gnuc.h \
276 Win32
/Include
/addrinfo.h \
277 Win32
/Include
/bittypes.h \
278 Win32
/Include
/cdecl_ext.h \
279 Win32
/Include
/inetprivate.h \
280 Win32
/Include
/ip6_misc.h \
281 Win32
/Include
/sockstorage.h \
282 Win32
/Include
/arpa
/nameser.h \
283 Win32
/Include
/net
/if.h \
284 Win32
/Include
/net
/netdb.h \
285 Win32
/Include
/net
/paths.h \
286 Win32
/Prj
/libpcap.dsp \
287 Win32
/Prj
/libpcap.dsw \
289 Win32
/Src
/gai_strerror.c \
290 Win32
/Src
/getaddrinfo.c \
291 Win32
/Src
/getnetbynm.c \
292 Win32
/Src
/getnetent.c \
294 Win32
/Src
/getservent.c \
295 Win32
/Src
/inet_aton.c \
296 Win32
/Src
/inet_net.c \
297 Win32
/Src
/inet_pton.c
303 $(AR
) rc
$@
$(OBJ
) $(LIBS
)
306 shared
: libpcap.
$(DYEXT
)
309 # XXX - this works with GNU ld, but won't necessarily work with native
310 # ld on, for example, various SVR4-flavored platforms, or Digital UNIX.
314 $(CC
) -shared
-o
$@.
`cat VERSION` $(OBJ
) $(DAGLIBS
)
316 # the following rule succeeds, but the result is untested.
317 libpcap.dylib
: $(OBJ
)
319 $(CC
) -dynamiclib
-undefined error
-o libpcap.
`cat VERSION`.dylib
$(OBJ
) \
320 -install_name
$(libdir)/libpcap
.0.dylib
-compatibility_version
`cat VERSION` \
321 -current_version
`cat VERSION`
323 scanner.c
: $(srcdir)/scanner.l
325 .
/runlex.sh
$(LEX
) -o
$@
$<
327 scanner.o
: scanner.c tokdefs.h
328 $(CC
) $(CFLAGS
) -c scanner.c
333 grammar.c
: $(srcdir)/grammar.y
334 @
rm -f grammar.c tokdefs.h
341 $(CC
) $(CFLAGS
) -Dyylval
=pcap_lval
-c grammar.c
344 $(CC
) $(CFLAGS
) -c version.c
346 snprintf.o
: $(srcdir)/missing
/snprintf.c
347 $(CC
) $(CFLAGS
) -o
$@
-c
$(srcdir)/missing
/snprintf.c
349 version.c
: $(srcdir)/VERSION
351 sed
-e
's/.*/char pcap_version[] = "&";/' $(srcdir)/VERSION
> $@
354 # NOTE: this really is supposed to be static; importing a string
355 # from a shared library does not work very well on many
356 # versions of UNIX (Solaris, Linux, and the BSDs, for example),
357 # so we make the version string static and return it from
358 # a function, which does work.
360 version.h
: $(srcdir)/VERSION
362 sed
-e
's/.*/static const char pcap_version_string[] = "libpcap version &";/' $(srcdir)/VERSION
> $@
364 bpf_filter.c
: $(srcdir)/bpf
/net
/bpf_filter.c
366 ln
-s
$(srcdir)/bpf
/net
/bpf_filter.c bpf_filter.c
368 bpf_filter.o
: bpf_filter.c
369 $(CC
) $(CFLAGS
) -c bpf_filter.c
372 # Test programs - not built by default, and not installed.
374 filtertest
: filtertest.c libpcap.a
375 $(CC
) $(CFLAGS
) -I.
-L.
-o filtertest filtertest.c libpcap.a
377 findalldevstest
: findalldevstest.c libpcap.a
378 $(CC
) $(CFLAGS
) -I.
-L.
-o findalldevstest findalldevstest.c libpcap.a
381 [ -d
$(DESTDIR
)$(libdir) ] || \
382 (mkdir
-p
$(DESTDIR
)$(libdir); chmod
755 $(DESTDIR
)$(libdir))
383 $(INSTALL_DATA
) libpcap.a
$(DESTDIR
)$(libdir)/libpcap.a
384 $(RANLIB
) $(DESTDIR
)$(libdir)/libpcap.a
385 [ -d
$(DESTDIR
)$(includedir) ] || \
386 (mkdir
-p
$(DESTDIR
)$(includedir); chmod
755 $(DESTDIR
)$(includedir))
387 [ -d
$(DESTDIR
)$(includedir)/pcap
] || \
388 (mkdir
-p
$(DESTDIR
)$(includedir)/pcap
; chmod
755 $(DESTDIR
)$(includedir)/pcap
)
389 [ -d
$(DESTDIR
)$(mandir)/man3
] || \
390 (mkdir
-p
$(DESTDIR
)$(mandir)/man3
; chmod
755 $(DESTDIR
)$(mandir)/man3
)
391 [ -d
$(DESTDIR
)$(mandir)/man4
] || \
392 (mkdir
-p
$(DESTDIR
)$(mandir)/man4
; chmod
755 $(DESTDIR
)$(mandir)/man4
)
393 $(INSTALL_DATA
) $(srcdir)/pcap
/pcap.h \
394 $(DESTDIR
)$(includedir)/pcap
/pcap.h
395 $(INSTALL_DATA
) $(srcdir)/pcap
/bpf.h \
396 $(DESTDIR
)$(includedir)/pcap
/bpf.h
397 $(INSTALL_DATA
) $(srcdir)/pcap
/namedb.h \
398 $(DESTDIR
)$(includedir)/pcap
/namedb.h
399 $(INSTALL_DATA
) $(srcdir)/pcap
/sll.h \
400 $(DESTDIR
)$(includedir)/pcap
/sll.h
401 $(INSTALL_DATA
) $(srcdir)/pcap
/usb.h \
402 $(DESTDIR
)$(includedir)/pcap
/usb.h
403 $(INSTALL_DATA
) $(srcdir)/pcap.h
$(DESTDIR
)$(includedir)/pcap.h
404 $(INSTALL_DATA
) $(srcdir)/pcap-bpf.h \
405 $(DESTDIR
)$(includedir)/pcap-bpf.h
406 $(INSTALL_DATA
) $(srcdir)/pcap-namedb.h \
407 $(DESTDIR
)$(includedir)/pcap-namedb.h
408 for i in
$(MAN3PCAP
); do \
409 $(INSTALL_DATA
) $(srcdir)/$$i \
410 $(DESTDIR
)$(mandir)/man3
/$$i; done
411 ln
$(DESTDIR
)$(mandir)/man3
/pcap_datalink_val_to_name
.3pcap \
412 $(DESTDIR
)$(mandir)/man3
/pcap_datalink_val_to_description
.3pcap
413 ln
$(DESTDIR
)$(mandir)/man3
/pcap_dump_open
.3pcap \
414 $(DESTDIR
)$(mandir)/man3
/pcap_dump_fopen
.3pcap
415 ln
$(DESTDIR
)$(mandir)/man3
/pcap_geterr
.3pcap \
416 $(DESTDIR
)$(mandir)/man3
/pcap_perror
.3pcap
417 ln
$(DESTDIR
)$(mandir)/man3
/pcap_inject
.3pcap \
418 $(DESTDIR
)$(mandir)/man3
/pcap_sendpacket
.3pcap
419 ln
$(DESTDIR
)$(mandir)/man3
/pcap_loop
.3pcap \
420 $(DESTDIR
)$(mandir)/man3
/pcap_dispatch
.3pcap
421 ln
$(DESTDIR
)$(mandir)/man3
/pcap_major_version
.3pcap \
422 $(DESTDIR
)$(mandir)/man3
/pcap_minor_version
.3pcap
423 ln
$(DESTDIR
)$(mandir)/man3
/pcap_next_ex
.3pcap \
424 $(DESTDIR
)$(mandir)/man3
/pcap_next
.3pcap
425 ln
$(DESTDIR
)$(mandir)/man3
/pcap_open_offline
.3pcap \
426 $(DESTDIR
)$(mandir)/man3
/pcap_fopen_offline
.3pcap
427 ln
$(DESTDIR
)$(mandir)/man3
/pcap_setnonblock
.3pcap \
428 $(DESTDIR
)$(mandir)/man3
/pcap_getnonblock
.3pcap
429 for i in
$(MAN4
); do \
430 $(INSTALL_DATA
) $(srcdir)/$$i \
431 $(DESTDIR
)$(mandir)/man4
/$$i; done
433 install-shared
: install-shared-
$(DYEXT
)
434 install-shared-so
: libpcap.so
435 $(INSTALL_PROGRAM
) libpcap.so.
`cat VERSION` $(DESTDIR
)$(libdir)/libpcap.so.
`cat VERSION`
436 install-shared-dylib
: libpcap.dylib
437 $(INSTALL_PROGRAM
) libpcap.
`cat VERSION`.dylib
$(DESTDIR
)$(libdir)/libpcap.
`cat VERSION`.dylib
438 VER
=`cat VERSION`; cd
$(DESTDIR
)$(libdir) && ln
-sf libpcap.
$$VER.dylib libpcap
.0.dylib
; ln
-sf libpcap
.0.dylib libpcap.dylib
441 rm -f
$(DESTDIR
)$(libdir)/libpcap.a
442 rm -f
$(DESTDIR
)$(includedir)/pcap
/pcap.h
443 rm -f
$(DESTDIR
)$(includedir)/pcap
/bpf.h
444 rm -f
$(DESTDIR
)$(includedir)/pcap
/namedb.h
445 rm -f
$(DESTDIR
)$(includedir)/pcap
/sll.h
446 rm -f
$(DESTDIR
)$(includedir)/pcap
/usb.h
447 -rmdir
$(DESTDIR
)$(includedir)/pcap
448 rm -f
$(DESTDIR
)$(includedir)/pcap.h
449 rm -f
$(DESTDIR
)$(includedir)/pcap-bpf.h
450 rm -f
$(DESTDIR
)$(includedir)/pcap-namedb.h
451 for i in
$(MAN3PCAP
); do \
452 rm -f
$(DESTDIR
)$(mandir)/man3
/$$i; done
453 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_datalink_val_to_description
.3pcap
454 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_dump_fopen
.3pcap
455 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_perror
.3pcap
456 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_sendpacket
.3pcap
457 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_dispatch
.3pcap
458 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_minor_version
.3pcap
459 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_next
.3pcap
460 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_fopen_offline
.3pcap
461 rm -f
$(DESTDIR
)$(mandir)/man3
/pcap_getnonblock
.3pcap
462 for i in
$(MAN4
); do \
463 rm -f
$(DESTDIR
)$(mandir)/man4
/$$i; done
466 rm -f
$(CLEANFILES
) libpcap
*.dylib libpcap.so
*
469 rm -f Makefile config.cache config.log config.status \
470 config.h gnuc.h os-proto.h bpf_filter.c stamp-h stamp-h.in
471 rm -rf autom4te.cache
474 ctags
-wtd
$(TAGFILES
)
476 packaging
/pcap.spec
: packaging
/pcap.spec.in VERSION
477 RPMVERSION
=`cat VERSION | sed s/-.*//g`; \
478 sed
-e s
/@VERSION@
/$$RPMVERSION/ -e s
/@NAME@
/libpcap-
`cat VERSION`/ $< > $@
481 @cwd
=`pwd` ; dir=`basename $$cwd` ; name
=$(PROG
)-`cat VERSION` ; \
483 tar cf
- $(CSRC
) $(HDR
) $(MAN3PCAP
) $(MAN4
) $(EXTRA_DIST
) |
(cd
$$name; tar xf
-); \
484 tar -c
-z
-f
$$name.
tar.gz
$$name; \
487 depend
: $(GENSRC
) $(GENHDR
) bpf_filter.c
488 .
/mkdep
-c
$(CC
) $(DEFS
) $(INCLS
) $(SRC
)
490 Makefile
: Makefile.in config.status
492 @echo your Makefile was out of date
, now run
$(MAKE
) again