# Generated automatically from Makefile.in by configure.
# ======================================================================
# Makefile for biblex (lexically analyze BibTeX file), bibparse (parse
# BibTeX file according to prototype grammar), and bibunlex
# (reconstruct BibTeX file from lexical token stream).	biblex and
# bibunlex are lex/flex-based, and bibparse is yacc/bison-based.
#
# Current target list:
#	all			(default) make biblex and test
#	biblex			lex-based BibTeX lexer
#	biblex.o
#	bibparse.c
#	bibparse.o
#	bibparse		yacc-based BibTeX parser
#	bibparse.jar		Java Jar distribution archive
#	bibparse.shr		shar bundle of distribution archive
#	bibparse.tar		UNIX tar distribution archive
#	bibparse.txt		ASCII text of formatted manual pages
#	bibparse.zip		InfoZIP distribution archive
#	bibparse.zoo		Zoo distribution archive
#	bibunlex		filter to convert biblex token stream to
#				BibTeX format
#	bibunlex.c
#	bibunlex.o
#	check			same as check-programs
#	check-docs		spelling and doubled-word checks on
#				documentation
#	check-programs		run validation suite
#	clean			clean up trash and object files
#	clobber			same as distclean
#	configure		regenerate configure script (NB:
#				requires GNU autoheader and autoconf)
#	configure.time-stamp	dummy file to record that patches
#				have been applied to the configure script
#	distclean		clean up everything for a rebuild or
#				redistribution
#	docs			make HTML, PostScript, PDF, and formatted
#				text files from man pages
#	dw			doubled-word check on manual pages
#	html-files		make HTML files from manual pages
#	install			install bibdup, biblex, bibparse, and
#				bibunlex in system directories
#	install-ftp		install distributions at author's ftp site
#	lexmain.o
#	maintainer-clean	remove everything that can be rebuilt
#				with tools available at the author's
#				site (for maintainer only: do NOT do this
#				yourself!)
#	mostlyclean		same as clean
#	pdf-files		make PDF files from PostScript files
#	programs		compile and link executable programs
#	ps-files		make PostScript files from man pages
#	spell			spell check manual pages
#	TAGS			GNU Emacs tags file for fast editing
#	test-version		check version number extraction for
#				other make targets
#	txt-files		make ASCII text files from man pages
#	uninstall		remove all files installed in system
#				directories by "make install"
#
# [08-May-1999] -- update for bibparse version 1.04 release
# [01-Jun-1998] -- update for use with GNU autoconfigure
# [16-Jan-1993]
# ======================================================================

prefix		= /usr/local

# Change these to suit local conventions:
BINDIR		= $(prefix)/bin
FTPDIR		= /u/ftp/pub/tex/bib
SHRLIBDIR	= $(prefix)/share/lib/bibdup
MANDIR		= $(prefix)/man
MANEXT		= 1

# Use lcc or gcc with extra flags for extensive error checking, or use
# C++ compiler (g++ or CC).  DO NOT CHANGE ANY OF THESE VALUES:
# instead, copy one of these to the end of the CC list to select your
# compiler.  You may also set the DEFINES value below too, though that
# is rarely necessary.

## # NB: On SGI IRIX 4.0.x, if you do not have C++, then you must use
## # 'CC = cc -cckr' to compile biblex.c and bibunlex.c, because the
## # lex-generated code contains a line
## #	FILE *yyin = {stdin}, *yyout = {stdout};
## # which will not compile when the c89 version of stdio.h is used.
##
## CC	= c89			## DEC Alpha OSF/1 Standard C compiler
## CC	= cxx			## DEC Alpha OSF/1 C++ compiler
## CC	= CC			## C++ for BSD 4.3 UNIX on HP 370
## CC	= CC +a1 -xansi +w	## C++ for SGI IRIX 4.0 (see LOADLIBES below)
## CC	= cc -ansiposix -fullwarn -woff 22,24,183,205,262,269,302,303
##				   ## C for SGI IRIX 4.0
## CC	= CC +a1 +p +w -D_POSIX_SOURCE -Hansi -D__STDC__ -D_BSD -D_AIX -Dps2 \
##	  -DHAVE_TERMIO_H
##				   ## C++ on AIX 370 and PS/2: +a1 (ANSI
##				   ## declarations), +p (no anachronisms), +w
##				   ## (warnings) -D-BSD (to get toupper() and
##				   ## tolower() declared in ctype.h).
##				   ## Need -DHAVE_TERMIO_H because termios.h
##				   ## has wrong prototypes for C++
## CC	= CC +a1 +p +w -D_POSIX_SOURCE -Hansi -D__STDC__ -D_BSD -D_AIX -D_AIX370
##				   ## C++ on AIX 370
## CC	= cc -Hansi -D_POSIX_SOURCE	## cc on AIX 370 and AIX PS/2
## CC	= /usr/CC/sun4/CC -I/usr/CC/incl -D__SUNCC__ ## C++ on SunOS 4.1.1
## CC	= acc -Xc -vc -strconst -D__ACC__ -D_POSIX_SOURCE -DHAVE_TERMIOS_H
##				   ## SunOS Standard C compiler (neither
##				   ## -DHAVE_SGTTY_H nor -DHAVE_TERMIO_H gives
##				   ## char-at-a-time input, sigh...; they work
##				   ## fine on other systems).
## CC	= c89 -D_POSIX_SOURCE -D_ALL_SOURCE	## IBM RS/6000
## CC	= xlC			## IBM RS/6000 C++
## CC	= c89 -D_HPUX_SOURCE	## HP 9000/8xx HP-UX A.08
## CC	= cc			## most systems
## CC	= cc			## Stardent (NB: remove -g in OPT below)
## CC	= cc -systype bsd43 -D__CC__	## MIPS RCxxxx RISCos 4.52 and 5.2:
## CC	= cc $(GCCFLAGS)	## NeXT (cc is really GNU C compiler)
## CC	= g++ $(GCCFLAGS)	## GNU C++
## CC	= lcc -A -A -n		## Princeton/AT&T Standard C compiler
## CC	= gcc $(GCCFLAGS)	## GNU C
##
## # Compiler for this site:
## CC	= g++ $(GCCFLAGS)	## GNU C++
## CC	= gcc $(GCCFLAGS)	## GNU C
## CC	= cc -Xc -D__ACC__ -D__solaris ## Sun Solaris 2.x
##

# These values are set when configure is run:
CC		= cc
CXX		= c++
CFLAGS          =  $(DEFINES) $(INCLUDES) $(OPT)
CXXFLAGS	=  $(DEFINES) $(INCLUDES) $(OPT)

# ======================================================================
# The remainder of this Makefile should not need changes

# Need new awk (nawk) or gawk here:
AWK		= nawk

# Where the executables are during "make check":
BIBLEX		= ../biblex

BIBPARSE	= ../bibparse

BIBUNLEX	= ../bibunlex

# Because we need to support rather long BibTeX tokens (e.g., a long
# abstract string), we need a MUCH larger yytext[] token buffer than the
# default, which is often just 512 or 1024.
#
# Unfortunately, some lex implementations (e.g., Sun Solaris 2.x) emit
# use of YYLMAX before the code from the %{...%} section of the .l file,
# or without allowing a command-line definition to set it, so even
# though biblex.l redefines YYLMAX internally, that definition may be
# too late.
#
# Thus, we must also define it on the compiler command line, and use it
# in $(SEDFILTER) below.
#
# These values MUST all match, so we call them all BIBYYLMAX.  This
# is now the ONLY place where the magic value is set, so it can be
# trivially redefined at make time if needed.
#
# Note: For a long time, this value was 40960 (or 32768 on IBM PC
# systems).  However, a few bibliographies in the TeX User Group
# collection have even longer strings, and setting it to 81920 proved
# to be big enough for all of them.  To allow for growth, we set it
# even larger, to 128K.
BIBYYLMAX	= 131072

CHMOD		= chmod

# Extra flags for gcc and g++ to get maximal checking
GCCFLAGS	= -Wall -Wshadow -Wcast-qual -Wpointer-arith -Wwrite-strings

COMPRESS	= /usr/local/bin/gzip

CP		= scp -p

DEFINES		=  -D__EXTERN_C__ -DBIBYYLMAX=$(BIBYYLMAX)

DEROFF		= deroff

DIFF		= diff

DISTILL		= /usr/local/bin/distill

DITROFF		= groff

ETAGS		= etags

EXPAND		= expand

INCLUDES	= -I.

JAR		= jar

LDFLAGS		= 

LIBS		= -ll  -ly

# For flex, need to manually remove the %a and %o table size lines
LEX		= lex

LN		= ln -s

LS		= ls

# man2html is available at ftp://ftp.math.utah.edu/pub/sgml/man2html-x.yy.*
MAN2HTML	= /usr/local/bin/man2html

MKDIR		= mkdir -p

MV		= mv

NROFF		= nroff

# This variable defined to be empty, with the intent that the user can
# set it on the make command line at build time to choose fancy
# compiler-dependent optimization switches.
OPT		=

# NB: Put bibparse before biblex to avoid unnecessary recompilation
# of biblex: bibparse creates a special temporary version of biblex.o
PROGRAMS	= bibparse biblex bibunlex

RM		= rm -f

RMDIR		= rmdir

SED		= sed

# See above for why we need to substitute YYLMAX by BIBYYLMAX in the
# first sed pattern.
#
# The peculiar second sed pattern removes a line generated by HP HP-UX
# 10.x lex which causes a fatal compilation error because of an
# argument mismatch with the real definition of main().
#
# The third sed pattern resets any definition of YYLMAX to make it
# equal to BIBYYLMAX, in case it gets used before it is reset later.
#
# The fourth sed pattern removes an erroneous declation of getenv() by
# yacc on GNU/Linux systems.
SEDFILTER	= $(SED) -e 's/char *yytext *\[YYLMAX\]/char yytext[$(BIBYYLMAX)]/' \
		  -e '/static void __yy__unused() { main(); }/d' \
		  -e 's/\#[ 	]*define[ 	]*YYLMAX.*$$/\#define YYLMAX BIBYYLMAX/' \
		  -e '/extern[ 	]*char[ 	]*[*]getenv[ 	]*[(][ 	]*[)]/d'

SHAR		= shar

# This variable is not used directly, but some make implementations
# (e.g., SGI IRIX) use it to decide what shell to invoke commands in.
# We require the original Bourne shell, sh (or a syntax-compatible
# variant, such as ksh or bash).
SHELL		= /bin/sh

SPELL		= spell +bibfiles.sok

TAR		= tar

TOUCH		= touch

UNZIP		= unzip

VERSION		= `$(AWK) '/^[ \t]*version *= *"[0-9.]+", *$$/ \
		{ gsub(/[^0-9.]/,"",$$3); print $$3 }' bibparse.y`

YACC		= yacc

YFLAGS		= -v 

ZIP		= zip

ZOO		= zoo

#=======================================================================
# File lists:

BASEPROGS	= $(PROGRAMS) bibdup

CHECK-FILES     = test/check.bat test/docheck.sh test/lex001.in \
		  test/lex002.in test/lex003.in test/lex004.in test/lex005.in \
		  test/okay/lex001.err test/okay/lex001.out \
		  test/okay/lex002.err test/okay/lex002.out \
		  test/okay/lex003.err test/okay/lex003.out \
		  test/okay/lex004.err test/okay/lex004.out \
		  test/okay/lex005.err test/okay/lex005.out \
		  test/okay/parse001.err test/okay/parse001.out \
		  test/okay/parse002.err test/okay/parse002.out \
		  test/okay/parse003.err test/okay/parse003.out \
		  test/okay/parse004.err test/okay/parse004.out \
		  test/okay/parse005.err test/okay/parse005.out \
		  test/okay/parse006.err test/okay/parse006.out \
		  test/okay/parse007.err test/okay/parse007.out \
		  test/okay/parse008.err test/okay/parse008.out \
		  test/okay/parse009.err test/okay/parse009.out \
		  test/okay/parse010.err test/okay/parse010.out \
		  test/okay/parse011.err test/okay/parse011.out \
		  test/okay/parse012.err test/okay/parse012.out \
		  test/okay/parse013.err test/okay/parse013.out \
		  test/okay/parse014.err test/okay/parse014.out \
		  test/okay/parse015.err test/okay/parse015.out \
		  test/okay/unlex001.err test/okay/unlex001.out \
		  test/okay/unlex002.err test/okay/unlex002.out \
		  test/okay/unlex003.err test/okay/unlex003.out \
		  test/okay/unlex004.err test/okay/unlex004.out \
		  test/okay/unlex005.err test/okay/unlex005.out \
		  test/parse001.in test/parse002.in test/parse003.in \
		  test/parse004.in test/parse005.in test/parse006.in \
		  test/parse007.in test/parse008.in test/parse009.in \
		  test/parse010.in test/parse011.in test/parse012.in \
		  test/parse013.in test/parse014.in test/parse015.in \
		  test/unlex001.in test/unlex002.in test/unlex003.in \
		  test/unlex004.in test/unlex005.in test/update.sh

# These variables list the basenames of the test files.  Those named XXX*.in
# are input files for bibXXX, those named okay/XXX*.out contain correct
# output on stdout from bibXXX for comparison with the .out files created by
# "make check", and those named okay/XXX*.err contain correct output on
# stderr from bibXXX for comparison with the XXX*.err files created by "make
# check".  All of these tests are done in the test subdirectory.

CHECK-NAMES-LEX	  = lex001 lex002 lex003 lex004 lex005

CHECK-NAMES-PARSE = parse001 parse002 parse003 parse004 parse005 \
		  parse006 parse007 parse008 parse009 parse010 \
		  parse011 parse012 parse013 parse014 parse015

CHECK-NAMES-UNLEX = unlex001 unlex002 unlex003 unlex004 unlex005

# This is the list of everything that is distributed in the various
# archive formats installed in the ftp tree:

DIST-FILES      = BUILD-BIBPARSE.sh ChangeLog Makefile.in README README.html \
		  acconfig.h args.h bibdup.awk bibdup.sin bibdup.man \
		  bibfiles.sok biblex.dat biblex.l biblex.man biblex.ok \
		  bibparse.man bibparse.y bibunlex.l bibunlex.man bibyydcl.h \
		  configure configure.in config.hin lexmain.c token.h \
		  $(CHECK-FILES) $(HTML-FILES) $(PDF-FILES) $(PS-FILES) \
		  $(TXT-FILES) save/Makefile save/biblex.c save/bibunlex.c \
		  save/bibparse.c save/config.h save/configure

HTML-FILES	= $(MAN-FILES:.man=.html)

MAN-FILES	= bibdup.man biblex.man bibparse.man bibunlex.man

PDF-FILES	= $(MAN-FILES:.man=.pdf)

PS-FILES	= $(MAN-FILES:.man=.ps)

TAGS-FILES	= biblex.l bibparse.y bibunlex.l

TXT-FILES	= $(MAN-FILES:.man=.txt)

#=======================================================================

.SUFFIXES:	.html .pdf .ps .txt .man .i .c .y

.c.i:
	$(CC) -E $(CFLAGS) $< >$@

.l.c:
	$(LEX) -t $< | $(SEDFILTER) > $@

.man.html:
	$(MAN2HTML) $<

.ps.pdf:
	$(DISTILL) $<

.y.c:
	$(YACC) $(YFLAGS) $<
	$(SEDFILTER) < y.tab.c > $@
	-$(RM) y.tab.c

.y.i:
	$(MAKE) $*.c
	$(MAKE) $*.i
	-$(RM) $*.c

.man.ps:
	$(DITROFF) -Tps -man $? >$@

.man.txt:
	$(DITROFF) -Tascii -man $? >$@

#=======================================================================

all:	programs

bibdup.sh:	bibdup.sin Makefile
	-$(RM) -f $@
	$(SED)  -e 's=_LIBDIR_=$(SHRLIBDIR)=g' \
		-e 's=_BINDIR_=$(BINDIR)=g' \
		-e 's=_AWK_=$(AWK)=g' \
		<bibdup.sin >$@
	$(CHMOD) 555 $@

biblex:	lexmain.c biblex.c args.h bibyydcl.h token.h
	$(CC) $(CFLAGS) -o biblex lexmain.c biblex.c $(LDFLAGS) $(LIBS)

biblex.c:	biblex.l

bibparse.c:	bibparse.y

# We create a temporary empty yacc.h file to avoid a compilation
# error from HP's version, and g++'s failure to find it at all.
# This is harmless on other systems.
bibparse.o:	bibparse.c args.h bibyydcl.h
	@$(TOUCH) yacc.h
	$(CC) $(CFLAGS) -c bibparse.c
	@-$(RM) yacc.h

# We make this dependency on biblex.c, not biblex.o, because we need
# to recompile it with yylex changed to xxlex for use inside bibparse
bibparse:	bibparse.o biblex.c args.h bibyydcl.h token.h
	$(CC) $(CFLAGS) -Dyylex=xxlex -o bibparse bibparse.o biblex.c $(LDFLAGS) $(LIBS)
	@-$(RM) biblex.o

bibparse.jar:	$(DIST-FILES)
	-$(RM) bibparse.jar bibparse.jar-lst
	$(JAR) cf bibparse.jar $(DIST-FILES)
	-$(MKDIR) bibparse-$(VERSION)
	cd bibparse-$(VERSION); $(JAR) xf ../bibparse.jar
	$(JAR) cf bibparse-$(VERSION).jar bibparse-$(VERSION)
	-$(RM) -rf bibparse-$(VERSION)
	-$(RM) bibparse.jar
	$(LN) bibparse-$(VERSION).jar bibparse.jar

# The shar bundle intentionally omits the leading directory name,
# bibparse-x.y.z, because shar bundles can be extracted on other systems
# (e.g., IBM PC DOS) which do not permit multiple periods in file names, or
# seriously limit the length of file names.
bibparse.shr:	$(DIST-FILES)
	-$(RM) bibparse*.shr
	$(SHAR) $(DIST-FILES) >bibparse-$(VERSION).shr
	$(LN) bibparse-$(VERSION).shr bibparse.shr 

bibparse.tar:	$(DIST-FILES)
	-$(RM) bibparse.tar bibparse.tar-lst
	$(TAR) chf bibparse.tar $(DIST-FILES)
	-$(MKDIR) bibparse-$(VERSION)
	cd bibparse-$(VERSION); tar xf ../bibparse.tar
	$(TAR) cf bibparse-$(VERSION).tar bibparse-$(VERSION)
	-$(RM) -r bibparse-$(VERSION)
	-$(RM) bibparse.tar
	$(LN) bibparse-$(VERSION).tar bibparse.tar

bibparse.txt:	bibparse.man
	$(NROFF) -man bibparse.man | col -b | $(EXPAND) >$@

bibparse.zip:	$(DIST-FILES)
	-$(RM) bibparse*.zip bibparse*.zip-lst
	$(ZIP) bibparse-$(VERSION).zip $(DIST-FILES)
	$(UNZIP) -v bibparse-$(VERSION).zip >bibparse-$(VERSION).zip-lst
	$(LN) bibparse-$(VERSION).zip bibparse.zip

bibparse.zoo:	$(DIST-FILES)
	-$(RM) bibparse*.zoo bibparse*.zoo-lst
	$(ZOO) a bibparse-$(VERSION).zoo $(DIST-FILES)
	$(ZOO) v bibparse-$(VERSION).zoo >bibparse-$(VERSION).zoo-lst
	$(LN) bibparse-$(VERSION).zoo bibparse.zoo

bibunlex:	bibunlex.c
	$(CC) $(CFLAGS) -o bibunlex bibunlex.c $(LDFLAGS) $(LIBS)

bibunlex.c:	bibunlex.l

check:	check-programs

check-docs:	dw spell

check-programs:	check-biblex check-bibparse check-bibunlex

check-biblex:	biblex
	@echo ""
	@echo "The following checks should produce no output, other than their names"
	@cd test; ./docheck.sh $(BIBLEX) $(CHECK-NAMES-LEX)

check-bibparse:	bibparse
	@echo ""
	@echo "The following checks should produce no output, other than their names"
	@cd test; ./docheck.sh $(BIBPARSE) $(CHECK-NAMES-PARSE)

check-bibunlex:	bibunlex
	@echo ""
	@echo "The following checks should produce no output, other than their names"
	@cd test; ./docheck.sh $(BIBUNLEX) $(CHECK-NAMES-UNLEX)

clean:
	-$(RM) *.i
	-$(RM) *.o
	-$(RM) *~
	-$(RM) \#*
	-$(RM) biblex.tmp
	-$(RM) bibparse.output
	-$(RM) core
	-$(RM) lex.yy.c
	-$(RM) y.output
	-$(RM) yacc.h

clobber:	distclean

configure:
	autoconf
	autoheader
	-$(RM) config.cache
	$(MAKE) configure.time-stamp

# Work around a serious flaw in GNU configure: it always inserts -g
# -O2 in CFLAGS and CXXFLAGS.  -g cannot be used with $(OPT) on many
# systems, and -O2 is not supported on many systems.
configure.time-stamp:	configure Makefile.in
	$(MV) configure configure.tmp
	$(SED)	\
		-e 's/CFLAGS=" *-g */CFLAGS="/' \
		-e 's/CFLAGS=" *-O2 */CFLAGS="/' \
		-e 's/CXXFLAGS=" *-g */CXXFLAGS="/' \
		-e 's/CXXFLAGS=" *-O2 */CXXFLAGS="/' \
		< configure.tmp > configure
	$(CHMOD) 775 configure
	$(TOUCH) configure.time-stamp
	-$(RM) configure.tmp

distclean:	mostlyclean
	-$(RM) $(PROGRAMS) bibdup.sh
	-$(RM) Makefile
	-$(RM) TAGS
	-$(RM) bibparse.output
	-$(RM) bibparse*.jar
	-$(RM) bibparse*.jar-lst
	-$(RM) bibparse*.shr
	-$(RM) bibparse.tab.c
	-$(RM) bibparse*.tar
	-$(RM) bibparse*.tar-lst
	-$(RM) bibparse*.zip
	-$(RM) bibparse*.zip-lst
	-$(RM) bibparse*.zoo
	-$(RM) bibparse*.zoo-lst
	-$(RM) config.cache
	-$(RM) config.h
	-$(RM) config.log
	-$(RM) config.status
	-$(RM) y.output
	-$(RM) y.tab.c

docs:	html-files ps-files pdf-files txt-files

dw:
	@for f in $(MAN-FILES) ; \
	do \
		echo "==================== doubled words in $$f\
====================" ; \
		$(DEROFF) $$f | dw ; \
	done

html-files:	$(HTML-FILES)

install:	install-programs install-lib install-man install-show

install-ftp:	bibparse.jar bibparse.shr bibparse.tar bibparse.zip \
		bibparse.zoo uninstall-ftp
	$(CP) bibparse-$(VERSION).jar $(FTPDIR)
	$(JAR) tvf bibparse-$(VERSION).jar 2>$(FTPDIR)/bibparse-$(VERSION).jar-lst
	$(CP) bibparse-$(VERSION).shr $(FTPDIR)
	$(TAR) tvf bibparse-$(VERSION).tar >$(FTPDIR)/bibparse-$(VERSION).tar-lst
	$(COMPRESS) <bibparse-$(VERSION).tar \
		>$(FTPDIR)/bibparse-$(VERSION).tar.gz
	$(CP) bibparse-$(VERSION).zip $(FTPDIR)
	$(CP) bibparse-$(VERSION).zip-lst $(FTPDIR)
	$(CP) bibparse-$(VERSION).zoo $(FTPDIR)
	$(CP) bibparse-$(VERSION).zoo-lst $(FTPDIR)
	$(LS) -l $(FTPDIR)/bibparse-$(VERSION)*

install-lib:	uninstall-lib
	-$(MKDIR) $(SHRLIBDIR)
	$(CP) bibdup.awk $(SHRLIBDIR)/bibdup.awk
	$(CHMOD) 664 $(SHRLIBDIR)/bibdup.awk

install-man:	uninstall-man
	for program in $(BASEPROGS) ; \
	do \
		$(CP) $$program.man $(MANDIR)/man$(MANEXT)/$$program.1 ; \
		$(CHMOD) 664 $(MANDIR)/man$(MANEXT)/$$program.1 ; \
	done

install-programs:	$(PROGRAMS) bibdup.sh uninstall-programs
	for program in $(PROGRAMS) ; \
	do \
		$(CP) $$program $(BINDIR)/$$program ; \
		$(CHMOD) 775 $(BINDIR)/$$program ; \
	done ; \
	$(CP) bibdup.sh $(BINDIR)/bibdup ; \
	$(CHMOD) 775 $(BINDIR)/bibdup

install-show:
	@echo ''
	@echo Installed files...
	@for program in $(BASEPROGS) ; \
	do \
		$(LS) -l $(BINDIR)/$$program ; \
	done
	@for program in $(BASEPROGS) ; \
	do \
		$(LS) -l $(MANDIR)/man$(MANEXT)/$$program.$(MANEXT) ; \
	done
	@if test -d $(SHRLIBDIR) ; then $(LS) -lR $(SHRLIBDIR)/* ; fi
	@echo ''

maintainer-clean:	distclean
	@echo "This command is intended for maintainers to use;"
	@echo "it deletes files that may require special tools to rebuild."
	-for f in $(PROGRAMS) ; \
	do \
		$(RM) $$.html ; \
		$(RM) $$.ps ; \
		$(RM) $$.pdf ; \
		$(RM) $$.txt ; \
	done
	-$(RM) config.hin
	-$(RM) configure
	-$(RM) configure.time-stamp

mostlyclean:	clean
	-$(RM) biblex.c
	-$(RM) bibparse.c
	-$(RM) bibunlex.c

pdf-files:	$(PDF-FILES)

programs:	$(PROGRAMS)

ps-files:	$(PS-FILES)

spell:
	@for f in $(MAN-FILES) ; \
	do \
		echo "==================== spelling exceptions in $$f\
====================" ; \
		$(DEROFF) $$f | $(SPELL) ; \
	done

TAGS:	$(TAGS-FILES)
	$(ETAGS) $(TAGS-FILES)

test-version:	Makefile
	@echo "Version number is ""'"$(VERSION)"'"

txt-files:	$(TXT-FILES)

uninstall:	uninstall-programs uninstall-lib uninstall-man

uninstall-ftp:
	-$(RM) $(FTPDIR)/bibparse-$(VERSION).jar
	-$(RM) $(FTPDIR)/bibparse-$(VERSION).jar-lst
	-$(RM) $(FTPDIR)/bibparse-$(VERSION).shr
	-$(RM) $(FTPDIR)/bibparse-$(VERSION).tar-lst
	-$(RM) $(FTPDIR)/bibparse-$(VERSION).tar.gz
	-$(RM) $(FTPDIR)/bibparse-$(VERSION).zip
	-$(RM) $(FTPDIR)/bibparse-$(VERSION).zip-lst
	-$(RM) $(FTPDIR)/bibparse-$(VERSION).zoo
	-$(RM) $(FTPDIR)/bibparse-$(VERSION).zoo-lst

uninstall-lib:
	-$(RM) $(SHRLIBDIR)/bibdup.awk
	-$(RMDIR) $SHRLIBDIR)

uninstall-man:
	-for program in $(BASEPROGS) ; \
	do \
		$(RM) $(MANDIR)/man$(MANEXT)/$$program.1 ; \
		$(RM) $(MANDIR)/man$(MANEXT)/../cat$(MANEXT)/$$program.1 ; \
	done

uninstall-programs:
	-for program in $(BASEPROGS) ; \
	do \
		$(RM) $(BINDIR)/$$program ; \
	done
