#
#	mkfile for TEX bibtex programs
APE=/sys/src/ape
< $APE/config
SITEDIR=..
OPT=-B
SHELL=/bin/rc

TARG=bibtex

OFILES=bibtex.$O\
	bibext.$O\

HFILES=bib.h\
	$SITEDIR/site.h

</sys/src/cmd/mkone

CFLAGS=$OPT -I$SITEDIR -c
LDFLAGS=
cpuobjtype=`{sed -n 's/^O=//p' /$cputype/mkfile}`

bibtex.c:	bibtex.p bibtex.defines
		$SHELL ./convert bibtex.p $target

bibtex.p:	bibtex.web bibtex.ch ../stamp-tangle.$cputype
		# redirected to stop chatter - remove redirection for debugging
		../web/$cpuobjtype.tangle bibtex.web bibtex.ch > /dev/null

../stamp-tangle.$cputype:
		cd ..; objtype=$cputype mk stamp-tangle.$cputype

install:VQ:
		echo do mk install in ..

installall:VQ:
		echo do mk installall in ..

clean:V:
		rm -f *.[$OS] [$OS].out y.tab.? y.debug y.output $TARG bibtex.pool

nuke:V:
		rm -f *.[$OS] [$OS].out y.tab.? y.debug y.output $TARG bibtex.pool
		rm -f bibtex.p bibtex.c bibtex.h coerce.h
		rm -f '#'*'#' *~ *.bak
