# ======================================================================
# Makefile for files in ~beebe/tex/tugboat
#
# This constructs the tugboat.bib file from the TUGboat table of
# contents (tb*.cnt) files using the awk program tugboat.awk, and then
# produces complete test bibliography files in alpha and unsrt form. A
# kwic index of the bibliography is also produced:
#
# Current target list:
# all tugbib + tugbib2 + tugboat-kwic
# clean remove most files that can be recreated
# by running make again
# clobber remove files that can be recreated by
# running make again
# distclean same as clobber
# install-ftp install public files in anonymous ftp
# directory
# install-sys install public files in system TeX
# directory tree
# tugboat-kwic keyword-in-context index to tugboat.bib;
# must be printed in landscape orientation.
# tugboat-kwic.dvi output of LaTeX
# maintainer-clean do distclean, then remove tugboat.bib
# mostlyclean same as clean
# tugbib bibliography in alpha order
# tugbib.bbl output of BibTeX
# tugbib.dvi output of LaTeX
# tugbib2 bibliography in unsrt order
# tugbib2.bbl output of BibTeX
# tugbib2.dvi output of LaTeX
# tugboat.bib TUGboat bibliography
# tugboat.kwic permuted index file (LaTeX form)
# tugboat.ptx permuted index file (raw form)
#
# This Makefile requires minor updates as each new issue of TUGboat
# appears: add an entry to TUGCONTENTS, and possibly to TUGSUMMARY.
#
# [15-Nov-1995]
# ======================================================================
AWK = nawk
# If you don't have bibclean, use cat instead
BIBCLEAN = bibclean
# You need an enlarged version of BibTeX for this job
BIBTEX = bibtex
install-ftp: $(FTPFILES)
$(CP) $? $(FTPDIR)
$(CP) Makefile $(FTPDIR)/makefile
date >FTP
install-sys: $(SYSFILES)
$(CP) $? $(SYSDIR)
date >SYS
tugboat-kwic: tugboat-kwic.dvi
tugboat-kwic.dvi: tugboat.kwic
tugboat-kwic-times: tugboat-kwic-times.dvi
tugboat-kwic-times.dvi: tugboat.kwic
maintainer-clean: distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
-$(RM) tugboat.bib
tugboat.kwic: tugboat.ptx ptx.sed
tugboat.ptx: tugboat.bib tugboat-kwic-bib.awk
tugbib: tugbib.dvi
# tugbib is in alpha order; this is preferable to plain (which gives
# the same reference order) so we can test the correctness of alphanumeric
# bibliography labels.
tugbib.dvi: tugbib.ltx tugboat.bib
-$(RM) tugbib.bbl
-$(RM) tugbib.aux
-$(LATEX) tugbib.ltx
-$(BIBTEX) tugbib
-$(LATEX) tugbib.ltx
-$(LATEX) tugbib.ltx
# tugbib2 is in unsrt order for checking the bibliography against the
# original TUGboat tables of contents
tugbib2.dvi: tugbib2.ltx tugboat.bib
-$(RM) tugbib2.bbl
-$(RM) tugbib2.aux
-$(LATEX) tugbib2.ltx
-$(BIBTEX) tugbib2
-$(LATEX) tugbib2.ltx
-$(LATEX) tugbib2.ltx
# NB: We store the pipeline output in a temporary file, and only if
# the steps are successful do we rename it to the final target name.
# That way, a failure won't produce an incorrect target file.
tugboat.bib: $(TUGCONTENTS) tugboat.awk Makefile tugboat.ver
$(AWK) "BEGIN {printf(\"%.2f\", `cat tugboat.ver` + 0.01)}" /dev/null >tugboat.tmp
$(MV) tugboat.tmp tugboat.ver
$(AWK) -f tugboat.awk $(TUGCONTENTS) | \
$(BIBCLEAN) | \
$(SED) -e '1r tugboat.hdr' | \
$(SED) -e s/"@@TIME@@"/"`date +%T\ %Z`"/ \
-e s/"@@DATE@@"/"`date +%d\ %B\ %Y`"/ \
-e s/"@@VERSION@@"/"`cat tugboat.ver`"/ | \
$(CHECKSUM) >tugboat.tmp
$(MV) tugboat.tmp tugboat.bib