#
# This file makes Bibtex.
#

SITEDIR=/
CC=lc
OPT= -cw -f8 -j100i94i84i -m2 -O
CFLAGS= -b0 -i$(SITEDIR) -r0 -v $(OPT) -dBibTeX
BLINKCMDS = LIB lib:lcm881.lib lib:lcnb.lib


.SUFFIXES: .o .c .p .ch
.SUFFIXES: .dvi .tex .ch
.ch.p:
		/web/tangle $*.web $*.ch
.p.c:
		execute convert
.c.o:
		$(CC) $(CFLAGS) $*.c
.ch.tex:
		/web/weave $*.web $*.ch
.tex.dvi:
		virtex &plain. \language=\usenglish \input $*.tex


# Routines used everywhere.
# 
commondefines=/common/common.defines /common/texmf.defines
commonh=/common/extra.h
commono=/common/extra.o /common/main.o

# Routines also used in TeX and Metafont (only).
# 
extrac=/common/fileio.c
extrah=/common/fileio.h
extrao=/common/fileio.o


default:        all

all:            bibtex

docs:		bibtex.dvi


#BibTeX
#
bibtex:		bibtex.o $(commono) $(extrao)
		blink FROM lib:c.o $*.o $(commono) $(extrao) TO $@ $(BLINKCMDS)
bibtex.o:	bibtex.c $(commonh) $(extrah)
bibtex.c:	bibtex.p $(commondefines)
bibtex.p:	bibtex.web bibtex.ch
bibtex.dvi:	bibtex.tex
		edit bibtex.tex WITH tex_to_dvi
		virtex &plain. \language=\usenglish \input bibtex.tex
bibtex.tex:	bibtex.web bibtex.ch

$(extrao):	$(extrac) $(extrah)


clean:
		delete bibtex.o bibtex QUIET

veryclean:	clean
		delete bibtex.p bibtex.c bibtex.h coerce.h QUIET
		delete bibtex.dvi bibtex.tex CONTENTS.tex bibtex.log QUIET
