# /u/sy/beebe/tex/bib/Makefile, Tue Nov  2 11:45:14 1999
# Edit by Nelson H. F. Beebe <beebe@math.utah.edu>
# Add BLGCLEAN and BLGFILTER variables, and update
# all rules and targets to use them.
# /u/sy/beebe/tex/bib/Makefile, Thu Oct  7 13:21:23 1999
# Edit by Nelson H. F. Beebe <beebe@math.utah.edu>
# Add install target and INSTALL-* variables.
# /u/sy/beebe/tex/bib/Makefile, Tue Jul 27 16:39:21 1999
# Edit by Nelson H. F. Beebe <beebe@math.utah.edu>
# Add ieeetransnetworking.bib
# /u/sy/beebe/tex/bib/Makefile, Fri Mar 10 09:29:16 1995
# Edit by Nelson H. F. Beebe <beebe@plot79.math.utah.edu>
# Add *.ser to clobber target.
# Update with support for address, author/editor, institution, journal,
# and publisher indexes in .awx, .ewx, .iwx, .jwx, and .pwx files.
# /u/sy/beebe/tex/bib/Makefile, Sun Sep  4 19:01:37 1994
# Edit by Nelson H. F. Beebe <beebe@sunrise>
# Update with new bibliographies, and new spelling error rules
# /u/sy/beebe/tex/bib/Makefile, Fri Jul 22 19:30:19 1994
# Edit by Nelson H. F. Beebe <beebe@plot79.math.utah.edu>
# Add hash.bib, matlab.bib, spell.bib
# Add special target for reduce.twx, since it must be constructed
# from multiple .bib files
# /u/sy/beebe/tex/bib/Makefile, Tue Oct  5 13:55:16 1993
# Edit by Nelson H. F. Beebe <beebe@plot79.math.utah.edu>
# Add .twx support and reorder some Makefile lines.  Add GNU standard targets.
# /u/sy/beebe/tex/bib/Makefile, Wed Sep 29 19:05:20 1993
# Edit by Nelson H. F. Beebe <beebe@plot79.math.utah.edu>
# Add internet.bib and unix.bib
# /u/sy/beebe/tex/bib/Makefile, Fri Mar 12 10:41:50 1993
# Edit by Nelson H. F. Beebe <beebe@plot79.math.utah.edu>
# Add komoedie.bib
# /u/sy/beebe/tex/bib/Makefile, Wed Nov 18 08:09:45 1992
# Edit by Nelson H. F. Beebe <beebe@plot79.math.utah.edu>
# Add epstein.bib
# /u/sy/beebe/tex/bib/Makefile, Tue Jul 21 09:45:12 1992
# Edit by Nelson H. F. Beebe <beebe@plot79.math.utah.edu>
# Add acm.bib and as.bib.
# /u/sy/beebe/tex/bib/Makefile, Sun Jun 14 09:32:58 1992
# Edit by Nelson H. F. Beebe <beebe@plot79.math.utah.edu>
# /home/csc-sun/a/sy/beebe/tex/bib/Makefile, Tue Jan 14 16:37:32 1992
# Edit by Nelson H. F. Beebe <beebe@jeeves.math.utah.edu>
# /home/csc-sun/a/sy/beebe/tex/bib/Makefile, Thu Oct 24 16:46:48 1991
# Edit by Nelson H. F. Beebe <beebe@jeeves.math.utah.edu>
# /u/sy/beebe/tex/bib/Makefile, Sat Nov 17 15:58:42 1990
# Edit by Nelson H.F. Beebe <beebe@plot79.math.utah.edu>
# ======================================================================
# Makefile for files in ~beebe/tex/bib, a collection of BibTeX
# bibliography files.
#
# Usage:
#	make BIB=target
#	make BIB=target BST=style [DST=] target-style
#
# For the latter case, the default style is is-unsrt.  If DST= is
# specified, then the default two-column output will be changed to
# one column.
#
# Targets:
#
# all		bibliographies in alpha order
# acm		Collected Algorithms of the ACM
# all_brec	automatic differentiation bibliograph,
# as		Applied Statistics journal
# asi		NATO Advanced Study Institute Proceedings
# bmpd		BMDP statistics package
# books		bibliography of books only from master.bib
# byrnes	Jim Byrnes' proposals
# cacm		Communications of the ACM
# cgf		Computer Graphics Forum
# clean		remove files that can be recreated by running make again
# clobber	make very clean
# compsurv	ACM Computing Surveys
# compsys	Computing Systems
# distclean	same as clobber
# ep		Electronic publishing conferences et al
# epodd		Electronic Publishing journal
# epstein	bibliography of windowing systems and security
# fparith	floating-point arithmetic
# gut		Cahier GUTenberg
# gvl		Golub/Van Loan Matrix Computations bibliography
# hash		hashing algorithms
# ibmjrd	IBM Journal of Research and Development
# ibmsysj	IBM Systems Journal
# infoproc1970	Information Processing Letters (1970--1979)
# infoproc1980	Information Processing Letters (1980--1989)
# infoproc1990	Information Processing Letters (1990--1999)
# institut	institutional abbreviations
# intbib	interior point methods for mathematical programming
# internet	books about the Internet and networking
# jclt		Journal of C Language Translation
# journal	journal abbreviations
# kbmath	Karl Berry's mathematics bibliography
# knuth-donald-e Donald E. Knuth's publications
# komoedie	Die TeXnische Komoedie bibliography
# litprog	bibliography of literate programming books and articles
# maple-extract	Maple symbolic algebra system
# master	personal library bibliography
# mathematica	Mathematica symbolic algebra system
# matlab	MATLAB on-line matrix algebra system
# mrabbrev	Math Reviews abbreviations
# mostlyclean	same as clean
# ovr		Ortega/Voigt/Romine bibliography of numerical computation
# postscri	bibliography of PostScript-related books and journals
# publish	publisher abbreviations
# reading	bibliography of font readability
# redbooks	Reduce symbolic algebra system
# realclean	same as clobber
# s-plus	S-Plus statistics system
# sas		SAS statistics system
# sgml		Standard Generalized Markup System
# sigada	ACM SIGAda Ada Letters
# signum	ACM SIGNUM Newsletter
# sigplan1960	ACM SIGPLAN Notices (1960--1969)
# sigplan1970	ACM SIGPLAN Notices (1970--1979)
# sigplan1980	ACM SIGPLAN Notices (1980--1989)
# sigplan1990	ACM SIGPLAN Notices (1990--1999)
# sigplan2000	ACM SIGPLAN Notices (2000--2009)
# spe		Software--Practice and Experience
# spell		spelling error correction and detection
# standard	bibliography of computer software standards
# texbook1	bibliography of TeX-related books and articles
# texbook2	bibliography of books and journals published with TeX
# texbook3	successor to texbook1
# texgraph	TeX and graphics
# texjourn	journals published using TeX
# texnique	bibliography of TeX Users Group TeXniques series
# tog		ACM Transactions on Graphics
# toms		ACM Transactions on Mathematical Software
# trees		bibliography on typesetting of trees
# tugboat	TUGboat
# type		bibliography of typography
# unicode	Unicode 16-bit character set
# unix		UNIX operating system and related issues
# xres		The X Resource
#
# By default, we do bibliographies in alpha order; this is preferable to
# plain (which gives the same reference order) so we can test the
# correctness of alphanumeric bibliography labels.  To generate listings
# of the bibliographies in plain unsorted order, do
#
#	make BIB=foo BST=is-unsrt foo-is-unsrt
#
# This useful for proof-reading bibliographies from journal bibliography
# files, since the entries are displayed in the order they occur in the
# bibliography file, which is presumably in order by volume, number, and
# page.
#
# [10-Mar-1995]
# ======================================================================

ALL-BIB                 = acm.bib all_brec.bib as1950.bib as1960.bib \
			  as1970.bib as1980.bib as1990.bib as2000.bib asi.bib \
			  bmdp.bib byrnes.bib cacm.bib cgf.bib compsurv.bib \
			  compsys.bib combinprobabcomput.bib css.bib ep.bib \
			  epodd.bib epstein.bib focs.bib focs1980.bib \
			  focs1990.bib focs2000.bib fparith.bib gut.bib \
			  gvl.bib hash.bib ibmjrd.bib ibmsysj.bib \
			  infoproc1970.bib infoproc1980.bib infoproc1990.bib \
			  institut.bib intbib.bib internet.bib jclt.bib \
			  journal.bib kbmath.bib knuth-donald-e.bib \
			  komoedie.bib litprog.bib maple-extract.bib \
			  master.bib mathematica.bib matlab.bib mrabbrev.bib \
			  ora.bib ovr.bib postscri.bib publish.bib \
			  reading.bib redbooks.bib reduce.bib s-plus.bib \
			  sas.bib sgml.bib sgml2000.bib sigada.bib \
			  sigarch.bib signum.bib sigplan1960.bib \
			  sigplan1970.bib sigplan1980.bib sigplan1990.bib \
			  sigplan2000.bib sigsam.bib spe.bib spell.bib \
			  sqlbooks.bib standard.bib stoc.bib stoc1960.bib \
			  stoc1970.bib stoc1980.bib stoc1990.bib stoc2000.bib \
			  texbook2.bib texbook3.bib texgraph.bib texjourn.bib \
			  texnique.bib tog.bib toms.bib trees.bib tugboat.bib \
			  type.bib typeset.bib unicode.bib unix.bib xres.bib

ALL			= books $(ALL-BIB:.bib=)

ALL-BBL			= $(ALL-BIB:.bib=.bbl)

ALL-LTX			= $(ALL-BIB:.bib=.ltx)

ALL-EL			= isbn.el

ALL-TWX			= $(ALL-BIB:.bib=.twx)

AWK			= nawk

BIB			= cgf

BIBCLEAN		= bibclean

BIBCLEANFLAGS		= -delete-empty -remove-OPT-prefixes -keep-parbreaks

BIBLEX			= biblex

# For rfc.bib and super.bib, we need a dynamic-array version of bibtex, from the TeXLive CD ROM:
BIBTEX			= /cdrom/texlive/bin/sparc-solaris2.5/bibtex
BIBTEX			= /usr/local/share/lib/texlive/bin/sparc-solaris2.5/bibtex
BIBTEX			= /usr/local/lib/tex/texlive/bin/sparc-solaris2.5.1/bibtex
BIBTEX			= bibtex
BIG-BIBTEX		= /usr/local/share/lib/texlive/bin/sparc-solaris2.5/bibtex
BIG-BIBTEX		= /usr/local/share/lib/tex/texlive3/bin/sparc-solaris2.5.1/bibtex
BIG-BIBTEX		= /usr/local/share/lib/tex/texlive/bin/sparc-solaris2.5.1/bibtex
BIG-BIBTEX		= /usr/local/share/lib/tex/texlive/bin/sparc-solaris2.7/bibtex
BIG-BIBTEX		= /usr/local/share/lib/tex/texlive/bin/sparc-solaris/bibtex

# This command is used to remove clutter from .blg files, and then remove empty .blg files
BLGCLEAN		= if [ -s $*.blg ] ; then $(BLGFILTER) < $*.blg >$*.blg.tmp ; $(MV) $*.blg.tmp $*.blg ; fi ; if [ ! -s $*.blg ] ; then $(RM) $*.blg ; fi

# TeXlive BibTeX produces a .blg file of clutter which obscures the real
# errors, so we apply this filter below
BLGFILTER		= $(EGREP) -v -e '^This is BibTeX|^The top-level auxiliary|^The style file:|^Database file|^Reallocated|^You.ve|locations,$$|characters,$$|all, are:$$|-- [0-9]+'

BST			= is-unsrt

# For detex version 2.3 or earlier
DETEX			= detex
# For detex version 2.4 or later
DETEX			= detex -m -n -s

DEV			= alw

DISTILL			= distill

DOCUMENTOPTIONS		= \\documentstyle\[bibmods,bibnames,showtags,

DVIALW			= dvialw-type1

DST			= twocolumn

EGREP			= egrep

# Need GNU find here for -mmin option support
FIND			= /usr/local/bin/find

FTPDIR			= /u/ftp/pub/tex/bib

# Prefer gawk to nawk, because it has toupper() and IGNORECASE
# built-in variable, and does not have the brainless 4096-byte limit
# on variable sizes that most vendor-provided nawk implementations do.
GAWK			= gawk

GREP			= egrep

HTML-NCHECK		= html-ncheck

HTTPURL			= http://www.math.utah.edu/pub/tex/bib

# This list is normally empty; it is intended to be set on the
# command line with "make install INSTALL-FILES=..."
INSTALL-FILES		=

INSTALL-FTP		= ./INSTALL-FTP

ISPELL			= ispell
ISPELL			= env LC_ALL=C ispell 2>/dev/null

# NB 1: This list must be duplicated in idx/Makefile and ftp/idx/Makefile
# NB 2: Remember to update idx/make-journal-table-entries.awk with new
#       entries in Journal_Name[] whenever this list is changed
JOURNAL-BIBFILES        = actainfo.bib adauserj.bib advquantumchem.bib \
			  algorithmica.bib amermathmonthly1890.bib \
			  amermathmonthly1900.bib amermathmonthly1910.bib \
			  amermathmonthly1920.bib amermathmonthly1930.bib \
			  amermathmonthly1940.bib amermathmonthly1950.bib \
			  amermathmonthly1955.bib amermathmonthly1960.bib \
			  amermathmonthly1965.bib amermathmonthly1970.bib \
			  amermathmonthly1975.bib amermathmonthly1980.bib \
			  amermathmonthly1990.bib amstat.bib \
			  annhistcomput.bib applmathcomput.bib \
			  applmathcomput2000.bib applnummath.bib as1950.bib \
			  as1960.bib as1970.bib as1980.bib as1990.bib \
			  as2000.bib bit.bib byte1970.bib byte1980.bib \
			  byte1990.bib byte1995.bib cacm1950.bib cacm1960.bib \
			  cacm1970.bib cacm1980.bib cacm1990.bib cacm2000.bib \
			  canjmath.bib canmathbull.bib cccuj.bib \
			  cccuj2000.bib ccpe.bib cgf.bib cgworld.bib \
			  chicjtheorcomputsci.bib combinprobabcomput.bib \
			  compgraph.bib compj.bib compj2000.bib complang.bib \
			  complngs.bib compnet.bib compnetamsterdam1990.bib \
			  compnetamsterdam2000.bib compnetisdn.bib \
			  compsurv.bib compsys.bib \
			  computanimvirtualworlds.bib computer1970.bib \
			  computer1980.bib computer1990.bib computer2000.bib \
			  computing.bib computscieng.bib computsystscieng.bib \
			  cpe.bib cppreport.bib cryptologia.bib cvgip.bib \
			  datamation.bib dectechj.bib \
			  designscodescryptogr.bib dr-dobbs-1980.bib \
			  dr-dobbs-1990.bib dr-dobbs-2000.bib eleccomp.bib \
			  epodd.bib focs1980.bib focs1990.bib focs2000.bib \
			  fortran-forum.bib futgencompsys.bib gut.bib \
			  higherordersymbcomput.bib hpj.bib ibmjrd.bib \
			  ibmsysj.bib ieeeannhistcomput.bib ieeecga.bib \
			  ieeecomputscieng.bib ieeeconcurrency.bib \
			  ieeedistribsystonline.bib ieeemicro.bib \
			  ieeemultimedia.bib ieeepardisttech.bib \
			  ieeesecpriv.bib ieeesoft.bib \
			  ieeetransnetworking.bib ieeetranspardistsys.bib \
			  ieeetransviscomputgraph.bib ijcga.bib ijcpol.bib \
			  ijfcs.bib ijhsc.bib ijig.bib ijqc.bib ijqc2000.bib \
			  ijsa.bib imajapplmath.bib imajnumeranal.bib \
			  infoproc1970.bib infoproc1980.bib infoproc1990.bib \
			  infoproc2000.bib intel-tech-j.bib \
			  intjcomputinfsci.bib intjparallelprogram.bib \
			  intjparemerdistsys.bib issac.bib jacm.bib \
			  jamstatassoc.bib japplstat.bib javarep.bib \
			  javaworld.bib jcd.bib jclt.bib jcomputgraphstat.bib \
			  jcryptology.bib jdigitalinfo.bib jea.bib jeric.bib \
			  jetc.bib jgraphtools.bib jgridcomp.bib \
			  jidq.bib jinstmathappl.bib jmathphys1960.bib \
			  jmathphys1965.bib jmathphys1970.bib \
			  jmathphys1975.bib jmathphys1980.bib \
			  jmathphys1985.bib jmathphys1990.bib \
			  jmathphys1995.bib jmathphys2000.bib \
			  jpardistcomp.bib jstatsoft.bib jsuper.bib \
			  jsymcomp.bib jsystsoftw.bib jucs.bib \
			  jviscompanimation.bib linala1960.bib linala1970.bib \
			  linala1980.bib linala1990.bib linala2000.bib \
			  linux-journal.bib lispsymbcomput.bib \
			  lms-j-comput-math.bib lncs.bib lncs1990.bib \
			  lncs1991.bib lncs1992.bib lncs1993.bib lncs1994.bib \
			  lncs1995a.bib lncs1995b.bib lncs1996a.bib \
			  lncs1996b.bib lncs1997a.bib lncs1997b.bib \
			  lncs1998a.bib lncs1998b.bib lncs1999a.bib \
			  lncs1999b.bib lncs2000.bib lncs2001a.bib \
			  lncs2001b.bib lncs2001c.bib lncs2001d.bib \
			  lncs2002a.bib lncs2002b.bib lncs2002c.bib \
			  lncs2002d.bib lncs2002e.bib lncs2003a.bib \
			  lncs2004a.bib loplas.bib maple-tech.bib \
			  markuplang.bib math-comput-sci.bib \
			  mathcomp1940.bib mathcomp1950.bib \
			  mathcomp1960.bib mathcomp1970.bib mathcomp1980.bib \
			  mathcomp1990.bib mathcomp2000.bib microsys.bib \
			  nordic-j-computing.bib numeralgorithms.bib \
			  numlinaa.bib nummath.bib nummath2000.bib \
			  opencomp.bib opensyst.bib opersysrev.bib \
			  parallelalgorithmsappl.bib parallelcomputing.bib \
			  paralleldistcomppract.bib parallelprocesslett.bib \
			  pods.bib queue.bib sciam1970.bib sciam1980.bib \
			  sciam1990.bib sciam2000.bib scicomputprogram.bib \
			  sciprogram.bib serif.bib siam.bib \
			  siamjalgdiscmeth.bib siamjappldynsyst.bib \
			  siamjapplmath.bib siamjapplmath2000.bib \
			  siamjcomput.bib siamjcontrol.bib \
			  siamjcontroloptim.bib siamjdiscrmath.bib \
			  siamjmatanaappl.bib siamjmathana.bib \
			  siamjnumeranal.bib siamjnumeranal2000.bib \
			  siamjopt.bib siamjscicomput.bib \
			  siamjscistatcomp.bib siammms.bib siamreview.bib \
			  sigada.bib sigarch.bib siggraph.bib \
			  siggraph2000.bib sigmod.bib signum.bib \
			  sigplan1960.bib sigplan1970.bib sigplan1980.bib \
			  sigplan1990.bib sigplan2000.bib sigsam.bib \
			  smithsonian1980.bib smithsonian1990.bib \
			  smithsonian2000.bib spe.bib stoc1960.bib \
			  stoc1970.bib stoc1980.bib stoc1990.bib stoc2000.bib \
			  sttt.bib supercom.bib superrev.bib sysadmin.bib \
			  taas.bib taccess.bib taco.bib talg.bib talip.bib \
			  tap.bib tcbb.bib tcs1975.bib tcs1980.bib \
			  tcs1985.bib tcs1990.bib tcs1995.bib tcs2000.bib \
			  tecs.bib theoryprobabappl.bib tissec.bib tkdd.bib \
			  toce.bib tochi.bib tocl.bib tocs.bib toct.bib \
			  todaes.bib tods.bib tog.bib tois.bib toit.bib \
			  tomacs.bib tomccap.bib toms.bib toois.bib \
			  toplas.bib tos.bib tosem.bib tosn.bib trets.bib \
			  tslp.bib tugboat.bib tweb.bib vldbj.bib \
			  xjournal.bib xres.bib

# We need a big version of TeX to handle some of these large bibliographies
LATEX			= latex2e
LATEX			= latex

LATEX2E			= latex2e

LS			= ls

MYSPELL			= myspell
MYSPELL			= env LC_COLLATE=C myspell

MV			= mv

NEWER			= newer

RM			= rm -f

SED			= sed

SEDFILTER	= $(SED) -e 's/\\bibliographystyle{[^}]*}/\\bibliographystyle{$(BST)}/' \
		-e 's/$(DOCUMENTOPTIONS)twocolumn/$(DOCUMENTOPTIONS)$(DST)/'

SORT			= env LC_COLLATE=C sort
SORT			= env LC_ALL=C sort

SPELL			= env LC_COLLATE=C spell
SPELL			= env LC_ALL=C spell

STYLES			= bibmods.sty bibnames.sty is-alpha.bst is-plain.bst \
			is-unsrt.bst

TEX			= tex

# This value must agree with that set in idx/Makefile
TIMESTAMPFILE		= ./.time-stamp

TOUCH			= touch

UNWRAPBBL		= ./unwrapbbl

WC			= wc

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

.PRECIOUS:	knuth-donald-e.aux

.SUFFIXES:

.SUFFIXES:        .cwx .ber .bbl .aux .pdf .ps .dvi-$(DEV) .dvi .ser .awx .ewx \
		  .iwx .jwx .pwx .twx .html .install-log .bib-new .bib .ltx .tex .kwic .ptx

.aux.bbl:
	-$(BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)

.aux.cwx:
	$(GAWK) '/\\bibcite|\\citation/ { \
		gsub(/[{}]/," "); \
		if ($$2 != "*") \
		{ \
		    n = split($$2,words,","); \
		    for (k = 1; k <= n; ++k) \
		        printf("%-15s\t%-15s\t%s\t%s\n", \
			    tolower(words[k]),words[k],words[k],"label"); \
		} \
		}' $< | \
		sort -u -f -t'	' +0 -1 +2 -3 | \
		$(GAWK) -f fmtwords.awk > $@

# We need to run check-bbl twice in order to handle cases
# of a braced word following an unbraced word.
.bbl.ber:
	$(GAWK) -f check-bbl.awk $< > $@
	$(GAWK) -f check-bbl.awk $< > $@

# Some bibliographies contain \toenglish ... \endtoenglish which must
# be filtered out, since they don't expand to printable text

.bib.awx:		# address word index
	$(BIBLEX) < $< | $(GAWK) -f keywords.awk | \
		egrep -v "^toenglish|^endtoenglish" | \
		grep 'address$$' | \
		$(GAWK) -f fmtwords.awk >$@

.bib.bbl:
	-$(BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)

.bib.ber:
	$(MAKE) $*.bbl $*.ber

.bib.bib-new:
	-$(BIBCLEAN) $(BIBCLEANFLAGS) $< > $@

# During the first two LaTeX passes, discard complaints about
# undefined citations, to reduce output clutter.  The final pattern
# discards portions of warning lines that wrap to a new line.
.bib.dvi .ltx.aux .ltx.dvi:
	-$(RM) $*.bbl
	-$(MAKE) $*.twx
	-if [ ! -s $*.bbl ] ; then touch $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

.bib.ewx:		# author/editor word index
	$(BIBLEX) < $< | $(GAWK) -f keywords.awk | \
		egrep -v "^toenglish|^endtoenglish" | \
		egrep 'author$$|editor$$' | \
		sort -u | \
		$(GAWK) -f fmtwords.awk >$@

.bib.html:
	$(AWK) -f bibtex-to-html.awk $<

# This special rule is used by "make install"; it allows parallel
# make runs with
#	make install INSTALL-FILES="..." -jnnn
#
.bib.install-log:
	$(INSTALL-FTP) $< >$@ 2>&1

.bib.iwx:		# institution word index
	$(BIBLEX) < $< | $(GAWK) -f keywords.awk | \
		egrep -v "^toenglish|^endtoenglish" | \
		grep 'institution$$' | \
		sort -u | \
		$(GAWK) -f fmtwords.awk >$@

.bib.jwx:		# journal word index
	$(BIBLEX) < $< | $(GAWK) -f keywords.awk | \
		egrep -v "^toenglish|^endtoenglish" | \
		grep 'journal$$' | \
		sort -u | \
		$(GAWK) -f fmtwords.awk >$@

.bib.ptx:
	nawk -f kwic-bib.awk <$< | ptx -r -f >$@

.bib.pwx:		# publisher word index
	$(BIBLEX) < $< | $(GAWK) -f keywords.awk | \
		egrep -v "^toenglish|^endtoenglish" | \
		grep 'publisher$$' | \
		sort -u | \
		$(GAWK) -f fmtwords.awk >$@

.bib.twx:		# title word index
	$(BIBLEX) < $< | $(GAWK) -f keywords.awk | \
		egrep -v "^toenglish|^endtoenglish" | \
		grep 'title$$' | \
		sort -u | \
		$(GAWK) -f fmtwords.awk >$@

.dvi.dvi-$(DEV):
	dvi$(DEV) -m$(MAG) $<
	cp $*.dvi-$(DEV) /$(DEV)
	rm -f $@

.dvi.ps:
	$(DVIALW) -outfile:$*.ps $<

# Sun Solaris 2.5 spell flags labels Smith:1996:ABC as spelling
# exceptions, but no other UNIX spell that I've used does so.  We
# therefore add a filter step to simply ignore them.
# [18-Nov-1998] Add two steps to extract comments and spell check them too.
# [28-Jun-2003] Add further check with new myspell program
.bib.ser .ltx.ser:
	@-if [ ! -f $*.sok ] ; then touch $*.sok ; fi
	@-cat $*.bib $*.ltx | $(DETEX) -n  | $(SED) -e 's/[0-9,.:;?&]/ /g' | $(SPELL) +$*.sok >/tmp/$*.ser
	@-cat $*.bib $*.ltx | $(DETEX) -n  | $(SED) -e 's/[0-9,.:;?&]/ /g' | $(ISPELL) -l -p $*.sok >>/tmp/$*.ser
	@-cat $*.bib $*.ltx | $(DETEX) -n  | $(SED) -e 's/[0-9,.:;?&]/ /g' | $(MYSPELL) +$*.sok >>/tmp/$*.ser
	@-cat $*.bib $*.ltx | $(GREP) '^%' | $(SED) -e 's/[0-9,.:;?&]/ /g' | $(SPELL) +$*.sok >>/tmp/$*.ser
	@-cat $*.bib $*.ltx | $(GREP) '^%' | $(SED) -e 's/[0-9,.:;?&]/ /g' | $(ISPELL) -l -p $*.sok >>/tmp/$*.ser
	@-cat $*.bib $*.ltx | $(GREP) '^%' | $(SED) -e 's/[0-9,.:;?&]/ /g' | $(MYSPELL) +$*.sok >>/tmp/$*.ser
	@-$(SORT) -u /tmp/$*.ser | egrep -v ':[12][0-9][0-9x][0-9x]:' >$*.ser
	@-$(RM) /tmp/$*.ser
#	-if [ ! -s $*.ser ] ; then $(RM) $*.ser ; fi
	-$(LS) -l $*.ser
	-$(WC) -l $*.ser

.ltx.bbl:
	@-if [ ! -f $*.twx ] ; then $(TOUCH) $*.twx ; fi
	-$(LATEX) $<
	@-if [ ! -s $*.twx ] ; then $(RM) $*.twx ; fi
	-$(BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)

.ps.pdf:
	$(DISTILL) $<

.ptx.kwic:
	sed -f ptx.sed <$< >$@

.tex.aux .tex.dvi:
	$(TEX) $<

.tex.ser:
	-if [ ! -f $*.sok ] ; then touch $*.sok ; fi
	-cat $*.bib $*.tex | $(DETEX) -n | $(SPELL) +$*.sok >/tmp/$*.ser
	-cat $*.bib $*.tex | $(DETEX) -n | $(ISPELL) -l -p $*.sok >>/tmp/$*.ser
	-$(SORT) -u /tmp/$*.ser >$*.ser
	-$(RM) /tmp/$*.ser

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

# Put this one first for "make BIB=foobar" convenience
$(BIB):			$(BIB).dvi

all:
	for f in $(ALL);\
	do \
		make $$f.ser $$.dvi
	done

all-$(BST):
	for f in $(ALL);\
	do \
		make "BIB=$$f" "BST=$(BST)" $$f-$(BST).dvi ;\
	done

# Generic targets for all bibliographies

$(BIB).dvi:	$(STYLES) $(BIB).bib $(BIB).ltx

$(BIB)-$(BST):		$(BIB)-$(BST).dvi

$(BIB)-$(BST).dvi:	$(STYLES) $(BIB).bib $(BIB)-$(BST).ltx

$(BIB)-$(BST).ltx:	$(BIB).ltx
	$(SEDFILTER) <$(BIB).ltx >$(BIB)-$(BST).ltx

/tmp/bib.tar:	$(STYLES) $(ALL-BIB) $(ALL-BBL) $(ALL-EL) $(ALL-LTX) \
		Makefile CHECKSUM
	tar cf /tmp/bib.tar $?

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

# books.bib consists only of book entries from master.bib
books.bib:	master.bib
	bibextract "" "^@[Bb]ook" master.bib > books.bib

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

clean mostlyclean:
	@- $(RM) core
	@- $(RM) *.blg
	@- $(RM) *.dvi*
	@- $(RM) *.log
	@- $(RM) *.lst
	@- $(RM) *.ptx
	@- $(RM) *.kwic
	@- $(RM) *~* \#*
	@- $(RM) *-$(BST).aux *-$(BST).ltx

clobber distclean realclean:	clean
	@- $(RM) *.aux
	@- $(RM) *.ber
	@- $(RM) *.ewx
	@- $(RM) *.ser
	@- $(RM) *.twx
	@- $(RM) *.bbl
	@- $(RM) books.bib


# Make a list of bibliography revision dates, in ascending order
DATE-LIST:	*.ltx
	$(GREP) '^%%% *date *=' *.ltx | \
	    $(SORT) +5n -6 +4M -5 | \
	    $(AWK) -F: '{printf("%-32s%s\n", $$1, $$2)}' > $@

html-files:
	$(MAKE)	`echo *.bib | $(SED) -e 's/[.]bib/.html/g'`

install:	$(INSTALL-FILES:.bib=.install-log)

REDUCE-BIB-FILES	= red-a-f.bib red-g-l.bib red-m-z.bib
reduce.twx:	$(REDUCE-BIB-FILES)
	cat $(REDUCE-BIB-FILES) | $(BIBLEX) | $(GAWK) -f keywords.awk | \
		$(GAWK) -f fmtwords.awk >reduce.twx

# Check the spelling in $(BIB).bib and $(BIB).ltx, leaving exceptions
# in $(BIB).ser.  Both spell and ispell are used.

spell:
	$(MAKE) $(BIB).ser

TWX:	$(ALL-TWX)

verify-checksum:	verify-checksum.time-stamp

verify-checksum.time-stamp:	$(ALL-BIB) $(ALL-EL) $(ALL-LTX)
	for f in $?;\
	do \
		if [ $$f = "reduce.bib" ] ;\
		then echo >/dev/null ;\
		elif checksum -v $$f >/dev/null ;\
		then echo >/dev/null ;\
		else echo Checksum failure on $$f ;\
		fi ;\
	done
	touch checksum.time-stamp

# Special rules for .bib files that need BIG-BIBTEX or LATEX2E

bit.dvi:	bit.ltx bit.twx bit.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

compj.dvi:	compj.ltx compj.twx compj.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

cryptography.dvi:	cryptography.ltx cryptography.twx cryptography.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

cryptologia.dvi:	cryptologia.ltx cryptologia.twx cryptologia.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

cvgip.dvi:	cvgip.ltx cvgip.twx cvgip.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

fortran3.dvi:	fortran3.bib fortran3.ltx ieeestd.sty

fparith.dvi:	fparith.ltx fparith.twx fparith.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

ibmsysj.dvi:	ibmsysj.ltx ibmsysj.twx ibmsysj.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

ieeecga.dvi:	ieeecga.ltx ieeecga.twx ieeecga.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

ieeestd.dvi:	ieeestd.bib ieeestd.ltx ieeestd.sty

ijqc.dvi:	ijqc.ltx ijqc.twx ijqc.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

internet.dvi:	internet.ltx internet.twx internet.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX2E) $*.ltx

java.dvi:	java.ltx java.twx java.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX2E) $*.ltx

linala1990.dvi:	linala1990.ltx linala1990.twx linala1990.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

linux-journal.dvi:	linux-journal.ltx linux-journal.twx linux-journal.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX2E) $*.ltx

lncs.dvi:	lncs.ltx lncs.twx lncs.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

lncs1998a.dvi:	lncs1998a.ltx lncs1998a.twx lncs1998a.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

lncs1998b.dvi:	lncs1998b.ltx lncs1998b.twx lncs1998b.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

lncs2000.dvi:	lncs2000.ltx lncs2000.twx lncs2000.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

lncs2001a.dvi:	lncs2001a.ltx lncs2001a.twx lncs2001a.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

lncs2001b.dvi:	lncs2001b.ltx lncs2001b.twx lncs2001b.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

lncs2001c.dvi:	lncs2001c.ltx lncs2001c.twx lncs2001c.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

lncs2001d.dvi:	lncs2001d.ltx lncs2001d.twx lncs2001d.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

lncs2002a.dvi:	lncs2002a.ltx lncs2002a.twx lncs2002a.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

lncs2002b.dvi:	lncs2002b.ltx lncs2002b.twx lncs2002b.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

lncs2002c.dvi:	lncs2002c.ltx lncs2002c.twx lncs2002c.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

lncs2002d.dvi:	lncs2002d.ltx lncs2002d.twx lncs2002d.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

lncs2002e.dvi:	lncs2002e.ltx lncs2002e.twx lncs2002e.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

mathcomp.dvi:	mathcomp.ltx mathcomp.twx mathcomp.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX2E) $*.ltx

mathcomp1940.dvi:	mathcomp1940.ltx mathcomp1940.twx mathcomp1940.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX2E) $*.ltx

mathcomp1950.dvi:	mathcomp1950.ltx mathcomp1950.twx mathcomp1950.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX2E) $*.ltx

mathcomp1960.dvi:	mathcomp1960.ltx mathcomp1960.twx mathcomp1960.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX2E) $*.ltx

mathcomp1970.dvi:	mathcomp1970.ltx mathcomp1970.twx mathcomp1970.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX2E) $*.ltx

mathcomp1980.dvi:	mathcomp1980.ltx mathcomp1980.twx mathcomp1980.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX2E) $*.ltx

mathcomp1990.dvi:	mathcomp1990.ltx mathcomp1990.twx mathcomp1990.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX2E) $*.ltx

mathcomp2000.dvi:	mathcomp2000.ltx mathcomp2000.twx mathcomp2000.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX2E) $*.ltx

microchip.dvi:	microchip.ltx microchip.twx microchip.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX2E) $*.ltx

# Make .ser files for .bib files changed in the last 10 minutes
newser new-ser:
	$(MAKE) `$(FIND) *.bib -mmin -10 | sed -e 's/[.]bib/.ser/' `

nummath.dvi:	nummath.ltx nummath.twx nummath.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

pods.dvi:	pods.ltx pods.twx pods.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

rfc.dvi:	rfc.ltx rfc.twx rfc.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

siggraph.dvi:	siggraph.ltx siggraph.twx siggraph.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

super.dvi:	super.ltx super.twx super.bib ieeestd.sty
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

supercomputing2002.dvi:	supercomputing2002.ltx supercomputing2002.twx supercomputing2002.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx

std.dvi:	std.ltx std.twx std.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIG-BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX) $*.ltx
	$(LATEX) $*.ltx

tugboat.dvi:	tugboat.ltx tugboat.twx tugboat.bib
	@-if [ ! -f $*.bbl ] ; then $(TOUCH) $*.bbl ; fi
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	@-if [ ! -s $*.bbl ] ; then $(RM) $*.bbl ; fi
	-$(BIBTEX) $*
	-$(UNWRAPBBL) $*
	-$(BLGCLEAN)
	-$(LATEX2E) $*.ltx | egrep -v 'LaTeX Warning: Citation.*undefined|^$$|^[0-9]*[.]$$'
	$(LATEX2E) $*.ltx

# File dependencies: too bad make ".x.y:" rules cannot handle this
# automatically
acm.dvi:	acm.ltx acm.twx
as1950.dvi:	as1950.ltx as1950.twx
as1960.dvi:	as1960.ltx as1960.twx
as1970.dvi:	as1970.ltx as1970.twx
as1980.dvi:	as1980.ltx as1980.twx
as1990.dvi:	as1990.ltx as1990.twx
as2000.dvi:	as2000.ltx as2000.twx
asi.dvi:	asi.ltx asi.twx
books.dvi:	books.ltx books.twx
cgf.dvi:	cgf.ltx cgf.twx
css.dvi:	css.ltx css.twx
compsys.dvi:	compsys.ltx compsys.twx
ep.dvi:		ep.ltx ep.twx
epodd.dvi:	epodd.ltx epodd.twx
epstein.dvi:	epstein.ltx epstein.twx
gut.dvi:	gut.ltx gut.twx
gvl.dvi:	gvl.ltx gvl.twx
iccmse2007.dvi:	iccmse2007.ltx iccmse2007.twx
intbib.dvi:	intbib.ltx intbib.twx
intel-ia-64.dvi:	intel-ia-64.ltx intel-ia-64.twx
internet.dvi:	internet.ltx internet.twx
jclt.dvi:	jclt.ltx jclt.twx
kbmath.dvi:	kbmath.ltx kbmath.twx
komoedie.dvi:	komoedie.ltx komoedie.twx
litprog.dvi:	litprog.ltx litprog.twx
maple-extract.dvi:	maple-extract.ltx maple-extract.twx
master.dvi:	master.ltx master.twx
postscri.dvi:	postscri.ltx postscri.twx
reading.dvi:	reading.ltx reading.twx
redbooks.dvi:	redbooks.ltx redbooks.twx
reduce.dvi:	reduce.ltx reduce.twx
standard.dvi:	standard.ltx standard.twx
taas.dvi:	taas.ltx taas.twx
texbook1.dvi:	texbook1.ltx texbook1.twx
texbook2.dvi:	texbook2.ltx texbook2.twx
texgraph.dvi:	texgraph.ltx texgraph.twx
texjourn.dvi:	texjourn.ltx texjourn.twx
texnique.dvi:	texnique.ltx texnique.twx
tkdd.dvi:	tkdd.ltx tkdd.twx
toct.dvi:	toct.ltx toct.twx
toms.dvi:	toms.ltx toms.twx
trees.dvi:	trees.ltx trees.twx
tugboat.dvi:	tugboat.ltx tugboat.twx
type.dvi:	type.ltx type.twx
tweb.dvi:	tweb.ltx tweb.twx
unix.dvi:	unix.ltx unix.twx
unix2.dvi:	unix2.ltx unix.twx
visual-instruction-set.dvi:	visual-instruction-set.ltx xres.twx
xres.dvi:	xres.ltx xres.twx

AWK-FILES	= keywords.awk fmtwords.awk

acm.twx:	acm.bib $(AWK-FILES)
as.twx:		as.bib $(AWK-FILES)
asi.twx:	asi.bib $(AWK-FILES)
books.twx:	books.bib $(AWK-FILES)
cgf.twx:	cgf.bib $(AWK-FILES)
css.twx:	css.bib $(AWK-FILES)
compsys.twx:	compsys.bib $(AWK-FILES)
ep.twx:		ep.bib $(AWK-FILES)
epodd.twx:	epodd.bib $(AWK-FILES)
epstein.twx:	epstein.bib $(AWK-FILES)
gut.twx:	gut.bib $(AWK-FILES)
gvl.twx:	gvl.bib $(AWK-FILES)
iccmse2007.twx:	iccmse2007.bib $(AWK-FILES)
intbib.twx:	intbib.bib $(AWK-FILES)
intel-ia-64.twx:	intel-ia-64.bib $(AWK-FILES)
internet.twx:	internet.bib $(AWK-FILES)
jclt.twx:	jclt.bib $(AWK-FILES)
kbmath.twx:	kbmath.bib $(AWK-FILES)
komoedie.twx:	komoedie.bib $(AWK-FILES)
litprog.twx:	litprog.bib $(AWK-FILES)
maple-extract.twx:	maple-extract.bib $(AWK-FILES)
master.twx:	master.bib $(AWK-FILES)
postscri.twx:	postscri.bib $(AWK-FILES)
reading.twx:	reading.bib $(AWK-FILES)
redbooks.twx:	redbooks.bib $(AWK-FILES)
standard.twx:	standard.bib $(AWK-FILES)
taas.twx:	taas.bib $(AWK-FILES)
texbook1.twx:	texbook1.bib $(AWK-FILES)
texbook2.twx:	texbook2.bib $(AWK-FILES)
texgraph.twx:	texgraph.bib $(AWK-FILES)
texjourn.twx:	texjourn.bib $(AWK-FILES)
texnique.twx:	texnique.bib $(AWK-FILES)
tkdd.twx:	tkdd.bib $(AWK-FILES)
toct.twx:	toct.bib $(AWK-FILES)
toms.twx:	toms.bib $(AWK-FILES)
trees.twx:	trees.bib $(AWK-FILES)
tugboat.twx:	tugboat.bib $(AWK-FILES)
type.twx:	type.bib $(AWK-FILES)
tweb.twx:	tweb.bib $(AWK-FILES)
unix.twx:	unix.bib $(AWK-FILES)
visual-instruction-set.twx:	visual-instruction-set.bib $(AWK-FILES)
xres.twx:	xres.bib $(AWK-FILES)

# Special dependencies for a complex bibliography with multiple
# cross-reference indexes
knuth-donald-e.aux:
	if [ ! -f $@ ] ; then touch $@ ; fi

knuth-donald-e.dvi:       knuth-donald-e.ltx knuth-donald-e.awx \
			  knuth-donald-e.cwx knuth-donald-e.ewx \
			  knuth-donald-e.iwx knuth-donald-e.jwx \
			  knuth-donald-e.pwx knuth-donald-e.twx
	$(MAKE) knuth-donald-e.awx knuth-donald-e.ewx \
		knuth-donald-e.iwx knuth-donald-e.jwx \
		knuth-donald-e.pwx knuth-donald-e.twx
	touch knuth-donald-e.cwx
	$(LATEX) knuth-donald-e.ltx
	$(MAKE) knuth-donald-e.cwx knuth-donald-e.bbl
	$(LATEX) knuth-donald-e.ltx
	$(MAKE) knuth-donald-e.cwx knuth-donald-e.bbl
	$(LATEX) knuth-donald-e.ltx
	$(MAKE) knuth-donald-e.cwx knuth-donald-e.bbl
	$(LATEX) knuth-donald-e.ltx

knuth-donald-e.awx:	knuth-donald-e.bib $(AWK-FILES)
knuth-donald-e.cwx:	knuth-donald-e.bib $(AWK-FILES) knuth-donald-e.aux
knuth-donald-e.ewx:	knuth-donald-e.bib $(AWK-FILES)
knuth-donald-e.iwx:	knuth-donald-e.bib $(AWK-FILES)
knuth-donald-e.jwx:	knuth-donald-e.bib $(AWK-FILES)
knuth-donald-e.pwx:	knuth-donald-e.bib $(AWK-FILES)
knuth-donald-e.twx:	knuth-donald-e.bib $(AWK-FILES)

spss.dvi:       spss.ltx spss.ewx spss.twx
	$(LATEX) spss.ltx
	$(MAKE) spss.bbl
	$(LATEX) spss.ltx
	$(MAKE) spss.bbl
	$(LATEX) spss.ltx

spss.ewx:	spss.bib $(AWK-FILES)

# This target recreates all of the FTP toc/*.html files that are
# out-of-date with respect to their corresponding *.bib files.

toc-html-files:
	if [ ! -d $(FTPDIR)/toc ] ; \
	then \
		mkdir $(FTPDIR)/toc ; \
	fi
	for f in $(JOURNAL-BIBFILES) ; \
	do \
		if [ -f $(FTPDIR)/$$f ] ; \
		then \
			g=`basename $$f .bib` ; \
			if test ! -f $(FTPDIR)/toc/$$g.html ; \
			then \
				echo $$g ; \
				$(BIBCLEAN) -no-warning -max-width 0 $$f | \
				$(GAWK) -f journal-toc.awk -v HTML=1 BIBFILEURL=$(HTTPURL)/$$g.html \
					>$(FTPDIR)/toc/$$g.html ; \
				$(HTML-NCHECK) $(FTPDIR)/toc/$$g.html ; \
				$(TOUCH) $(TIMESTAMPFILE) ; \
			elif newer $(FTPDIR)/$$f $(FTPDIR)/toc/$$g.html ; \
			then \
				echo $$g ; \
				$(BIBCLEAN) -no-warning -max-width 0 $$f | \
				$(GAWK) -f journal-toc.awk -v HTML=1 BIBFILEURL=$(HTTPURL)/$$g.html \
					>$(FTPDIR)/toc/$$g.html ; \
				$(HTML-NCHECK) $(FTPDIR)/toc/$$g.html ; \
				$(TOUCH) $(TIMESTAMPFILE) ; \
			fi ; \
		fi ; \
	done
