Makefile.in revision 190225
155714Skris#  Copyright (c) 1993, 1994, 1995, 1996
255714Skris# 	The Regents of the University of California.  All rights reserved.
355714Skris#
455714Skris#  Redistribution and use in source and binary forms, with or without
555714Skris#  modification, are permitted provided that: (1) source code distributions
655714Skris#  retain the above copyright notice and this paragraph in its entirety, (2)
755714Skris#  distributions including binary code include the above copyright notice and
855714Skris#  this paragraph in its entirety in the documentation or other materials
955714Skris#  provided with the distribution, and (3) all advertising materials mentioning
1055714Skris#  features or use of this software display the following acknowledgement:
1155714Skris#  ``This product includes software developed by the University of California,
1255714Skris#  Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
1355714Skris#  the University nor the names of its contributors may be used to endorse
1455714Skris#  or promote products derived from this software without specific prior
1555714Skris#  written permission.
1655714Skris#  THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
1755714Skris#  WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
1855714Skris#  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1955714Skris#
2055714Skris# @(#) $Header: /tcpdump/master/libpcap/Makefile.in,v 1.108.2.28 2008-10-23 22:13:21 guy Exp $ (LBL)
2155714Skris
2255714Skris#
2355714Skris# Various configurable paths (remember to edit Makefile.in, not Makefile)
2455714Skris#
2555714Skris
2655714Skris# Top level hierarchy
2755714Skrisprefix = @prefix@
2855714Skrisexec_prefix = @exec_prefix@
2955714Skrisdatarootdir = @datarootdir@
3055714Skris# Pathname of directory to install the configure program
3155714Skrisbindir = @bindir@
3255714Skris# Pathname of directory to install the include files
3355714Skrisincludedir = @includedir@
3455714Skris# Pathname of directory to install the library
3555714Skrislibdir =  @libdir@
3655714Skris# Pathname of directory to install the man pages
3755714Skrismandir = @mandir@
3855714Skris
3955714Skris# VPATH
4055714Skrissrcdir = @srcdir@
4155714SkrisVPATH = @srcdir@
4255714Skris
4355714Skris#
4455714Skris# You shouldn't need to edit anything below.
4555714Skris#
4655714Skris
4755714SkrisCC = @CC@
4855714SkrisCCOPT = @V_CCOPT@
4955714SkrisINCLS = -I. @V_INCLS@
5055714SkrisDEFS = @DEFS@ @V_DEFS@
5155714SkrisLIBS = @V_LIBS@
5255714SkrisDAGLIBS = @DAGLIBS@
5355714SkrisDEPLIBS = @DEPLIBS@
5455714SkrisDYEXT = @DYEXT@
5555714SkrisPROG=libpcap
5655714Skris
5755714Skris# Standard CFLAGS
5855714SkrisCFLAGS = $(CCOPT) $(INCLS) $(DEFS)
5955714Skris
6055714SkrisINSTALL = @INSTALL@
6155714SkrisINSTALL_PROGRAM = @INSTALL_PROGRAM@
6255714SkrisINSTALL_DATA = @INSTALL_DATA@
6355714SkrisRANLIB = @RANLIB@
6455714Skris
65160814Ssimon#
6655714Skris# Flex and bison allow you to specify the prefixes of the global symbols
6755714Skris# used by the generated parser.  This allows programs to use lex/yacc
6855714Skris# and link against libpcap.  If you don't have flex or bison, get them.
6968651Skris#
7055714SkrisLEX = @V_LEX@
71160814SsimonYACC = @V_YACC@
72160814Ssimon
7368651Skris# Explicitly define compilation rule since SunOS 4's make doesn't like gcc.
74160814Ssimon# Also, gcc does not remove the .o before forking 'as', which can be a
7568651Skris# problem if you don't own the file but can write to the directory.
7655714Skris.c.o:
77160814Ssimon	@rm -f $@
78160814Ssimon	$(CC) $(CFLAGS) -c $(srcdir)/$*.c
7968651Skris
8068651SkrisPSRC =	pcap-@V_PCAP@.c @USB_SRC@ @BT_SRC@
8168651SkrisFSRC =  fad-@V_FINDALLDEVS@.c
82160814SsimonSSRC =  @SSRC@
8368651SkrisCSRC =	pcap.c inet.c gencode.c optimize.c nametoaddr.c \
8468651Skris	etherent.c savefile.c bpf_filter.c bpf_image.c bpf_dump.c
85160814SsimonGENSRC = scanner.c grammar.c version.c
86160814SsimonLIBOBJS = @LIBOBJS@
87160814Ssimon
8855714SkrisSRC =	$(PSRC) $(FSRC) $(CSRC) $(SSRC) $(GENSRC)
89160814Ssimon
90160814Ssimon# We would like to say "OBJ = $(SRC:.c=.o)" but Ultrix's make cannot
9155714Skris# hack the extra indirection
9255714SkrisOBJ =	$(PSRC:.c=.o) $(FSRC:.c=.o) $(CSRC:.c=.o) $(SSRC:.c=.o) $(GENSRC:.c=.o) $(LIBOBJS)
9368651SkrisHDR = \
9468651Skris	acconfig.h \
9568651Skris	arcnet.h \
9668651Skris	atmuni31.h \
9768651Skris	ethertype.h \
9868651Skris	gencode.h \
9968651Skris	ieee80211.h \
10068651Skris	llc.h \
101160814Ssimon	nlpid.h \
10268651Skris	pcap/bluetooth.h \
10368651Skris	pcap/bpf.h \
10468651Skris	pcap/namedb.h \
10568651Skris	pcap/pcap.h \
10668651Skris	pcap/sll.h \
10768651Skris	pcap/usb.h \
10868651Skris	pcap/vlan.h \
109127128Snectar	pcap.h \
110127128Snectar	pcap-int.h \
111127128Snectar	pcap-namedb.h \
11268651Skris	pcap-stdinc.h \
11368651Skris	ppp.h \
11468651Skris	sunatmpos.h
11568651Skris
116127128SnectarGENHDR = \
11768651Skris	scanner.h tokdefs.h version.h
11868651Skris
11968651SkrisTAGHDR = \
12068651Skris	pcap-bpf.h
121127128Snectar
122160814SsimonTAGFILES = \
123127128Snectar	$(SRC) $(HDR) $(TAGHDR)
12468651Skris
12568651SkrisCLEANFILES = $(OBJ) libpcap.a $(GENSRC) $(GENHDR) lex.yy.c
126127128Snectar
12768651SkrisMAN1 = pcap-config.1
12868651Skris
12968651SkrisMAN3PCAP_EXPAND = \
13068651Skris	pcap.3pcap.in \
13168651Skris	pcap_compile.3pcap.in \
13255714Skris	pcap_datalink.3pcap.in \
133127128Snectar	pcap_dump_open.3pcap.in \
134160814Ssimon	pcap_list_datalinks.3pcap.in \
13555714Skris	pcap_open_dead.3pcap.in \
136127128Snectar	pcap_open_offline.3pcap.in
137160814Ssimon
138160814SsimonMAN3PCAP_NOEXPAND = \
139160814Ssimon	pcap_activate.3pcap \
14055714Skris	pcap_breakloop.3pcap \
141127128Snectar	pcap_can_set_rfmon.3pcap \
14268651Skris	pcap_close.3pcap \
143127128Snectar	pcap_create.3pcap \
144160814Ssimon	pcap_datalink_name_to_val.3pcap \
145160814Ssimon	pcap_datalink_val_to_name.3pcap \
14668651Skris	pcap_dump.3pcap \
147160814Ssimon	pcap_dump_close.3pcap \
14868651Skris	pcap_dump_file.3pcap \
14955714Skris	pcap_dump_flush.3pcap \
150160814Ssimon	pcap_dump_ftell.3pcap \
15168651Skris	pcap_file.3pcap \
152127128Snectar	pcap_fileno.3pcap \
153160814Ssimon	pcap_findalldevs.3pcap \
154160814Ssimon	pcap_freealldevs.3pcap \
15568651Skris	pcap_freecode.3pcap \
15655714Skris	pcap_free_datalinks.3pcap \
15768651Skris	pcap_get_selectable_fd.3pcap \
15868651Skris	pcap_geterr.3pcap \
159160814Ssimon	pcap_inject.3pcap \
160160814Ssimon	pcap_is_swapped.3pcap \
161160814Ssimon	pcap_lib_version.3pcap \
162160814Ssimon	pcap_lookupdev.3pcap \
163160814Ssimon	pcap_lookupnet.3pcap \
164160814Ssimon	pcap_loop.3pcap \
165160814Ssimon	pcap_major_version.3pcap \
166160814Ssimon	pcap_next_ex.3pcap \
167160814Ssimon	pcap_offline_filter.3pcap \
168160814Ssimon	pcap_open_live.3pcap \
169160814Ssimon	pcap_set_buffer_size.3pcap \
170160814Ssimon	pcap_set_datalink.3pcap \
171160814Ssimon	pcap_set_promisc.3pcap \
172160814Ssimon	pcap_set_rfmon.3pcap \
173160814Ssimon	pcap_set_snaplen.3pcap \
174160814Ssimon	pcap_set_timeout.3pcap \
175160814Ssimon	pcap_setdirection.3pcap \
176160814Ssimon	pcap_setfilter.3pcap \
177160814Ssimon	pcap_setnonblock.3pcap \
178160814Ssimon	pcap_snapshot.3pcap \
179160814Ssimon	pcap_stats.3pcap \
180160814Ssimon	pcap_statustostr.3pcap \
181160814Ssimon	pcap_strerror.3pcap
182160814Ssimon
183160814SsimonMAN3PCAP = $(MAN3PCAP_NOEXPAND) $(MAN3PCAP_EXPAND:.in=)
184160814Ssimon
185160814SsimonMANFILE = \
186160814Ssimon	pcap-savefile.manfile.in
187160814Ssimon
188MANMISC = \
189	pcap-filter.manmisc.in \
190	pcap-linktype.manmisc.in
191
192EXTRA_DIST = \
193	CHANGES \
194	ChmodBPF/ChmodBPF \
195	ChmodBPF/StartupParameters.plist \
196	CREDITS \
197	INSTALL.txt \
198	LICENSE \
199	Makefile.in \
200	README \
201	README.aix \
202	README.dag \
203	README.hpux \
204	README.linux \
205	README.macosx \
206	README.septel \
207	README.sita \
208	README.tru64 \
209	README.Win32 \
210	SUNOS4/nit_if.o.sparc \
211	SUNOS4/nit_if.o.sun3 \
212	SUNOS4/nit_if.o.sun4c.4.0.3c \
213	TODO \
214	VERSION \
215	aclocal.m4 \
216	bpf/net/bpf_filter.c \
217	chmod_bpf \
218	config.guess \
219	config.h.in \
220	config.sub \
221	configure \
222	configure.in \
223	dlpisubs.c \
224	dlpisubs.h \
225	fad-getad.c \
226	fad-gifc.c \
227	fad-glifc.c \
228	fad-null.c \
229	fad-sita.c \
230	fad-win32.c \
231	filtertest.c \
232	findalldevstest.c \
233	grammar.y \
234	install-sh \
235	lbl/os-aix4.h \
236	lbl/os-hpux11.h \
237	lbl/os-osf4.h \
238	lbl/os-osf5.h \
239	lbl/os-solaris2.h \
240	lbl/os-sunos4.h \
241	lbl/os-ultrix4.h \
242	missing/snprintf.c \
243	mkdep \
244	msdos/bin2c.c \
245	msdos/common.dj \
246	msdos/makefile \
247	msdos/makefile.dj \
248	msdos/makefile.wc \
249	msdos/ndis2.c \
250	msdos/ndis2.h \
251	msdos/ndis_0.asm \
252	msdos/pkt_rx0.asm \
253	msdos/pkt_rx1.s \
254	msdos/pktdrvr.c \
255	msdos/pktdrvr.h \
256	msdos/readme.dos \
257	net/bpf_filter.c \
258	org.tcpdump.chmod_bpf.plist \
259	packaging/pcap.spec.in \
260	pcap-bpf.c \
261	pcap-bpf.h \
262	pcap-bt-linux.c \
263	pcap-bt-linux.h \
264	pcap-config.in \
265	pcap-dag.c \
266	pcap-dag.h \
267	pcap-dlpi.c \
268	pcap-dos.c \
269	pcap-dos.h \
270	pcap-enet.c \
271	pcap-int.h \
272	pcap-libdlpi.c \
273	pcap-linux.c \
274	pcap-namedb.h \
275	pcap-nit.c \
276	pcap-null.c \
277	pcap-pf.c \
278	pcap-septel.c \
279	pcap-septel.h \
280	pcap-sita.h \
281	pcap-sita.c \
282	pcap-sita.html \
283	pcap-snit.c \
284	pcap-snoop.c \
285	pcap-usb-linux.c \
286	pcap-usb-linux.h \
287	pcap-win32.c \
288	runlex.sh \
289	scanner.l \
290	Win32/Include/Gnuc.h \
291	Win32/Include/addrinfo.h \
292	Win32/Include/bittypes.h \
293	Win32/Include/cdecl_ext.h \
294	Win32/Include/inetprivate.h \
295	Win32/Include/ip6_misc.h \
296	Win32/Include/sockstorage.h \
297	Win32/Include/arpa/nameser.h \
298	Win32/Include/net/if.h \
299	Win32/Include/net/netdb.h \
300	Win32/Include/net/paths.h \
301	Win32/Prj/libpcap.dsp \
302	Win32/Prj/libpcap.dsw \
303	Win32/Src/ffs.c \
304	Win32/Src/gai_strerror.c \
305	Win32/Src/getaddrinfo.c \
306	Win32/Src/getnetbynm.c \
307	Win32/Src/getnetent.c \
308	Win32/Src/getopt.c \
309	Win32/Src/getservent.c \
310	Win32/Src/inet_aton.c \
311	Win32/Src/inet_net.c \
312	Win32/Src/inet_pton.c
313
314all: libpcap.a pcap-config
315
316libpcap.a: $(OBJ)
317	@rm -f $@
318	$(AR) rc $@ $(OBJ) $(LIBS)
319	$(RANLIB) $@
320
321shared: libpcap.$(DYEXT)
322
323#
324# XXX - this works with GNU ld, but won't necessarily work with native
325# ld on, for example, various SVR4-flavored platforms, or Digital UNIX.
326#
327libpcap.so: $(OBJ)
328	@rm -f $@
329	$(CC) -shared -Wl,-soname,$@.1 -o $@.`cat $(srcdir)/VERSION` $(OBJ) $(DAGLIBS)
330
331#
332# The following rule succeeds, but the result is untested.
333#
334# XXX - OS X installs the library as "libpcap.A.dylib", with that as the
335# install_name, and sets the current version to 1 as well.  VERSION
336# might contain a not-purely-numeric version number, but
337# -current_version requires a purely numeric version, so this won't
338# work with top-of-tree builds.
339#
340libpcap.dylib: $(OBJ)
341	rm -f libpcap*.dylib
342	$(CC) -dynamiclib -undefined error -o libpcap.`cat $(srcdir)/VERSION`.dylib $(OBJ) \
343		-install_name $(libdir)/libpcap.A.dylib \
344		-compatibility_version 1 \
345		-current_version `sed 's/[^0-9.].*$$//' $(srcdir)/VERSION`
346
347scanner.c: $(srcdir)/scanner.l
348	@rm -f $@
349	./runlex.sh $(LEX) -o$@ $<
350
351scanner.o: scanner.c tokdefs.h
352	$(CC) $(CFLAGS) -c scanner.c
353
354pcap.o: version.h
355
356tokdefs.h: grammar.c
357grammar.c: $(srcdir)/grammar.y
358	@rm -f grammar.c tokdefs.h
359	$(YACC) -d $<
360	mv y.tab.c grammar.c
361	mv y.tab.h tokdefs.h
362
363grammar.o: grammar.c
364	@rm -f $@
365	$(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c
366
367version.o: version.c
368	$(CC) $(CFLAGS) -c version.c
369
370snprintf.o: $(srcdir)/missing/snprintf.c
371	$(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c
372
373version.c: $(srcdir)/VERSION
374	@rm -f $@
375	sed -e 's/.*/char pcap_version[] = "&";/' $(srcdir)/VERSION > $@
376
377#
378# NOTE: this really is supposed to be static; importing a string
379# from a shared library does not work very well on many
380# versions of UNIX (Solaris, Linux, and the BSDs, for example),
381# so we make the version string static and return it from
382# a function, which does work.
383#
384version.h: $(srcdir)/VERSION
385	@rm -f $@
386	sed -e 's/.*/static const char pcap_version_string[] = "libpcap version &";/' $(srcdir)/VERSION > $@
387
388bpf_filter.c: $(srcdir)/bpf/net/bpf_filter.c
389	rm -f bpf_filter.c
390	ln -s $(srcdir)/bpf/net/bpf_filter.c bpf_filter.c
391
392bpf_filter.o: bpf_filter.c
393	$(CC) $(CFLAGS) -c bpf_filter.c
394
395#
396# Generate the pcap-config script.
397#
398pcap-config: pcap-config.in Makefile
399	@rm -f $@ $@.tmp
400	sed -e 's|@includedir[@]|$(includedir)|g' \
401	    -e 's|@libdir[@]|$(libdir)|g' \
402	    -e 's|@DEPLIBS[@]|$(DEPLIBS)|g' \
403	    pcap-config.in >$@.tmp
404	mv $@.tmp $@
405	chmod a+x $@
406
407#
408# Test programs - not built by default, and not installed.
409#
410filtertest: filtertest.c libpcap.a
411	$(CC) $(CFLAGS) -I. -L. -o filtertest filtertest.c libpcap.a
412
413findalldevstest: findalldevstest.c libpcap.a
414	$(CC) $(CFLAGS) -I. -L. -o findalldevstest findalldevstest.c libpcap.a
415
416install: libpcap.a pcap-config
417	[ -d $(DESTDIR)$(libdir) ] || \
418	    (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir))
419	$(INSTALL_DATA) libpcap.a $(DESTDIR)$(libdir)/libpcap.a
420	$(RANLIB) $(DESTDIR)$(libdir)/libpcap.a
421	[ -d $(DESTDIR)$(includedir) ] || \
422	    (mkdir -p $(DESTDIR)$(includedir); chmod 755 $(DESTDIR)$(includedir))
423	[ -d $(DESTDIR)$(includedir)/pcap ] || \
424	    (mkdir -p $(DESTDIR)$(includedir)/pcap; chmod 755 $(DESTDIR)$(includedir)/pcap)
425	[ -d $(DESTDIR)$(mandir)/man1 ] || \
426	    (mkdir -p $(DESTDIR)$(mandir)/man1; chmod 755 $(DESTDIR)$(mandir)/man1)
427	[ -d $(DESTDIR)$(mandir)/man3 ] || \
428	    (mkdir -p $(DESTDIR)$(mandir)/man3; chmod 755 $(DESTDIR)$(mandir)/man3)
429	[ -d $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@ ] || \
430	    (mkdir -p $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@)
431	[ -d $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@ ] || \
432	    (mkdir -p $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@)
433	$(INSTALL_DATA) $(srcdir)/pcap/pcap.h \
434	    $(DESTDIR)$(includedir)/pcap/pcap.h
435	$(INSTALL_DATA) $(srcdir)/pcap/bpf.h \
436	    $(DESTDIR)$(includedir)/pcap/bpf.h
437	$(INSTALL_DATA) $(srcdir)/pcap/namedb.h \
438	    $(DESTDIR)$(includedir)/pcap/namedb.h
439	$(INSTALL_DATA) $(srcdir)/pcap/sll.h \
440	    $(DESTDIR)$(includedir)/pcap/sll.h
441	$(INSTALL_DATA) $(srcdir)/pcap/usb.h \
442	    $(DESTDIR)$(includedir)/pcap/usb.h
443	$(INSTALL_DATA) $(srcdir)/pcap.h $(DESTDIR)$(includedir)/pcap.h
444	$(INSTALL_DATA) $(srcdir)/pcap-bpf.h \
445	    $(DESTDIR)$(includedir)/pcap-bpf.h
446	$(INSTALL_DATA) $(srcdir)/pcap-namedb.h \
447	    $(DESTDIR)$(includedir)/pcap-namedb.h
448	$(INSTALL_PROGRAM) pcap-config $(DESTDIR)$(bindir)/pcap-config
449	for i in $(MAN1); do \
450		$(INSTALL_DATA) $(srcdir)/$$i \
451		    $(DESTDIR)$(mandir)/man1/$$i; done
452	for i in $(MAN3PCAP); do \
453		$(INSTALL_DATA) $(srcdir)/$$i \
454		    $(DESTDIR)$(mandir)/man3/$$i; done
455	ln $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_name.3pcap \
456		 $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap
457	ln $(DESTDIR)$(mandir)/man3/pcap_dump_open.3pcap \
458		 $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
459	ln $(DESTDIR)$(mandir)/man3/pcap_geterr.3pcap \
460		 $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
461	ln $(DESTDIR)$(mandir)/man3/pcap_inject.3pcap \
462		 $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
463	ln $(DESTDIR)$(mandir)/man3/pcap_loop.3pcap \
464		 $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
465	ln $(DESTDIR)$(mandir)/man3/pcap_major_version.3pcap \
466		 $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap
467	ln $(DESTDIR)$(mandir)/man3/pcap_next_ex.3pcap \
468		 $(DESTDIR)$(mandir)/man3/pcap_next.3pcap
469	ln $(DESTDIR)$(mandir)/man3/pcap_open_offline.3pcap \
470		 $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap
471	ln $(DESTDIR)$(mandir)/man3/pcap_setnonblock.3pcap \
472		 $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap
473	for i in $(MANFILE); do \
474		$(INSTALL_DATA) $(srcdir)/`echo $$i | sed 's/.manfile.in/.manfile/'` \
475		    $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
476	for i in $(MANMISC); do \
477		$(INSTALL_DATA) $(srcdir)/`echo $$i | sed 's/.manmisc.in/.manmisc/'` \
478		    $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
479
480install-shared: install-shared-$(DYEXT)
481install-shared-so: libpcap.so
482	$(INSTALL_PROGRAM) libpcap.so.`cat VERSION` $(DESTDIR)$(libdir)/libpcap.so.`cat VERSION`
483install-shared-dylib: libpcap.dylib
484	$(INSTALL_PROGRAM) libpcap.`cat VERSION`.dylib $(DESTDIR)$(libdir)/libpcap.`cat VERSION`.dylib
485	VER=`cat VERSION`; cd $(DESTDIR)$(libdir) && ln -sf libpcap.$$VER.dylib libpcap.A.dylib;  ln -sf libpcap.A.dylib libpcap.dylib
486
487uninstall:
488	rm -f $(DESTDIR)$(libdir)/libpcap.a
489	rm -f $(DESTDIR)$(includedir)/pcap/pcap.h
490	rm -f $(DESTDIR)$(includedir)/pcap/bpf.h
491	rm -f $(DESTDIR)$(includedir)/pcap/namedb.h
492	rm -f $(DESTDIR)$(includedir)/pcap/sll.h
493	rm -f $(DESTDIR)$(includedir)/pcap/usb.h
494	-rmdir $(DESTDIR)$(includedir)/pcap
495	rm -f $(DESTDIR)$(includedir)/pcap.h
496	rm -f $(DESTDIR)$(includedir)/pcap-bpf.h
497	rm -f $(DESTDIR)$(includedir)/pcap-namedb.h
498	for i in $(MAN1); do \
499		rm -f $(DESTDIR)$(mandir)/man1/$$i; done
500	for i in $(MAN3PCAP); do \
501		rm -f $(DESTDIR)$(mandir)/man3/$$i; done
502	rm -f  $(DESTDIR)$(mandir)/man3/pcap_datalink_val_to_description.3pcap
503	rm -f  $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap
504	rm -f  $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap
505	rm -f  $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap
506	rm -f  $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap
507	rm -f  $(DESTDIR)$(mandir)/man3/pcap_minor_version.3pcap
508	rm -f  $(DESTDIR)$(mandir)/man3/pcap_next.3pcap
509	rm -f  $(DESTDIR)$(mandir)/man3/pcap_fopen_offline.3pcap
510	rm -f  $(DESTDIR)$(mandir)/man3/pcap_getnonblock.3pcap
511	for i in $(MANFILE); do \
512		rm -f $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@/`echo $$i | sed 's/.manfile.in/.@MAN_FILE_FORMATS@/'`; done
513	for i in $(MANMISC); do \
514		rm -f $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@/`echo $$i | sed 's/.manmisc.in/.@MAN_MISC_INFO@/'`; done
515
516clean:
517	rm -f $(CLEANFILES) libpcap*.dylib libpcap.so*
518
519distclean: clean
520	rm -f Makefile config.cache config.log config.status \
521	    config.h gnuc.h os-proto.h bpf_filter.c pcap-config \
522	    stamp-h stamp-h.in
523	rm -f $(MAN3PCAP_EXPAND:.in=) $(MANFILE:.in=) $(MANMISC:.in=)
524	rm -rf autom4te.cache
525
526tags: $(TAGFILES)
527	ctags -wtd $(TAGFILES)
528
529packaging/pcap.spec: packaging/pcap.spec.in VERSION
530	RPMVERSION=`cat VERSION | sed s/-.*//g`; \
531		sed -e s/@VERSION@/$$RPMVERSION/ -e s/@NAME@/libpcap-`cat VERSION`/ $<   > $@
532
533releasetar:
534	@cwd=`pwd` ; dir=`basename $$cwd` ; name=$(PROG)-`cat VERSION` ; \
535	   mkdir $$name; \
536	   tar cf - $(CSRC) $(HDR) $(MAN1) $(MAN3PCAP_EXPAND) \
537	      $(MAN3PCAP_NOEXPAND) $(MANFILE) $(MANMISC) $(EXTRA_DIST) | \
538	      (cd $$name; tar xf -); \
539	   tar -c -z -f $$name.tar.gz $$name; \
540	   rm -rf $$name
541
542depend:	$(GENSRC) $(GENHDR) bpf_filter.c
543	./mkdep -c $(CC) $(DEFS) $(INCLS) $(SRC)
544
545Makefile: Makefile.in config.status
546	./config.status
547	@echo your Makefile was out of date, now run $(MAKE) again
548	exit 1
549