target=hyperbib
all:${target}.pdf clean
bibsrc=bib.bib
bibtmp=${target}.bib
${target}.tex:${bibsrc}
	cat ${bibsrc} | sed -e 's/^\s*_url\s*=\s*{\s*lib/\turl = {http:\/\/lib.nocnt.ru\/lib/' > ${bibtmp}
	./maketexforbib ${bibtmp} > ${target}.tex
${target}.pdf:${target}.tex
	pdflatex ${target}.tex
	bibtex ${target}.aux
	pdflatex ${target}.tex
	pdflatex ${target}.tex
clean:
	rm -f ${target}.tex ${bibtmp} ${target}.dvi ${target}.out ${target}.aux ${target}.log ${target}.bbl ${target}.blg ${target}.bcf
distclean:clean
	rm -f ${target}.pdf
