# /u/ftp/pub/bibnet/tools/examples/Makefile, Fri Sep 15 09:31:26 1995 # Edit by Nelson H. F. Beebe # Update .bib.twx rule for new versions of fmtwords.awk and keywords.awk # /u/ftp/pub/bibnet/tools/examples/Makefile, Wed Mar 30 18:56:44 1994 # Edit by BibNet # ====================================================================== # Makefile for files in /pub/bibnet/tools/examples, 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. # # Current target list: # all # /tmp/bib.tar # clean # mostlyclean # clobber # distclean # realclean # TWX # verify-checksum # verify-checksum.time-stamp # bibtex-doc.dvi # template.dvi # bibtex-doc.twx # template.twx # # # 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. # # [30-Mar-1994] # ====================================================================== ALL-BIB = bibtex-doc.bib template.bib ALL = $(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) BIB = cgf $(BIB): $(BIB).dvi $(BIB)-$(BST): $(BIB)-$(BST).dvi AWK = nawk BIBLEX = biblex BIBTEX = bibtex BST = is-unsrt DETEX = detex DEV = alw DST = twocolumn # Prefer gawk to nawk, because it has toupper() and IGNORECASE # built-in variable. GAWK = gawk # We need a big version of TeX to handle some of these large bibliographies LATEX = latex RM = rm -f DOCUMENTOPTIONS = \\documentstyle\[bibmods,bibnames,showtags, SED = sed -e 's/\\bibliographystyle{[^}]*}/\\bibliographystyle{$(BST)}/' \ -e 's/$(DOCUMENTOPTIONS)twocolumn/$(DOCUMENTOPTIONS)$(DST)/' STYLES = bibmods.sty bibnames.sty is-alpha.bst is-plain.bst \ is-unsrt.bst TEX = tex #======================================================================= .SUFFIXES: .SUFFIXES: .aux .dvi-$(DEV) .dvi .spell .twx .bib .ltx .tex .kwic \ .ptx .bbl .bib.bbl: -$(BIBTEX) $* .bib.dvi .ltx.aux .ltx.dvi: -$(RM) $*.bbl -$(LATEX) $*.ltx | grep -v 'LaTeX Warning: Citation.*undefined' -$(BIBTEX) $* -$(LATEX) $*.ltx | grep -v 'LaTeX Warning: Citation.*undefined' -$(LATEX) $*.ltx .bib.ptx: nawk -f kwic-bib.awk <$< | ptx -r -f >$@ .bib.twx: $(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 $@ .ltx.spell: $(DETEX) $< | spell >$@ .ptx.kwic: sed -f ptx.sed <$< >$@ .tex.aux .tex.dvi: $(TEX) $< .tex.spell: $(DETEX) $< | spell >$@ #======================================================================= all: for f in $(ALL);\ do \ make BIB=$$f ;\ done all-$(BST): for f in $(ALL);\ do \ make "BIB=$$f" "BST=$(BST)" $$f-$(BST).dvi ;\ done # Generic targets for all bibliographies $(BIB): $(BIB).twx $(BIB).dvi $(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 $(SED) <$(BIB).ltx >$(BIB)-$(BST).ltx /tmp/bib.tar: $(STYLES) $(ALL-BIB) $(ALL-BBL) $(ALL-EL) $(ALL-LTX) \ Makefile CHECKSUM tar cf /tmp/bib.tar $? # ====================================================================== 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) *.bbl @- $(RM) books.bib 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 # File dependencies: too bad make ".x.y:" rules cannot handle this # automatically bibtex-doc.dvi: bibtex-doc.ltx bibtex-doc.twx template.dvi: template.ltx template.twx AWK-FILES = keywords.awk fmtwords.awk bibtex-doc.twx: bibtex-doc.bib $(AWK-FILES) template.twx: template.bib $(AWK-FILES)